Jump to content
  • Advertisement


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


Render to texture

This topic is 6187 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

OK, I''ve now got my projective textures working, so would like to try shadow mapping. This involves first rendering the scene from the lights point of view to a smaller(eg 256x256 viewport), obtaining te depth values for each pixel and using these as a texture. How can I: a) Render my scene so that the depth buffer is automatically rendered to a 256x256 texture? OR: b) -Reduce the viewport size to 256x256 (without changing the window size) AND -Read back depth values from the resulting image? Thanks

Share this post

Link to post
Share on other sites
nVidia has a sample on their site that does exactly what you''re talking about.

a) Create a 256x256 texture and backbuffer. Set both when rendering your scene.


b) Call SetViewport()

See the nVidia sample about the depth buffer. Alternatively, you can use a vertex shader to write derived depth values to the color channel and use that for your shadow map.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!