examples/shader: Always use 1 for an alpha

This is necessary to keep the color pre-multiplied
This commit is contained in:
Hajime Hoshi
2020-08-16 02:34:18 +09:00
parent 06ed4f5444
commit 05a1c2faa1
2 changed files with 5 additions and 5 deletions

View File

@@ -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)
}