Varyings in Geometry shaders

I know that when you pass something from the vertex to the geometry shader it has to be like:

out int derp;

on the vertex shader, and:

in int derp[];

on the geometry shader side
For example, gl_Positon is set as normal on the vertex shader side, but if you want to check this at the geometry shader side you have to do this: gl_Position[0], you could use gl_vertexIn to see how many there are.
I am trying to pass one of my own varyings from the vertex shader to the geometry shader, it looks like this:

out vec3 voxelCorner;

on the vertex shader, and like this:

in vec3 voxelCorner[];

on the geometry shader.

GLSL throws me “unknown error”, compiled with cg compiler.
So how DO i pass a vec from my vertex shader to my geometry shader?

As soon as I have in varyings(with the keyword varying excluded since its deprecated) with a set dimension it throws me “unkown error”
Nvidias SDK is no help either because they write all their stuff in CG. I really hate it when small but very specific details totally stops so you dead in your tracks!

Oh and another cute thing: All the example geo shaders i GLSL quite naturally only display very basic stuff, like duplicating all the vertices and giving them an offset, and they ALL use only GLSL primtives supplied by openGL, gotdamnit this drives me nuts!

Edit: oh nice spelling error right in the topic there.
To be completly frank its quite frustrating using GLSL because it always seems like these annyoing inconsistentcies and weird compilation errors occur, and you have no chance in hell trying to find out what went wrong googling it(which I have done extensivly).

Okay know seems to have cared to answer, if there are any other users running into this, the solution in my case was to move all the out variables in the shader code so that they were before the in variables. I have no idea at all why that would have been needed. Im starting to think that the NVidia people dont like it when people use GLSL.

Can you post your shaders before and after moving varyings?

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.