How to properly render a Frame Buffer to the BackBuffer in Stage3D / AGAL

Posted by bigp on Game Development See other posts from Game Development or by bigp
Published on 2012-03-08T18:20:52Z Indexed on 2012/04/08 23:49 UTC
Read the original article Hit count: 400

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;

Thanks!

© Game Development or respective owner

Related posts about flash

Related posts about textures