Jump to content
  • Advertisement
Sign in to follow this  
RPTD

(modified) GLSL lighting problem: Inf

This topic is 3626 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

Topic modified ( new findings ). Looks like the problem had not been an NaN in the GLSL ( I verified reading the buffers back and no normal has been NaN in any way ) but one singular Inf value in the color buffer. As it looks like one of the lighting shaders ( the sky light shader to be precise ) overflowed the Float16 buffer. I know that I can prevent overflowing using a min( value, 65504 ) before writing out the value to the color buffer but what if the blending ( GL_ONE, GL_ONE ) happens to overflow? How does GLSL handle this case? I could improve the tone mapper and log2lum down sampler with such a min(*,65504) call but is there a better way? [Edited by - RPTD on July 20, 2008 9:25:53 PM]

Share this post


Link to post
Share on other sites
Advertisement
Even if you use ( GL_ONE, GL_ONE ), it should clamp to the maximum possible value.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!