VBGamer |
|
Well... Rag on a Stick (0 replies, 0 views) (2000-Jul-17) There is nothing stopping you from doing your own lighting techniques, but just remember that the Direct3d methods will probably be faster.
To do it, check each pixel of the surface being lit and test for it's distance from the light using pythagorus's theorum. Put that value into Distance.
Now the Intensity of the light at the point you just tested is (1/(Distance+1)).
Now you need to find out the red, green and blue components of the pixel you are lighting and then work out the differences between the red of the texture and the red of the light, the green of the texture and the green of the light and the blue of the texture and the blue of the light. Once you've done that, times the difference of each component by the Intensity, and then add this to the original colour.
Then draw it to the screen using whatever you want.
You must do all these steps for each pixel.
hth
|