diff --git a/examples/shader/default.go b/examples/shader/default.go index 7634814be..d7f4512d3 100644 --- a/examples/shader/default.go +++ b/examples/shader/default.go @@ -21,7 +21,9 @@ var Cursor vec2 var ScreenSize vec2 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 += 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)