Skip to content

Commit

Permalink
fix alpha blending when alpha is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
yukiny0811 committed Sep 6, 2024
1 parent 570c2d5 commit ec873be
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ void OITFragmentFunction(RasterizerData in,
constexpr sampler textureSampler (coord::pixel, address::clamp_to_edge, filter::linear);
fragmentColor = tex.sample(textureSampler, float2(in.uv.x*tex.get_width(), in.uv.y*tex.get_height()));
}


if (fragmentColor.a == 0) {
fragmentColor = half4(0, 0, 0, 0);
}

fragmentColor = half4(createFog(in.position.z / in.position.w,
float4(fragmentColor),
uniformFogDensity.value,
Expand Down

0 comments on commit ec873be

Please sign in to comment.