Skip to content

Commit

Permalink
Merge pull request #143 from yukiny0811/patch-3
Browse files Browse the repository at this point in the history
Fix alpha blending when alpha is 0
  • Loading branch information
yukiny0811 authored Sep 6, 2024
2 parents 9f44875 + ec873be commit 0604a16
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 0604a16

Please sign in to comment.