• Advertisement


This topic is now archived and is closed to further replies.

differed shading (perpixel lighting in image space)

This topic is 5296 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi i''ve been implementing a differed shading technique for per-pixel lighting. So far a render to produce an image with the normals of the scene (transformed into world space) encoded into the color, and i produce a second image with just the normal textures (scene with no lighting). I can produce these two images in one pass using ATI_DRAW_BUFFER extension. In my second pass i encode the positions of my objects in world space. Then for each light, I take the first and thrid images and combine them together using a fragment program that computes specular and diffuse lighting and acculate the resulting image. Finally, i modulate this image with the second image i produced to get the final lit image of the scene. My problem is in the generation of the "world positions" image. I''m using a floating point texture to store this so it ends up being slow. Is there any way i can encode the world position using a lesser pixel type or is there a way a can avoid altogheter having to encode the world positions? Thanks.

Share this post

Link to post
Share on other sites

  • Advertisement