wg_engine: fixed image and scene normal blend

Pre-multiplied color on alpha chanel applied
This commit is contained in:
Sergii Liebodkin 2024-10-28 11:34:44 +00:00 committed by Hermet Park
parent dbab096708
commit 975ddb68ca

View file

@ -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);
};
)";