Questions tagged [geometry-shader]

Geometry shader should not be mixed up with [vertex-shader], but are shader programs executed after vertex shaders. They take as input a whole primitive like point, line or triangle.

Geometry shaders are the 3rd type of GPU shader programs after and and process whole primitives like points, lines or triangles.

Resources

232 questions
0
votes
0 answers

Mirroring using the geometry shader

I'm trying to perform simple geometry mirroring at the geometry shader stage. My vertex data comes out correctly but the vertex lighting is not correct for the mirrored geometry. For the vertices i'm simply mirroring about the XZ plane which works…
0
votes
0 answers

How to get the value from a input variable of a geometry shader?

Suppose my vertex shader has a value for each vertex: in uint v_iFlag; out uint v_oFlag; void main{ ... v_oFlag = v_iFlag; } My geometry shader get the flag value from the vertex shader: layout(triangles) in; in uint v_oFlag[] void main(){ …
lightrek
  • 951
  • 3
  • 14
  • 30
0
votes
3 answers

Geometry shader calculated lines disappear on camera move

I draw vertex normals using geometry shader. Everything shows up as expected except that when I move the camera some lines partially disappear. First, I thought this was due to the frustrum size but I have other objects in the scene bigger than this…
Illia
  • 301
  • 1
  • 4
  • 16
0
votes
0 answers

GLSL Making LOD curves from lines

Solution: Drawing tessallated LineLoops in OpenGL/GLSL I am using OpenGL and GLSL to draw LineLoops on a sphere (Borders on a Planet). Since the points defining the lines are given by user input they do not have high enough precion to prevent…
Jhonny007
  • 1,698
  • 1
  • 13
  • 33
0
votes
0 answers

Why EndPrimitive function sometimes does not work?

Problem Sometimes EndPrimitive function in OpenGL's geometry shaders does not work as I expected- few output primitives are joined together. Details Program I want to draw a shape that consists of lines on each multiplication of given angle and…
BPiek
  • 174
  • 11
0
votes
1 answer

GLSL Geometry Shader problems

I have been pulling my hair out for 2 days over this. First.. the code.. All of it. //Leaf Vertex Shader #version 330 compatibility out vec4 VertexColor; void main(void) { gl_Position = gl_ModelViewMatrix *gl_Vertex; gl_TexCoord[0].st =…
Mike O
  • 149
  • 10
0
votes
1 answer

Calculating Per face normals in Geometry Shader

I'm trying to calculate per-face normals in geometry shader, using the following pipeline //VERTEX_SHADER #version 330 layout(location = 0) in vec4 vertex; out vec3 vert; uniform mat4 projMatrix; uniform mat4 mvMatrix; void main() { vert =…
Mostafa Wasat
  • 181
  • 2
  • 10
0
votes
1 answer

Light changes with Pass Through Geometry Shader

I am using FragmentShader and VertexShader at present, and works absolutely fine. I cannot get my geometry shader working proprly. I am absolutely new to it, below is what I have tried. I am using VBO, lighting and textures along with some…
Bhavya Arora
  • 768
  • 3
  • 16
  • 35
0
votes
1 answer

PassThrough Geometry Shader Not Working

I am using FragmentShader and VertexShader at present, and works absolutely fine. I cannot get my geometry shader working. I am absolutely new to it, below is what I have tried. I am using VBO, lighting and textures along with some geometry, but it…
Bhavya Arora
  • 768
  • 3
  • 16
  • 35
0
votes
0 answers

How to generate OBJ mesh file if I used GLSL

I want to generate a OBJ file from a code, which using GLSL file to generate mesh, now I can get the vertex information from the code, but how can I extract the triangle information from the .geom.glsl file and export it into a OBJ file? Also, is…
happybunnie_wy
  • 85
  • 3
  • 12
0
votes
2 answers

OpenGL layered rendering interferes with layer 0

I am using gl_Layer = gl_InvocationID; in a geometry shader to render into a framebuffer with a 3D texture attached. This mostly works fine. Except every invocation of the shader also renders into layer 0, as well as the layer that I specify. How…
Andy
  • 315
  • 2
  • 10
0
votes
1 answer

Vector algebra working strangely in a geometry shader

My relatively simple geometry shader #version 330 core layout (lines) in; layout (triangle_strip, max_vertices = 3) out; void main() { gl_Position = gl_in[0].gl_Position; EmitVertex(); gl_Position = gl_in[1].gl_Position;…
Ylfaue
  • 131
  • 1
  • 7
0
votes
1 answer

HLSL Geometry Shader empty output

I am trying to build textured quads out of single vertices (as POINT List) inside the Geometry Shader. The problem i am unable to solve right now is that nothing gets rendered. I already tried to debug it with Visual Studios' Graphics debugger, and…
puelo
  • 5,464
  • 2
  • 34
  • 62
0
votes
1 answer

OpenGL: draw particles at the same time

I am reading the article "Particles / Instancing" Here is the quote: Clearly, we need a way to draw all particles at the same time. There are many ways to do this; here are three of them : (a) Generate a single VBO with all the particles in them.…
user1914692
  • 3,033
  • 5
  • 36
  • 61
0
votes
0 answers

Slow OpenGL Geometry Shader DrawArrays / Transform Feedback

I am using OpenGL (via OpenTK) to perform spatial queries on lots of point cloud data on the GPU. Each frame of data is around 200k points. This works well flor low numbers of queries (<10queries @ 60fps) but does not scale as more are performed per…
John
  • 405
  • 4
  • 19