Sign in to follow this  

Getting a quad to cover the screen

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

This topic is 3463 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this