mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-25 07:39:02 +00:00
gl_engine: luma visual differneces fix
https://github.com/thorvg/thorvg/issues/3045
This commit is contained in:
parent
eddd8961f3
commit
a1ca566c48
1 changed files with 2 additions and 2 deletions
|
@ -436,7 +436,7 @@ const char* MASK_LUMA_FRAG_SHADER = TVG_COMPOSE_SHADER(
|
|||
maskColor = vec4(maskColor.rgb / maskColor.a, maskColor.a); \n
|
||||
} \n
|
||||
\n
|
||||
FragColor = srcColor * (0.299 * maskColor.r + 0.587 * maskColor.g + 0.114 * maskColor.b) * maskColor.a; \n
|
||||
FragColor = srcColor * dot(maskColor.rgb, vec3(0.2125, 0.7154, 0.0721)) * maskColor.a; \n
|
||||
} \n
|
||||
);
|
||||
|
||||
|
@ -450,7 +450,7 @@ const char* MASK_INV_LUMA_FRAG_SHADER = TVG_COMPOSE_SHADER(
|
|||
{ \n
|
||||
vec4 srcColor = texture(uSrcTexture, vUV); \n
|
||||
vec4 maskColor = texture(uMaskTexture, vUV); \n
|
||||
float luma = (0.299 * maskColor.r + 0.587 * maskColor.g + 0.114 * maskColor.b); \n
|
||||
float luma = dot(maskColor.rgb, vec3(0.2125, 0.7154, 0.0721)); \n
|
||||
FragColor = srcColor * (1.0 - luma); \n
|
||||
} \n
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue