MoeTM
03-23-2011, 09:29 AM
Hi,
in my current porject I want to add Deffered Shading. To do this I created a pbuffer in which I have rendered my hole scene. Now I want a shader to change the color of each pixel in dependency of its distance to the lights and to the direction (normal) in dependency to the lights. But I dont know how to access the normals und the depth of the pbuffer. Here is an example how my porgramm works:
pbuffer::makecurrent()
scene::render()
here i dont know what to do
device::makecurrent()
render pbuffertexture prepared by shader()
I hope my question is understandable :)
in my current porject I want to add Deffered Shading. To do this I created a pbuffer in which I have rendered my hole scene. Now I want a shader to change the color of each pixel in dependency of its distance to the lights and to the direction (normal) in dependency to the lights. But I dont know how to access the normals und the depth of the pbuffer. Here is an example how my porgramm works:
pbuffer::makecurrent()
scene::render()
here i dont know what to do
device::makecurrent()
render pbuffertexture prepared by shader()
I hope my question is understandable :)