Hello, i was wondering how to translate correctly the x,y coordinates of vertex (Not sprite) in a shader...
By now, i've got a working one. But doesn't work when i replace "10. 's" with a uniform float for each value... That makes me a bit angry :c .
Probably a weird bug in my or every GML D: .
Even more weird is why this work and not this one :
thank you beforehand .
By now, i've got a working one. But doesn't work when i replace "10. 's" with a uniform float for each value... That makes me a bit angry :c .
Probably a weird bug in my or every GML D: .
GML:
attribute vec2 in_Position; // (x,y)
attribute vec4 in_Colour; // (r,g,b,a)
attribute vec2 in_TextureCoord; // (u,v)
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
varying vec2 v_vPostion;
void main(){
vec2 pos = vec2( in_Position.x, in_Position.y);
pos.x+=10.;
pos.y+=10.;
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * vec4(pos.x,pos.y,0.0,1.);
v_vColour = in_Colour;
v_vTexcoord = in_TextureCoord;
}
GML:
attribute vec2 in_Position; // (x,y,z)
attribute vec4 in_Colour; // (r,g,b,a)
attribute vec2 in_TextureCoord; // (u,v)
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
varying vec2 v_vPostion;
void main(){
vec2 pos = vec2( in_Position.x, in_Position.y);
vec4 pos2=vec4(pos.x,pos.y,0.0,1.);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * pos2;
v_vColour = in_Colour;
v_vTexcoord = in_TextureCoord;
}