mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
example/shader: make default.go more deterministic
This commit is contained in:
parent
df32901dce
commit
820548ed68
@ -21,7 +21,9 @@ var Cursor vec2
|
|||||||
var ScreenSize vec2
|
var ScreenSize vec2
|
||||||
|
|
||||||
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||||
pos := position.xy/imageDstTextureSize() + Cursor/ScreenSize/4
|
dstOrigin, _ := imageDstRegionOnTexture()
|
||||||
|
pos := (position.xy - dstOrigin) / 1024
|
||||||
|
pos += Cursor / ScreenSize / 4
|
||||||
clr := 0.0
|
clr := 0.0
|
||||||
clr += sin(pos.x*cos(Time/15)*80) + cos(pos.y*cos(Time/15)*10)
|
clr += sin(pos.x*cos(Time/15)*80) + cos(pos.y*cos(Time/15)*10)
|
||||||
clr += sin(pos.y*sin(Time/10)*40) + cos(pos.x*sin(Time/25)*40)
|
clr += sin(pos.y*sin(Time/10)*40) + cos(pos.x*sin(Time/25)*40)
|
||||||
|
Loading…
Reference in New Issue
Block a user