MoeTM
03-20-2011, 01:13 PM
Hi,
in my current project I am trying to enable lightning. To do this I want to test my own light system, which should work like this:
1. The scene is rendered to texture (works)
2. Read the scene, which is stored in a texture, back into the cpu (I dont know how to do that)
3. Calculate for each pixel the distance to every light, the dotproduct of the normal of each pixel by the direction of every light.
4 finally combine these information and update the scene texture again.
Now my question is how to get the scenes normals and postion and color of each pixel. I want to have a position(x, y, z) the normale(x,y,z) and the color(r,g,b,a) of every pixel
I hope my question ist understandable :)
in my current project I am trying to enable lightning. To do this I want to test my own light system, which should work like this:
1. The scene is rendered to texture (works)
2. Read the scene, which is stored in a texture, back into the cpu (I dont know how to do that)
3. Calculate for each pixel the distance to every light, the dotproduct of the normal of each pixel by the direction of every light.
4 finally combine these information and update the scene texture again.
Now my question is how to get the scenes normals and postion and color of each pixel. I want to have a position(x, y, z) the normale(x,y,z) and the color(r,g,b,a) of every pixel
I hope my question ist understandable :)