wg_engine: fixed scene blending equation and clear color rule

Issue: https://github.com/thorvg/thorvg/issues/2998
This commit is contained in:
Sergii Liebodkin 2024-12-03 16:55:42 +00:00 committed by Hermet Park
parent 8f13920b7a
commit 07fbe56162
2 changed files with 2 additions and 2 deletions

View file

@ -397,7 +397,7 @@ bool WgRenderer::beginComposite(RenderCompositor* cmp, MaskMethod method, uint8_
mRenderStorageStack.push(storage); mRenderStorageStack.push(storage);
// begin newly added render pass // begin newly added render pass
WGPUColor color{}; WGPUColor color{};
if ((method == MaskMethod::None) && (opacity != 255)) color = { 1.0, 1.0, 1.0, 0.0 }; if ((compose->method == MaskMethod::None) && (compose->blend != BlendMethod::Normal)) color = { 1.0, 1.0, 1.0, 0.0 };
mCompositor.beginRenderPass(mCommandEncoder, mRenderStorageStack.last(), true, color); mCompositor.beginRenderPass(mCommandEncoder, mRenderStorageStack.last(), true, color);
return true; return true;
} }

View file

@ -237,7 +237,7 @@ fn vs_main(in: VertexInput) -> VertexOutput {
@fragment @fragment
fn fs_main(in: VertexOutput) -> @location(0) vec4f { fn fs_main(in: VertexOutput) -> @location(0) vec4f {
let Sc = textureSample(uTextureSrc, uSamplerSrc, in.vTexCoord.xy); let Sc = textureSample(uTextureSrc, uSamplerSrc, in.vTexCoord.xy);
return vec4f(Sc.rgb * Sc.a * So, Sc.a * So); return vec4f(Sc.rgb * So, Sc.a * So);
}; };
)"; )";