jeffamstutz / module_nanort

Module which forwards ray intersection calls to NanoRT ray tracing kernels: https://github.com/lighttransport/nanort
3 stars 0 forks source link

Rendering artifact #2

Closed syoyo closed 8 years ago

syoyo commented 8 years ago

NanoRT rendering in ospGlutViewer has an artifact in its rendering.

screen shot 2016-09-18 at 2 30 16 am

It looks shadow ray computation is not working well(ray offset?)

jeffamstutz commented 8 years ago

Yeah, I'll look into this more...though I didn't see it until I ran on an OS X machine (MBA, Haswell CPU). I didn't see this artifact on my linux machine at the office, though I wasn't explicitly looking for it. It appears in multiple renderers too: I've been using AO ("-r ao1") and SciVis ("-r scivis").

Here's the image rendered on Ubuntu 1604, using gcc-5.3.1:

nanort-ubuntu1604

Here's the exact same dataset/renderer/viewpoint in OS X (10.10) on my MBA, using Clang :

nanort-osx

I'll check clang on Linux....maybe this is something in NanoRT itself?

jeffamstutz commented 8 years ago

Hmmm, clang-3.8 on Ubuntu seems OK too....strange...

syoyo commented 8 years ago

I also see artifact on CentOS7(g++ 4.8.5). Probably there are some bugs in NanoRT which relates to compiler optimization...?

syoyo commented 8 years ago

Ah, you didn't set geometric normal of the hit surface correctly. Fixed in this commit: https://github.com/jeffamstutz/module_nanort/commit/2c0262ec08f889bf3f44a5994ea20709eac2b4d5

syoyo commented 8 years ago

Hmm... The artifact still appears with CentOS 7 + gcc 4.8. Primary ray looks OK, thus it looks intersection computation after the first hit is not working well.

Is there any visual debugging feature(e.g. show shading normal, geometric normal, texcoord, etc) in OSPRay, @jeffamstutz ?

jeffamstutz commented 8 years ago

Re normal: Yes, I was super lazy with calculating the geometric normal as that's typically something a ray intersection library does for you...thanks for adding that!

Re bug: With your fix for the geometry normal, the rendering artifact on the city geometry I used above on my MBA seems to have been fixed. However, if you are still seeing artifacts, you could try using one of the following renderers:

...where you pass a different renderer to the viewer on the command line via "-r [renderer]". All of our debugging renderers are in ospray/renderer/raycast/RaycastRenderer.cpp, where you can see all of the ones we register there.

syoyo commented 8 years ago

With your fix for the geometry normal, the rendering artifact on the city geometry I used above on my MBA seems to have been fixed

Yes, it looks Mac are OK. The problem may only exist in Linux platform.

However, if you are still seeing artifacts, you could try using one of the following renderers:

Thanks! This is great. I'll investigate further with this feature.

syoyo commented 8 years ago

Ah, filling geomID with RTC_INVALID_GEOMETY_ID was missing for non-hit ray. Now linux build works fine.