2020-06-08 04:18:27 +02:00
|
|
|
package main
|
|
|
|
|
2023-09-24 08:59:58 +02:00
|
|
|
func Vertex(dstPos vec2, srcPos vec2, color vec4) (dstPos vec4, srcPos vec2, color vec4) {
|
2020-06-08 04:18:27 +02:00
|
|
|
projectionMatrix := mat4(
|
|
|
|
2/ScreenSize.x, 0, 0, 0,
|
|
|
|
0, 2/ScreenSize.y, 0, 0,
|
|
|
|
0, 0, 1, 0,
|
|
|
|
-1, -1, 0, 1,
|
|
|
|
)
|
2023-09-24 08:59:58 +02:00
|
|
|
return projectionMatrix * vec4(dstPos, 0, 1), srcPos, color
|
2020-06-08 04:18:27 +02:00
|
|
|
}
|
|
|
|
|
2023-09-24 08:59:58 +02:00
|
|
|
func Fragment(dstPos vec4, srcPos vec2, color vec4) vec4 {
|
|
|
|
return vec4(dstPos.x, srcPos.y, color.z, 1)
|
2020-06-08 04:18:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var ScreenSize vec2
|