Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


TheItalianJob71

Member Since 07 Jan 2012
Offline Last Active Yesterday, 06:13 PM

Topics I've Started

vertex and pixel shader strange problem

08 March 2013 - 03:37 AM

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

PARTNERS