PDA

View Full Version : Math Calculation for Diffuse Light Effect



jos_t_tarigan
11-19-2008, 03:02 AM
Hi,

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.


Thanks

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