Fix T76909 GPencil: Layers with mask(s) invisible when using "in front"
The gpSceneDepthTexture is using a dummy 1px texture which was generating wrong values for uvs when sampling gpMaskTexture. Use the max size of both since any of the 2 can use dummy texture.
This commit is contained in:
@@ -99,8 +99,10 @@ void main()
|
||||
discard;
|
||||
}
|
||||
|
||||
vec2 fb_size = max(vec2(textureSize(gpSceneDepthTexture, 0).xy),
|
||||
vec2(textureSize(gpMaskTexture, 0).xy));
|
||||
vec2 uvs = gl_FragCoord.xy / fb_size;
|
||||
/* Manual depth test */
|
||||
vec2 uvs = gl_FragCoord.xy / vec2(textureSize(gpSceneDepthTexture, 0).xy);
|
||||
float scene_depth = texture(gpSceneDepthTexture, uvs).r;
|
||||
if (gl_FragCoord.z > scene_depth) {
|
||||
discard;
|
||||
|
||||
Reference in New Issue
Block a user