Skip to content

Commit b32d96c

Browse files
committed
wb oit : fix final target alpha
1 parent 9e17621 commit b32d96c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

shaders/compiled/WBOITComposite.frag.msl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct KernelContext_0
7474
}
7575

7676
#line 13
77-
pixelOutput_0 _S7 = { float4(color_0, _S4) };
77+
pixelOutput_0 _S7 = { float4(color_0, 1.0 - _S4) };
7878

7979

8080

36 Bytes
Binary file not shown.

shaders/src/WBOITComposite.frag.slang

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ float4 main(float4 fragCoord : SV_Position,
1414
color = accum.rgb / accum.a;
1515
}
1616

17-
return float4(color, reveal);
17+
return float4(color, 1.0 - reveal);
1818
}

src/candlewick/multibody/RobotScene.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,10 @@ void RobotScene::initCompositePipeline(const MeshLayout &layout) {
271271
color_target.format = m_renderer.getSwapchainTextureFormat();
272272
color_target.blend_state = {
273273
.src_color_blendfactor = SDL_GPU_BLENDFACTOR_ONE,
274-
.dst_color_blendfactor = SDL_GPU_BLENDFACTOR_SRC_ALPHA,
274+
.dst_color_blendfactor = SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
275275
.color_blend_op = SDL_GPU_BLENDOP_ADD,
276-
.src_alpha_blendfactor = SDL_GPU_BLENDFACTOR_ZERO,
277-
.dst_alpha_blendfactor = SDL_GPU_BLENDFACTOR_ONE,
276+
.src_alpha_blendfactor = SDL_GPU_BLENDFACTOR_ONE,
277+
.dst_alpha_blendfactor = SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
278278
.alpha_blend_op = SDL_GPU_BLENDOP_ADD,
279279
.enable_blend = true,
280280
};

0 commit comments

Comments
 (0)