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:
parent
e15ffc0c54
commit
93b5682444
Notes:
blender-bot
2024-03-22 15:57:27 +01:00
Referenced by issue #76909, GPencil: Layers with mask(s) are not visible when "in front" option is checked
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue