Basic question: material that will change the normal back

Board: Home Board index Raytracing General Development

(L) [2015/10/26] [mrluzeiro] [Basic question: material that will change the normal] Wayback!

Hello, I have a basic question.
If I assigned a material to an object that will perturb the normals, where / how that change of the normals should be applied?
Usually the objects implement a GetNormal( uv coords?) should that GetNormal function call the material function that will perturb the normal or should I only do that at shade moment and keep always the original normal?
Normal should only be used for light shading or/and also shadow and reflection/refractions?
Thanks
(L) [2015/10/27] [asyrov] [Basic question: material that will change the normal] Wayback!

GetNormal(uv...) could return final corrected (based on material) normal. Then this normal could be used for each of mentioned calculations (not sure about shadows, but possibly as minor optimization of hit test).
(L) [2015/10/29] [patlefort] [Basic question: material that will change the normal] Wayback!

You definitely need to calculate it before doing any shading calculation as they should be based on this normal. You should keep a copy of the surface real geometric normal along side and use that to displace the starting position of rays to avoid self-intersection.
(L) [2015/10/29] [szellmann] [Basic question: material that will change the normal] Wayback!

>> You should keep a copy of the surface real geometric normal along side and use that to displace the starting position of rays to avoid self-intersection.
Keeping the geometry normal around is good advice in general, because that's the one you need to determine if you process a "back-face" or a "front-face"...

back