Skip to content

Commit

Permalink
examples/shader: Always use 1 for an alpha
Browse files Browse the repository at this point in the history
This is necessary to keep the color pre-multiplied
  • Loading branch information
hajimehoshi committed Aug 15, 2020
1 parent 06ed4f5 commit 05a1c2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions examples/shader/water.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
xoffset := (4 / srcsize.x) * cos(Time*3+texCoord.y*200)
yoffset := (20 / srcsize.y) * (1.0 + cos(Time*3+texCoord.y*50))
bordertex := border / srcsize.y
clr := vec4(image2TextureBoundsAt(vec2(
clr := image2TextureBoundsAt(vec2(
texCoord.x+xoffset,
-(texCoord.y+yoffset-rorigin.y)+bordertex*2+rorigin.y,
)))
)).rgb

overlay := vec4(0.5, 1, 1, 1)
return mix(clr, overlay, 0.25)
overlay := vec3(0.5, 1, 1)
return vec4(mix(clr, overlay, 0.25), 1)
}
2 changes: 1 addition & 1 deletion examples/shader/water_go.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 05a1c2f

Please sign in to comment.