Sign in to follow this  

Basic Lighting with and without Shaders

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

This topic is 3229 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this