amitsarangi / mt4j

Automatically exported from code.google.com/p/mt4j
GNU General Public License v2.0
0 stars 0 forks source link

Problem when putting a MTSceneTexture in a MTClipRectangle #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a MTClipRectangle
2. create an AbstractScene and a MTSceneTexture
3. add the MTSceneTexture as a child of the MTRectangle

What is the expected output? What do you see instead?
We should see a clipped part of the scene ; however the stencil buffer is not 
reinitialized before rendering the second scene, therefore clipping the second 
scene also.

What version of the product are you using? On what operating system?
last release (0.9)

Please provide any additional information below.
in MTSceneTexture.drawComponent(), there should be
    gl.glPushAttrib(GL.GL_STENCIL_BUFFER_BIT | GL.GL_STENCIL_TEST);
    gl.glClear(GL.GL_STENCIL_BUFFER_BIT);
    gl.glDisable(GL.GL_STENCIL_TEST);
before scene.drawAndUpdate() and
    gl.glPopAttrib();
just after

Original issue reported on code.google.com by mattsl...@gmail.com on 5 Aug 2010 at 9:30

GoogleCodeExporter commented 9 years ago

Original comment by sirhc.f...@gmail.com on 7 Aug 2010 at 1:57

GoogleCodeExporter commented 9 years ago
This should also be fixed with rev 131. 
I had to do it a little differently because with the proposed fix, clipping 
inside the clipped MTSceneTexture didnt work anymore. Again, please confirm.

Original comment by sirhc.f...@gmail.com on 11 Aug 2010 at 6:39

GoogleCodeExporter commented 9 years ago
It works now, thanks.
For some reason, everything in some scenes now seems blurred, but it is 
probably unrelated.

Original comment by mattsl...@gmail.com on 16 Aug 2010 at 12:23

GoogleCodeExporter commented 9 years ago
You can control the resolution of the scenetexture with the fboWidth/height 
parameters. The default is only 0.6* windowwidth/height so it might look blurry 
but performs better. Using the exact window dimensions will look sharper.
public MTSceneTexture(MTApplication pa, float x,    float y, int fboWidth, int 
fboHeight, Iscene theScene)

Original comment by sirhc.f...@gmail.com on 16 Aug 2010 at 8:17

GoogleCodeExporter commented 9 years ago
Oh I forgot about that... It works perfectly now, thanks.

Original comment by mattsl...@gmail.com on 17 Aug 2010 at 1:31