Basic question: material that will change the normal

Practical and theoretical implementation discussion.
mrluzeiro
Posts: 28
Joined: Tue May 26, 2015 2:27 pm

Basic question: material that will change the normal

Postby mrluzeiro » Mon Oct 26, 2015 9:27 am

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

asyrov
Posts: 9
Joined: Mon Oct 12, 2015 9:38 pm

Re: Basic question: material that will change the normal

Postby asyrov » Tue Oct 27, 2015 4:03 pm

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).

patlefort
Posts: 9
Joined: Sun Jun 21, 2015 11:11 pm

Re: Basic question: material that will change the normal

Postby patlefort » Thu Oct 29, 2015 8:02 am

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.

szellmann
Posts: 50
Joined: Fri Oct 10, 2014 9:15 am
Contact:

Re: Basic question: material that will change the normal

Postby szellmann » Thu Oct 29, 2015 8:14 am

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"...


Return to “General Development”

Who is online

Users browsing this forum: No registered users and 7 guests