Saturday, 15 June 2013

opengl - Rendering to texture hides the front face,something's wrong with the z buffer? -


I want to render my view in a texture and apply the blur shader for this texture. The problem is that when I come back

I have to make my texture Face faces of cubes can be invisible </ p> <p> Enter image details here

with superSapling

* Ignore the opaque thing around the cube in both photos. I repeat the cube once with less alpha and more scale, I disabled it, but I have the same problem.

For some reasons, I am using z and z as y, so the face in front of the cube is less than the face (instead of P), I think that There is something wrong with the buffer.

Render Text Code:

  Public Class RenderOnTtexture {Personal Float m_fboScaler = 1f; Private boolean m_fboEnabled = true; Private framebuffer m_fbo = null; Private texture region m_fboRegion = null; Public RenderOnTechs (float scale) {int width = (int) (gdx graphics .getWidth () * scale); Int height = (int) (gdx graphics.gethite () * scale); M_fbo = New frame buffer (format. RGB565, (int) (width * m_fboScaler), (int) (height * m_fboScaler, false); M_fboRegion = new texture (m_fbo.getColorBufferTexture ()); M_fboRegion.flip (false, false); } Public Zero Start () {if (m_fboEnabled) {m_fbo.begin (); Gdx.gl.glClearColor (0, 0,0,0); Gdx.gl.glClear (GL20.GL_COLOR_BUFFER_BIT); }} Public Texture Silk End () {if (m_fbo! = Null) {m_fbo.end (); Return m_fboRegion; } Return tap; Boolean logic in framebuffer enables a depth buffer attachment. I & rsquo;;}  

And should clean the depth buffer with color buffer.


No comments:

Post a Comment