Jump to content
  • Advertisement
Sign in to follow this  
chillypacman

Getting a quad to cover the screen

This topic is 3765 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'm stuck here, I'm making a system for post processing effects, I'm using render to texture to render the scene to a texture. Now I'm stuck with a texture and I need to know, how can I put it on a quad which stretches from the top left corner of the screen to the bottom right?

Share this post


Link to post
Share on other sites
Advertisement
Just create a quad from (-1,-1,0) to (1,1,0), turn off Z-testing and Z-writing and set the world, view and projection matrices to identity. Set UV coordinates as desired.
May have to turn off lighting and such as well, depending on your render method (fixed function / shader)

Share this post


Link to post
Share on other sites
Quote:
Original post by Mike nl
Just create a quad from (-1,-1,0) to (1,1,0), turn off Z-testing and Z-writing and set the world, view and projection matrices to identity. Set UV coordinates as desired.
May have to turn off lighting and such as well, depending on your render method (fixed function / shader)


Thanks, I'll look into it.

Yeah I'm using shaders only so no need to disable lighting or anything.

Share this post


Link to post
Share on other sites
Your other options are to use pre-transformed vertices (using the POSITIONT vertex declaration), or to use an off-center orthographic projection that has a width and height equal to the dimensions of the rendertarget.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!