Original Post
Hello everybody, i am experiencing a strange problem, i atta ch my simple vertex and pixel shader hoping that some shader expert will shed some light on it , excuse me but i am pretty new to shaders.
vertex shader:
#version 330
precision highp float;
uniform mat4 ViewMatrix;
uniform mat3 NormalMatrix;
uniform mat4 ModelViewMatrix;
uniform mat4 ModelViewProjectionMatrix;
in vec4 VertexPosition;
in vec3 VertexNormal;
out vec3 Normal;
void main()
{
// All vertex shaders should write the transformed homogeneous clip space
// vertex position into the gl_Position variables.
gl_Position = ModelViewProjectionMatrix * VertexPosition;
// normal
Normal = VertexNormal;
}
pixel shader :
#version 330
precision highp float;
out vec4 FragColor;
uniform vec4 WireFrameColor;
void main()
{
FragColor = WireFrameColor ;
}
The strange fact is that if in the vertex shader, i comment out the 'normal' , i don't get rendered anything.
Where am i wrong ?
Does anybody know a place to learn modern opengl shaders ?
Thanks
vertex shader:
#version 330
precision highp float;
uniform mat4 ViewMatrix;
uniform mat3 NormalMatrix;
uniform mat4 ModelViewMatrix;
uniform mat4 ModelViewProjectionMatrix;
in vec4 VertexPosition;
in vec3 VertexNormal;
out vec3 Normal;
void main()
{
// All vertex shaders should write the transformed homogeneous clip space
// vertex position into the gl_Position variables.
gl_Position = ModelViewProjectionMatrix * VertexPosition;
// normal
Normal = VertexNormal;
}
pixel shader :
#version 330
precision highp float;
out vec4 FragColor;
uniform vec4 WireFrameColor;
void main()
{
FragColor = WireFrameColor ;
}
The strange fact is that if in the vertex shader, i comment out the 'normal' , i don't get rendered anything.
Where am i wrong ?
Does anybody know a place to learn modern opengl shaders ?
Thanks