RenderKit / embree

Embree ray tracing kernels repository.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Questions about model normals.

GraphicsEnthusiast opened this issue · comments

When I use embree to calculate the normal of the model, some models will have problems, such as the teapot model, but some models have no problem, such as the bunny model, and the problematic model can be rendered correctly if I use the normal calculated by myself.
wenti
![spp255](https://user-imag
3
es.githubusercontent.com/75780167/214502651-471641f7-cf07-486f-b0cf-07385061fca9.png)

Embree returns the normal in object space, while you need a world space normal for shading. Further the normal returned by Embree is the geometry normal, shading typically uses interpolated shading normals.

Thank you! But I wonder why the rabbit has no problem but the teapot has a problem. The dragon and Lucy are also fine, but Mitsuba's shader ball has the same problem.
image
1234567
123456

I want to know why the normals calculated by some models are correct, and some are not correct, and I use the rtcInterpolate0 function to interpolate the normals read from the model, and there will be problems, maybe I am not using it right. Sorry to bother you, but I really want to figure it out.

Thus you use rtcInterpolate1 and get different results when doing that same interpolation manually? This should not be the case as rtcInterpolate1 just does a simple interpolation with u/v coordinates. I assume you somehow setup the buffer wrong that holds the normals interpolated by Embree.
Anyway, for triangles we do not recommend using rtcInterpolate1 function, best use your own implementation. rtcInterpolate1 supports triangle meshes just for completeness, it will be faster to interpolate yourself.

Thank you a lot!