mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
graphicsdriver/opengl: Bug fix: Rename the attribute variables along with custom shaders
This commit is contained in:
parent
c8fa937a0a
commit
29d53edf1d
@ -109,15 +109,15 @@ func fragmentShaderStr(useColorM bool, filter driver.Filter, address driver.Addr
|
||||
const (
|
||||
shaderStrVertex = `
|
||||
uniform vec2 viewport_size;
|
||||
attribute vec2 vertex;
|
||||
attribute vec2 tex;
|
||||
attribute vec4 color_scale;
|
||||
attribute vec2 A0;
|
||||
attribute vec2 A1;
|
||||
attribute vec4 A2;
|
||||
varying vec2 varying_tex;
|
||||
varying vec4 varying_color_scale;
|
||||
|
||||
void main(void) {
|
||||
varying_tex = tex;
|
||||
varying_color_scale = color_scale;
|
||||
varying_tex = A1;
|
||||
varying_color_scale = A2;
|
||||
|
||||
mat4 projection_matrix = mat4(
|
||||
vec4(2.0 / viewport_size.x, 0, 0, 0),
|
||||
@ -125,7 +125,7 @@ void main(void) {
|
||||
vec4(0, 0, 1, 0),
|
||||
vec4(-1, -1, 0, 1)
|
||||
);
|
||||
gl_Position = projection_matrix * vec4(vertex, 0, 1);
|
||||
gl_Position = projection_matrix * vec4(A0, 0, 1);
|
||||
}
|
||||
`
|
||||
shaderStrFragment = `
|
||||
|
@ -90,15 +90,15 @@ var theArrayBufferLayout = arrayBufferLayout{
|
||||
// Note that GL_MAX_VERTEX_ATTRIBS is at least 16.
|
||||
parts: []arrayBufferLayoutPart{
|
||||
{
|
||||
name: "vertex",
|
||||
name: "A0",
|
||||
num: 2,
|
||||
},
|
||||
{
|
||||
name: "tex",
|
||||
name: "A1",
|
||||
num: 2,
|
||||
},
|
||||
{
|
||||
name: "color_scale",
|
||||
name: "A2",
|
||||
num: 4,
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user