ebiten/internal/shader/testdata/vertex_fragment.go

18 lines
430 B
Go
Raw Normal View History

2020-06-08 04:18:27 +02:00
package main
func Vertex(position vec2, texCoord vec2, color vec4) (position vec4, texCoord vec2, color vec4) {
projectionMatrix := mat4(
2/ScreenSize.x, 0, 0, 0,
0, 2/ScreenSize.y, 0, 0,
0, 0, 1, 0,
-1, -1, 0, 1,
)
return projectionMatrix * vec4(position, 0, 1), texCoord, color
}
func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
2020-06-19 17:20:17 +02:00
return vec4(position.x, texCoord.y, color.z, 1)
2020-06-08 04:18:27 +02:00
}
var ScreenSize vec2