I’m having some troubles finding out how i can render an offscreen texture to the
screen.
Can anyone help me with pointing me in the right direction?
Thx
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Basically, you render a rectangle the size of the screen, setting as the texture the off-screen texture you rendered.
Now, for some details:
It’s probably best to just generate your desired vertex buffer beforehand. You’ll want a position component (X, Y, Z, though you technically don’t need Z), and a UV component. I recommend making one of these for use by the entire program, with upper left corner being position 0, 0, 0 with UV 0, 0 and the bottom right being 1, 1, 0 with UV 1, 1. Then, to render your texture, set your texture (as you would any other texture), set your matrix/matrices to scale that to whereever you want it, and send off a drawcall with that vertex buffer.