ebiten: Refactoring shader.go

This commit is contained in:
Hajime Hoshi 2020-09-19 17:35:43 +09:00
parent 28ce1fc3fb
commit b52de27d49

View File

@ -94,8 +94,8 @@ func imageSrc%[1]dBoundsAt(pos vec2) vec4 {
shaderSuffix += ` shaderSuffix += `
func __vertex(position vec2, texCoord vec2, color vec4) (vec4, vec2, vec4) { func __vertex(position vec2, texCoord vec2, color vec4) (vec4, vec2, vec4) {
return mat4( return mat4(
2/imageDstTextureSize().x, 0, 0, 0, 2/__imageDstTextureSize.x, 0, 0, 0,
0, 2/imageDstTextureSize().y, 0, 0, 0, 2/__imageDstTextureSize.y, 0, 0,
0, 0, 1, 0, 0, 0, 1, 0,
-1, -1, 0, 1, -1, -1, 0, 1,
) * vec4(position, 0, 1), texCoord, color ) * vec4(position, 0, 1), texCoord, color