NVIDIA / VisRTX

NVIDIA OptiX based implementation of ANARI
Other
243 stars 25 forks source link

Rendering issues #13

Closed lynetcha closed 4 years ago

lynetcha commented 4 years ago

Hi, I am trying to render the nvidia/vMaterials/Design/Wood/Bubinga.bubinga_chocolate_oiled material (from NVIDIA's vmaterials) using sampleMDL.cpp but the result I get is different than what I expected. Any idea what might be wrong? The logs do not highlight any issues.

Result

Result

Expected

Expected

Log

log
lynetcha commented 4 years ago

The main thing that seems off in the log is that it says that OptiX version is 7.1.0 but I actually downloaded OptiX 6.0.0.

tbiedert commented 4 years ago

Thank you for your bug report!

A simple reproducer would be great. Since you're using sampleMDL.cpp as basis, can you please send me a diff?

Thanks! Tim

lynetcha commented 4 years ago

Here it is. vmat.patch.zip

tbiedert commented 4 years ago

Thanks!

The problem is that a sphere geometry does not produce texture coordinates at the hit point as you might expect. Currently, you can specify a single constant tex coord per sphere. This has historic reasons from a scientific visualization background. Additionally, there is no canonical sphere surface to 2D texture coord mapping.

In the following screenshot you can see a manually tesselated sphere (TriangleGeometry) with the material's texture correctly applied based on a spherical mapping:

wood

Modified patch: texcoord.zip

lynetcha commented 4 years ago

Thank you!

tbiedert commented 4 years ago

Btw, if you need to render many spheres with spherical texture mapping (or any other specific mapping), it shouldn't be complicated to adjust VisRTX's sphere intersection code and simply compute and output the correct texture coordinates at the hit point. Let me know if you need any help with this.

Depending on your scene, you still might be better off with a tesselation, especially on Turing where you have hardware-accelerated triangle intersection.