Skip to content

Commit

Permalink
fix(?): When there's a texture with alpha clipping and fog is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
luisparravicini committed Jun 20, 2022
1 parent 359539b commit d43b9df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion camera.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ func NewCamera(w, h int) *Camera {
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
tex := imageSrc0At(texCoord)
return vec4(encodeDepth(color.r).rgb, tex.a)
if (tex.a == 0) {
return vec4(0.0, 0.0, 0.0, 0.0)
} else {
return vec4(encodeDepth(color.r).rgb, tex.a)
}
// TODO: This shader needs to discard if tex.a is transparent. We can't sample the texture to return
// what's underneath here, so discard is basically necessary. We need to implement it once the dicard
// keyword / function is implemented (if it ever is; hopefully it will be).
Expand Down

0 comments on commit d43b9df

Please sign in to comment.