W
Wayfarer
Guest
I'm doing a lot of guesswork here as I'm new to shaders.
In the vertex tab, I've noticed if I multiply "in_Position.x * 0.98" I can offset the shader to the left, which is interesting, but not what I need!
How would I go about scaling something, say 4x?
The shader is applied to individual sprites like so:
Edit:
Ah, I now see that "gl_Position" is setting the position. Hmm. Is scaling possible?
Edit2:
Do I get the sprite coordinates with sprite_get_uvs() or something?
In the vertex tab, I've noticed if I multiply "in_Position.x * 0.98" I can offset the shader to the left, which is interesting, but not what I need!
Code:
void main()
{
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * (
vec4(in_Position.x * 0.98, in_Position.y, in_Position.z, 1.0)
);
v_vColour = in_Colour;
v_vTexcoord = in_TextureCoord;
}
The shader is applied to individual sprites like so:
Code:
shader_set(...);
draw_sprite(...)
shader_reset();
Edit:
Ah, I now see that "gl_Position" is setting the position. Hmm. Is scaling possible?
Edit2:
Do I get the sprite coordinates with sprite_get_uvs() or something?
Last edited: