cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

sanosuke001
Adept II

lines_adjacency in Geometry Shader issue

using line_adjacency in geometry shader causes GL_INVALID_OPERATION error

Hello,

 

I'm trying to implement a Bezier Curve algorithm in a geometry shader and so far, not working too well. My problem is that nothing was drawing at all so I tried to simplify the test to see where things were broken. I changed my input layout to lines and it would draw just fine but with lines_adjacency, if I check the gl error, I get a GL_INVALID_OPERATION. Here's my geometry shader

 

#version 150

precision highp float;

uniform float FpNum;
uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;
uniform mat4 modelMatrix;

in vec4 colorGeom[];

smooth out vec4 colorFrag;

layout(lines_adjacency) in;
layout(points, max_vertices=4) out;

void main()
{
    mat4 mvpMatrix = projectionMatrix * viewMatrix * modelMatrix;
   
    for(int j = 0; j < gl_in.length(); j++) {
        gl_Position = mvpMatrix * gl_in.gl_Position;
        colorFrag = colorGeom
;
        EmitVertex();
    }
}

EDIT: stupid [] not accepting i as it wants to italicize everything; is there a code block? [code/] didn't work...

0 Likes
1 Reply
sanosuke001
Adept II

Nevermind, I realized I had to use GL_LINE_STRIP_ADJACENCY as my type instead of GL_LINE_STRIP. /orz

0 Likes