View Full Version : Fur rendering with the geometry shading technique

11-08-2014, 11:36 PM
Hi forum,

I am trying out the basic shell fur rendering from the opengl redbook programming guide and i am having the following fragment link error :

Compile log: 0(18) : error C7576: OpenGL does not allow output blocks in fragment shaders

Link log: Fragment info
0(18) : error C7576: OpenGL does not allow output blocks in fragment shaders

I could not track the problem and ask your help to pin it down. Here goes the shaders:

vertex shader:

#version 430 core

//get the vertex information as attributes
layout (location = 0) in vec3 vPosition;
layout (location = 1) in vec3 vNormal;
layout (location = 2) in vec2 vTexCoord;

//get uniform values from the application
uniform mat4 ModelviewMatrix;
uniform mat4 ProjectionMatrix;
uniform mat3 NormalMatrix;

//the following block takes out information
//from the vertex shader to the next stage
out VS_OUT
vec3 normal;
} vs_out;

void main()
vs_out.normal = normalize(NormalMatrix * vNormal);

//get the vertices position in clip coordinates
gl_Position = ProjectionMatrix * ModelviewMatrix * vec4(vPosition,1.0);

Fragment shader

#version 430 core

vec3 normal;
} fs_in;

out vec4 color;

void main()
vec3 normal = fs_in.normal;
color = vec4(0.2,0.1,0.5,1.0) * (0.2 + pow(abs(normal.z),4.0)) +
vec4(0.8,0.8,0.8,0.0) * pow(abs(normal.z),137.0);

I do not have any output block in the fragment shader. Where does it point to then ?


11-09-2014, 05:13 AM
It looks like you're compiling the vertex shader as a fragment shader (either passing GL_FRAGMENT_SHADER where you meant to pass GL_VERTEX_SHADER, or passing the vertex shader source where you meant to pass the fragment shader source).