Jump to content
  • Advertisement
Sign in to follow this  
Quat

ndotL environment mapping?

This topic is 1115 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been reworking my lighting shaders for physically based rendering.

 

Real-Time rendering 3rd edition scales specular reflection by nDotL (page 269), which makes sense that nDotL should apply to both diffuse and specular. 

 

Therefore, should I also scale the light from environment mapping (to do specular reflections) by nDotL as well?  Seems like I should since environment mapping reflections are basically the same thing as light source specular reflections.  However, I couldn't find a mention in Real-Time rendering of this.

 

 

Share this post


Link to post
Share on other sites
Advertisement

The idea here is twofold :

1) there is a tradeoff between diffuse & specular reflected energy.  more diffuse reflections mean less energy available for specular and vice versa.  

2) when N dot L is zero, N.H ( or R.L ) should be zero too

Share this post


Link to post
Share on other sites

The N dot L factor only applies if you are performing a convolution on the environment map (i.e. considering each texel in the cube map as its own lightsource)
If you are using the environment map as a light source, it is generally assumed that this step is already done.

If you did an N dot L from  a specific light source, then suddenly you would be losing a light from every direction except that light source...

Share this post


Link to post
Share on other sites


1) there is a tradeoff between diffuse & specular reflected energy.  more diffuse reflections mean less energy available for specular and vice versa. 

 

Right.  The incoming light is scaled by ndotL because the light gets spread over a different area based on the angle between n and L.  Some of that light will get specularly reflected based on Fresnel, and the remaining will undergo diffuse reflection.  

 

For specular reflections, there is a light ray coming from the reflected direction r (the color sampled from the cube map).  Shouldn't this also be scaled by ndotL as the light gets spread over a different area based on the angle between n and L? 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!