mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
wg_engine: fixed image and scene normal blend
Pre-multiplied color on alpha chanel applied
This commit is contained in:
parent
dbab096708
commit
975ddb68ca
1 changed files with 3 additions and 2 deletions
|
@ -208,7 +208,7 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4f {
|
|||
case 3u: { Sc = Sc.bgra; }
|
||||
default: {}
|
||||
}
|
||||
return Sc * So;
|
||||
return vec4f(Sc.rgb * Sc.a * So, Sc.a * So);
|
||||
};
|
||||
)";
|
||||
|
||||
|
@ -234,7 +234,8 @@ fn vs_main(in: VertexInput) -> VertexOutput {
|
|||
|
||||
@fragment
|
||||
fn fs_main(in: VertexOutput) -> @location(0) vec4f {
|
||||
return textureSample(uTextureSrc, uSamplerSrc, in.vTexCoord.xy) * So;
|
||||
let Sc = textureSample(uTextureSrc, uSamplerSrc, in.vTexCoord.xy);
|
||||
return vec4f(Sc.rgb * Sc.a * So, Sc.a * So);
|
||||
};
|
||||
)";
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue