mjs513 / monoxna

Automatically exported from code.google.com/p/monoxna
Other
0 stars 0 forks source link

RenderTarget.GetTexture() should return a copy of the texture #79

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Draw something into a RenderTarget.
2. Grab its texture.
3. Draw again into the RenderTarget.
4. Draw the aforementioned texture to the backbuffer.

What is the expected output? What do you see instead?
Only what has been drawn before step three, but instead the texture displays 
changes from step three anyways.

From MS XNA, drawing/clearing a RenderTarget that you've grabbed a texture from 
recently does not affect the texture at all. It still retains the same state at 
the time you've grabbed RenderTarget's texture. 

This can be fixed by passing off a copy of the texture and the only way I know 
how to do this quickly as possible is setting up an FBO, drawing the 
RenderTarget's texture into that, then return the FBO's texture. I don't know 
if there is a way of creating a copy of a texture within the video memory other 
than the aforementioned method (glCopyTex/etc copies the texture to main 
memory, which would seem extremely slow).

(I'm basically reporting all the little inconsistencies I've been running into 
in the last month and have since fixed/worked around. I don't want to push my 
changes to this trunk unless my methods are acceptable)

Original issue reported on code.google.com by ali.scis...@gmail.com on 15 Dec 2011 at 9:08

GoogleCodeExporter commented 9 years ago

Original comment by ali.scis...@gmail.com on 15 Dec 2011 at 10:45