Geometry shader
Code: Select all
#version 150
layout(triangles) in;
layout (triangle_strip, max_vertices=3) out;
in VertexData {
vec2 texCoord;
vec3 normal;
} VertexIn[3];
out VertexData {
vec2 texCoord;
vec3 normal;
} VertexOut;
void main()
{
for(int i = 0; i < gl_in.length(); i++)
{
// copy attributes
gl_Position = gl_in[i].gl_Position;
VertexOut.normal = VertexIn[i].normal;
VertexOut.texCoord = VertexIn[i].texCoord;
// done with the vertex
EmitVertex();
}
}
Code: Select all
#version 410
layout (std140) uniform Matrices {
mat4 projModelViewMatrix;
mat3 normalMatrix;
};
in vec3 position;
in vec3 normal;
in vec2 texCoord;
out VertexData {
vec2 texCoord;
vec3 normal;
} VertexOut;
void main()
{
VertexOut.texCoord = texCoord;
VertexOut.normal = normalize(normalMatrix * normal);
gl_Position = projModelViewMatrix * vec4(position, 1.0);
}
The basic question I have is how much information do I need to send from Irrlicht in order to use these "directives". Looking at the above code in the VS do I only specify
Code: Select all
in vec3 position;
in vec3 normal;
in vec2 texCoord;