mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
gl_engine: fix color burn/dodge edge cases
Aligned with sw_engine implementation.
This commit is contained in:
parent
6a00eb8db0
commit
0a76a4f0a3
1 changed files with 6 additions and 6 deletions
|
@ -691,9 +691,9 @@ const char* COLOR_DODGE_BLEND_FRAG = COMPLEX_BLEND_HEADER R"(
|
|||
vec4 dstColor = texture(uDstTexture, vUV);
|
||||
|
||||
FragColor = vec4(
|
||||
1.0 - srcColor.r > 0.0 ? dstColor.r / (1.0 - srcColor.r) : dstColor.r,
|
||||
1.0 - srcColor.g > 0.0 ? dstColor.g / (1.0 - srcColor.g) : dstColor.g,
|
||||
1.0 - srcColor.b > 0.0 ? dstColor.b / (1.0 - srcColor.b) : dstColor.b,
|
||||
srcColor.r < 1.0 ? dstColor.r / (1.0 - srcColor.r) : (dstColor.r > 0.0 ? 1.0 : 0.0),
|
||||
srcColor.g < 1.0 ? dstColor.g / (1.0 - srcColor.g) : (dstColor.g > 0.0 ? 1.0 : 0.0),
|
||||
srcColor.b < 1.0 ? dstColor.b / (1.0 - srcColor.b) : (dstColor.b > 0.0 ? 1.0 : 0.0),
|
||||
1.0
|
||||
);
|
||||
}
|
||||
|
@ -705,9 +705,9 @@ const char* COLOR_BURN_BLEND_FRAG = COMPLEX_BLEND_HEADER R"(
|
|||
vec4 dstColor = texture(uDstTexture, vUV);
|
||||
|
||||
FragColor = vec4(
|
||||
srcColor.r > 0.0 ? (1.0 - (1.0 - dstColor.r) / srcColor.r) : dstColor.r,
|
||||
srcColor.g > 0.0 ? (1.0 - (1.0 - dstColor.g) / srcColor.g) : dstColor.g,
|
||||
srcColor.b > 0.0 ? (1.0 - (1.0 - dstColor.b) / srcColor.b) : dstColor.b,
|
||||
srcColor.r > 0.0 ? (1.0 - (1.0 - dstColor.r) / srcColor.r) : (dstColor.r < 1.0 ? 0.0 : 1.0),
|
||||
srcColor.g > 0.0 ? (1.0 - (1.0 - dstColor.g) / srcColor.g) : (dstColor.g < 1.0 ? 0.0 : 1.0),
|
||||
srcColor.b > 0.0 ? (1.0 - (1.0 - dstColor.b) / srcColor.b) : (dstColor.b < 1.0 ? 0.0 : 1.0),
|
||||
1.0
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue