Hello all !
I was wondering how to interpret a vertex_format_add_custom(vertex_type_colour,vertex_usage_position) in a shader, that because i want to use only 8 bytes for each vertex (for example 24 bytes for a triangle instead of 48 bytes). That for a better performance, and use less RAM.
The vertex format is:
vertex_format_begin();
vertex_format_add_custom(vertex_type_colour,vertex_usage_position);
vertex_format_add_color();
format=vertex_format_end();
Any working solution for this? I've searched and found nothing here for now.
I've tryed of course something, but as far i couldn't do it yet that can work.
But this actually gives me errors.
I need a hero .
I was wondering how to interpret a vertex_format_add_custom(vertex_type_colour,vertex_usage_position) in a shader, that because i want to use only 8 bytes for each vertex (for example 24 bytes for a triangle instead of 48 bytes). That for a better performance, and use less RAM.
The vertex format is:
vertex_format_begin();
vertex_format_add_custom(vertex_type_colour,vertex_usage_position);
vertex_format_add_color();
format=vertex_format_end();
Any working solution for this? I've searched and found nothing here for now.
I've tryed of course something, but as far i couldn't do it yet that can work.
GML:
//Vertex Shader
attribute vec4 in_Position; // (x,y,z)
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
attribute vec4 in_Colour; // (r,g,b,a)
attribute vec2 in_TextureCoord; // (u,v)
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 pos = vec4( in_Position.r, in_Position.g, in_Position.b, 1.0)
pos.r*=32.;
pos.g*=32.;
pos.b*=32.;
vec4 col = vec4(in_Colour.rgba);
col.r=255.;
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * pos;
v_vColour = col;
v_vTexcoord = in_TextureCoord;
}
GML:
//Fragment
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
gl_FragColor = v_vColour;
}
I need a hero .