Jump to content
  • Advertisement
Sign in to follow this  
Geometrian

Basic Lighting with and without Shaders

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

Hi I'm trying to render a scene with either shaders or without shaders, and I want it to look exactly the same either way. I'm using a basic lighting model on a test model of a cube. According to the documentation, the light's default ambient factor is (0.0,0.0,0.0,1.0) and the default material's ambient factor is (0.2,0.2,0.2,1.0). In my shader, the ambient factor is calculated by materialambient*lightambient. Thus, by default, the ambient factor is (0.2,0.2,0.2,1.0)*(0.0,0.0,0.0,1.0) = (0.0,0.0,0.0,1.0). So, when I render the scene with shaders, the underside of the cube is dark. When I render without shaders, I'm seeing what appears to be ambient lighting on the bottom of the cube. I would not expect this if the ambient factor is found by materialambient*lightambient. Is materialambient*lightambient the way fixed functionality calculates the ambient factor? I'm guessing not, given my results. How does it? Thanks, -G

Share this post


Link to post
Share on other sites
Advertisement
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!