Here's what I'm doing:How are you calculating the screen position of your vertices in your vertex shader? Simply "modelViewProjectionMatrix * vec4(position, 1.0)"? Or are you using multiple matrix multiplications?
Code: Select all
uniform mat4 modelViewMatrix;
uniform mat4 modelViewProjectionMatrix;
uniform mat3 normalMatrix;
attribute vec4 position, color; // vertex position & color
attribute vec3 normal; // vertex normal
varying vec3 N;
varying vec3 v;
varying vec4 v_Color;
void main(void)
{
v = vec3(modelViewMatrix * position);
N = normalize(normalMatrix * normal);
v_Color = color;
gl_Position = modelViewProjectionMatrix * position;
}
I'm doing almost nothing with fragment shaders. It displays the things at the correct positions and colors, so I'm happy with that. Coding shaders isn't exactly simple