mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-10-26 09:30:32 +08:00
ebiten: Rename shader builtin functions
* imageSrcTextureSourceRegion -> imageSrcTextureRegion * image[N]TextureAt -> imageSrc[N]At * image[N]TextureBoundsAt -> imageSrc[N]BoundsAt Updates #1325
This commit is contained in:
@@ -23,16 +23,16 @@ var ScreenSize vec2
|
||||
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||
border := ScreenSize.y*0.6 + 4*cos(Time*3+texCoord.y*200)
|
||||
if position.y < border {
|
||||
return image2TextureAt(texCoord)
|
||||
return imageSrc2At(texCoord)
|
||||
}
|
||||
|
||||
srcsize := imageSrcTextureSize()
|
||||
rorigin, rsize := imageSrcTextureSourceRegion()
|
||||
rorigin, rsize := imageSrcTextureRegion()
|
||||
|
||||
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 := image2TextureBoundsAt(vec2(
|
||||
clr := imageSrc2BoundsAt(vec2(
|
||||
texCoord.x+xoffset,
|
||||
-(texCoord.y+yoffset-rorigin.y)+bordertex*2+rorigin.y,
|
||||
)).rgb
|
||||
|
||||
Reference in New Issue
Block a user