After doing a render pass with RenderToTarget (RTT), how do you properly render that texture buffer to the screen while maintaining original scale / proportions so it doesn't stretch or lose quality?

Can an AGAL VertexShader & FragmentShader be written so it's adaptable to any Texture size and Viewport dimensions?

I find I'm getting some "blocky" effects in some of my first attempts at "ping-ponging" between two Texture buffers (to create trailing effects). Perhaps I'm not using the UVs correctly between the rendering-to-target and/or the backbuffer?

Is there a simpler way just to "splash" the texture on the backbuffer, or is a Quad absolutely necessary (4 vertices, 2 triangles)?

If it needs the Quad, should the Texture buffer be fully drawn (0.0 to 1.0 for vertical and horizontal UVs), or only a percentage of it should, like the example below?

  • Texture Buffer U: 0.0 to viewport.width/texturebuffer.width;
  • Texture Buffer V: 0.0 to viewport.height/texturebuffer.height;



You should only render to the area needed as in your example. To speed up rendering, look at using a scissor rectangle.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.