Basic Lighting with and without Shaders

Started by
-1 comments, last by Geometrian 15 years, 1 month ago
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

[size="1"]And a Unix user said rm -rf *.* and all was null and void...|There's no place like 127.0.0.1|The Application "Programmer" has unexpectedly quit. An error of type A.M. has occurred.
[size="2"]

This topic is closed to new replies.

Advertisement