"layout (location=0) in vec3 a_co;\n"
"layout (location=1) in vec3 a_norm;\n"
"layout (location=2) in vec2 a_uv;\n"
-"layout (location=3) in vec4 a_colour;\n"
-"layout (location=4) in vec4 a_weights;\n"
-"layout (location=5) in ivec4 a_groups;\n"
"\n"
"uniform mat4 uPv;\n"
"uniform mat4x3 uMdl;\n"
"uniform float uTime;\n"
"uniform vec3 uCam;\n"
"uniform vec2 uInvRes;\n"
+"uniform vec4 uColour;\n"
"\n"
"in vec3 aNorm;\n"
"in vec2 aUv;\n"
"void main()\n"
"{\n"
" vec2 ssuv = gl_FragCoord.xy;\n"
-" float opacity = 1.0-smoothstep(0.4,1.0,aUv.y);\n"
+" float opacity = 1.0-smoothstep(0.0,1.0,aUv.y+uColour.a);\n"
" \n"
" vec3 vDither = vec3( dot( vec2( 171.0, 231.0 ), ssuv) );\n"
" float dither = fract( vDither.g / 71.0 ) - 0.5;\n"
" if( opacity+dither<0.5 )\n"
" discard;\n"
"\n"
-" FragColor = vec4( 0.0, 1.0, 0.0, 1.0 );\n"
+" FragColor = uColour;\n"
"}\n"
""},
};
static GLuint _uniform_model_gate_uTime;
static GLuint _uniform_model_gate_uCam;
static GLuint _uniform_model_gate_uInvRes;
+static GLuint _uniform_model_gate_uColour;
static void shader_model_gate_uPv(m4x4f m){
glUniformMatrix4fv(_uniform_model_gate_uPv,1,GL_FALSE,(float*)m);
}
static void shader_model_gate_uInvRes(v2f v){
glUniform2fv(_uniform_model_gate_uInvRes,1,v);
}
+static void shader_model_gate_uColour(v4f v){
+ glUniform4fv(_uniform_model_gate_uColour,1,v);
+}
static void shader_model_gate_register(void){
vg_shader_register( &_shader_model_gate );
}
_uniform_model_gate_uTime = glGetUniformLocation( _shader_model_gate.id, "uTime" );
_uniform_model_gate_uCam = glGetUniformLocation( _shader_model_gate.id, "uCam" );
_uniform_model_gate_uInvRes = glGetUniformLocation( _shader_model_gate.id, "uInvRes" );
+ _uniform_model_gate_uColour = glGetUniformLocation( _shader_model_gate.id, "uColour" );
}
#endif /* SHADER_model_gate_H */