View Full Version : Math Calculation for Diffuse Light Effect

11-19-2008, 03:02 AM

I have a question about diffuse light. I have a triangle with a normal and a light. I supposed to simulate a diffuse light and a simple (flat?) shading on the triangle. The light has property color. So it may affect the color of the triangle

Anyone got a formula for this calculation? And I cant use OpenGL lib to simulate this. I only able to draw a triangle and decide the color of the triangle based on the calculation.


11-19-2008, 05:30 AM
i assume you want to use GLSL for diffuse lighting. google "diffuse GLSL".