views:

37

answers:

1

Hi,

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

+1  A: 

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.

arke
How can i set the texture? Because in all the samples they use an effect file to set the shaderresourceview but i don't want to use an effect file.
Frédéric Hennequin
Nevermind i solved my effect file problem, in DX10 just must create an effect file even for the simplest task.
Frédéric Hennequin