Quantcast
Channel: cocos2d-x - Cocos Forums
Viewing all articles
Browse latest Browse all 2748

RenderTexture ignoring depth buffer

$
0
0

@aoi wrote:

I've been dealing with this for quite a while and came across something very odd so I hope someone here can help me out with this.

I'm using and following this tutorial for post processing effects for Cocos2dx: http://www.babaei.net/blog/2016/01/08/post-processing-effects-in-cocos2d-x/

For simplicity, I'm only using one Post-Processing layer at this point in time (the tutorial uses 2).

I've followed the tutorial (it's essentially copy and pasting code) and have gotten the effect. However, for whatever reason the vertexZ buffering I'm using for the Tiled Maps isn't being applied. (The depth buffering thing here: http://www.cocos2d-x.org/wiki/TileMap)

The vertex shader:

attribute vec4 a_position;
attribute vec2 a_texCoord;
attribute vec4 a_color;
varying vec4 v_fragmentColor;
varying vec2 v_texCoord;
uniform vec2 strokeWidth;
void main()
{
    gl_Position = CC_PMatrix * a_position;
    v_fragmentColor = a_color;
    v_texCoord = a_texCoord;
}

If the fragment shader:

varying vec4 v_fragmentColor;
varying vec2 v_texCoord;
void main()
{
    vec4 c = v_fragmentColor * texture2D(CC_Texture0, v_texCoord);
    gl_FragColor = c;
}

How it should look:

How it looks:

Does anyone have any suggestions?

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 2748

Trending Articles