Two separate programs were used:
programOne = shaderLoad(“shader.vs”, “shader.fs”, “geometry.gs”); // fragment shader before geometry shader
programTwo = shaderLoad(“shaderOne.vs”, “shader.fs”);
For programOne, the follwoing order maintained:
glAttachShader(programOne , vertShader);
glAttachShader(programOne, fragShader);
glAttachShader(programOne, geomShader);
For programTwo, we did as usual (there was no geometry shader):
glAttachShader(programTwo , vertShader);
glAttachShader(programTwo, fragShader);
The first one (programOne) is supposed to render the points to display normals through geometry shaders.
The second one (programTwo) displays the original model.
One thing to note, same fragment shader is used in both programs.
Now, programOne just pass the points from vertex shader to geometry shader to display normals, but does not forward position, normal etc from geometry shader to fragment shader which deal with basically lighting/shading issue. So I got linking errors as mentioned above which I’m supposed to. And no normal is displayed.
But in another platform, it is working fine (shows normals) without showing any linking error which it should not be for programOne.
Here one thing to note that fragment shader just deal with lighting issue, but when geometry shader is used, those normals, position were not forwarded via geometry shader to fragment shader. While dealing with displaying normals, main issue with the fragment shader is to just color the normals.
I’m confused whether the problem is something with OpenGL version or graphics platform.