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
5
votes
1 answer

Dynamically create complementary triangles of a regular grid in OpenGL

I have created a regular grid which originates from a 2D image, i.e. each pixels has a vertex. There are two triangles per four pixels so that I have a triangle in the top right and in the bottom left. I use vertex and index buffers for that. Now I…
Close Call
  • 653
  • 1
  • 6
  • 18
5
votes
4 answers

Do GLSL geometry shaders work on the GMA X3100 under OSX

I am trying to use a trivial geometry shader but when run in Shader Builder on a laptop with a GMA X3100 it falls back and uses the software render. According this document the GMA X3100 does support EXT_geometry_shader4. The input is POINTS and the…
GameFreak
  • 2,881
  • 7
  • 34
  • 38
5
votes
0 answers

Calculate per Vertex Normals in Geometry Shader after Tesselation

I've succeeded in getting tesselation control and evaluation shaders to work correctly, but the lighting for my scene is still blocky because I've been calculating per (triangle) face normals, instead of per vertex. Now that I'm using tesselation,…
cdk
  • 6,698
  • 24
  • 51
5
votes
1 answer

Opengl Geometry shader integer texture fetch fails

I'm trying to sample an integer texture from my geometry shader running on a GeForce 330m. It seems to return other values than I load into the texture. I use this code (basically) for creating and loading the texture: glGenTextures( 1, &textureId…
dascandy
  • 7,184
  • 1
  • 29
  • 50
4
votes
2 answers

Should Particle systems be updated entirely in the geometry shader

Should Particle systems be updated entirely in the geometry shader or should the geometry shader be passed updated data for positions and life ect. At the moment i update everything in the geometry but iam not sure if this is the best idea incase…
RobBain85
  • 77
  • 1
  • 9
4
votes
1 answer

Unexpected behaviour for a Geometry Shader in Processing

I'm using a simple Geometry Shader in Processing: shader(shader); beginShape(); vertex(0.1, 0.1); vertex(0.0, 0.0); vertex(0.001, 0.02); endShape(); So I'm applying a shader on a triangle. We first have a simple Vertex shader that does…
Pau Rosello
  • 137
  • 7
4
votes
1 answer

GLSL Geometry Shaders and projection matrices

So from playing around with it so far, I gather that GLSL geometry shaders work after the input vertices are transformed by the projection/modelview matrices. In other words, the geometry shaders processes things on clip coordinate. What if I was to…
kamziro
  • 7,882
  • 9
  • 55
  • 78
4
votes
1 answer

Pass-through geometry shader for points

I'm having some problems writing a simple pass-through geometry shader for points. I figured it should be something like this: #version 330 precision highp float; layout (points) in; layout (points) out; void main(void) { gl_Position =…
Mike Pedersen
  • 1,056
  • 10
  • 18
4
votes
1 answer

Number of Geometry Shader Executions?

So a vertex shader is executed for each vertex and a fragment shader for each fragment (right?). How many times is a geometry shader executed?
clamp
  • 33,000
  • 75
  • 203
  • 299
4
votes
1 answer

Using the geometry shader for instancing

So I want to draw lots of quads (or even cubes), and stumbled across this lovely thing called the geometry shader. I kinda get how it works now, and I could probably manipulte it into drawing a cube for every vertex in the vertex buffer, but I'm not…
Hannesh
  • 7,256
  • 7
  • 46
  • 80
4
votes
1 answer

SceneKit - Map cube texture to box

I've a texture for a cube that looks like I'd like to use it on a cube in a SceneKit view. I'm using the SceneKit geometry SCNBox for that. Unfortunately, the result is that the texture is projected entirely on each face, instead of using only the…
Guig
  • 9,891
  • 7
  • 64
  • 126
4
votes
1 answer

Supply 4 vertices to geometry shader in OpenGL

I currently have some VAOs and an index list. The idea is to process groups of 4 elements in the geometry shader. The way of picking the groups is if I have the list (1,2,3,4,5,6,7,8,...) then the groups would be ((1,2,3,4),(5,6,7,8),...). After…
Gonzalo
  • 3,674
  • 2
  • 26
  • 28
4
votes
0 answers

How do I change the OpenGL Context to 3.2 on Mac 10.9.3

I had an issue with my shaders when I realized I'm using OpenGL 2.1 and GLSL 1.2. Due to the fact that geometry shaders are not supported until 1.5 I need to use another OpenGL, GLSL Version. But how? I think I read up to 15 threads but nothing…
Marc Radziwill
  • 175
  • 2
  • 12
4
votes
0 answers

OpenGL: Geometry Shader performance with a lot of cubes

So I wrote a really simple OpenGL program to draw 100x100x100 points drawn as cubes using the Geometry Shader. I wanted to do it to benchmark it against what I could currently do using DirectX11. With DirectX11, I can easily render these cubes at…
riandrake
  • 41
  • 3
4
votes
1 answer

Fragment Diffuse value changing with camera location/rotation

I am attempting to get some simple diffuse lighting to work in GLSL. I have a cube that is being passed in as an array of points and I'm calculating the face normals inside my geometry shader (because I intend to deform the mesh at run-time so I'll…
APalmer
  • 919
  • 3
  • 11
  • 22
1
2
3
15 16