mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
examples/shader: refactoring
This commit is contained in:
parent
00e45affe9
commit
01bb42526a
@ -29,5 +29,5 @@ func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||
clr.r = imageSrc2At(texCoord + amount).r
|
||||
clr.g = imageSrc2UnsafeAt(texCoord).g
|
||||
clr.b = imageSrc2At(texCoord - amount).b
|
||||
return vec4(clr, 1.0)
|
||||
return vec4(clr, 1)
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||
// TODO: This is confusing. Add a function to treat pixels (#1431).
|
||||
srcTexSize := imageSrcTextureSize()
|
||||
xoffset := (4 / srcTexSize.x) * cos(Time*3+pos.y/10)
|
||||
yoffset := (20 / srcTexSize.y) * (1.0 + cos(Time*3+pos.y/40))
|
||||
yoffset := (20 / srcTexSize.y) * (1 + cos(Time*3+pos.y/40))
|
||||
bordertex := border / srcTexSize.y
|
||||
clr := imageSrc2At(vec2(
|
||||
texCoord.x+xoffset,
|
||||
|
Loading…
Reference in New Issue
Block a user