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

glsl pass through geometry shader issue

At this point I have a working vertex and fragment shader. If I remove my geometry shader completely, then I get the expected cube with colors at each vertex. But with the geometry shader added, no geometry shows up at all. Vertex Shader: #version…
APalmer
  • 919
  • 3
  • 11
  • 22
3
votes
1 answer

Cannot get pass through geometry shader working

I have a VBO with points in it, that I can render fine with a vertex and fragment shader, but when I add a pass through geometry shader, I see nothing. I'm using MRT for glow, but in this example I don't touch it. From what I've seen on other…
starruler
  • 302
  • 2
  • 10
3
votes
1 answer

OpenGL geometry shader, setting input size

I've written my first geometry shader with success. It takes in lines and outputs a little triangle at the center of each. I could do the same thing for triangles easily enough, but what about a cube? Is there a way to get a geometry shader to…
Hal Gee
  • 65
  • 2
3
votes
1 answer

Passing variables from a geometry shader to a fragment shader

I have an GLSL geometry shader that looks like the following: #version 150 uniform mat4 p; uniform mat4 mv; uniform mat3 nm; layout(points) in; layout(triangle_strip, max_vertices = 200) out; out vec4 test; void main() { for (int i = 0; i <…
iuiz
  • 957
  • 1
  • 10
  • 23
3
votes
2 answers

OpenGL Geometry Shader Mac OS X

I'm trying to get a simple pass through geometry shader to work under Mac OS X 10.6. The code compiles and links without problem, but for some reason no geometry is being drawn to the screen. Here's my shader code: #version 120 #extension…
LandonSchropp
  • 10,084
  • 22
  • 86
  • 149
3
votes
2 answers

Push constant limit in geometry shader?

I have a geometry shader with the following push constant block: layout(push_constant) uniform Instance { mat4 VP; vec3 posCam; float radius; float curvature; } u_instance; The push constants are defined in the pipeline layout like…
Silverlan
  • 2,783
  • 3
  • 31
  • 66
3
votes
1 answer

Shader linkage error/mismatch

I'm working on dynamic cubemap rendering. In particular, to render the cubemap I'm using a shader from the DirectX SDK sample "CubeMapGS". The shader seems correct, as you can see here: SamplerState ss; Texture2D tex; cbuffer Constants { …
StrG30
  • 670
  • 1
  • 10
  • 20
3
votes
1 answer

Is it possible to have the same vertex shader and fragment shader with or without a geometry shader?

So I'm just learning about geometry shaders, and I have a use case for one. For performance reasons I don't want to use the geometry shader all the time, even as a pass through, because most objects most of the time don't need it. However when I do…
3
votes
1 answer

geometry shader input with custom vertex count in OpenGL?

I am working on a project where (and I am simplifying a little) I need to calculate cross sections of 3-dimensional shapes and render them. For example, I may have a list of tetrahedrons (each tetrahedron consists of 4 vertices), or a list of…
appa132
  • 31
  • 3
3
votes
1 answer

Link error adding geometry shader between vertex and fragment shader

When I try adding a geometry shader between working vertex and fragment shaders I get a link error: Fragment shader(s) failed to link, vertex shader(s) failed to link. ERROR: error(#280) Not all shaders have valid object code ERROR: error(#280)…
3
votes
1 answer

SharpDX / DirectDX: Transparency, normals and rendering order

I'm rendering several cubes created with geometry shader (I load only locations and color), each with different alpha value. The problem is, that after enabling of alpha blending, visibility of the cubes changes with angle I look at them. Objects…
Seldon
  • 45
  • 5
3
votes
2 answers

How to apply luminosity uniformly on hair particules with OpenGL using GLSL shaders?

I have created a hairstyle with Blender 2.66 using hair particle system. This looks like this : As you can see, the luminosity has been applied on line fragments. After conversion, I have exported my hairstyle mesh to OBJ file format. I parsed it…
user1364743
  • 5,283
  • 6
  • 51
  • 90
3
votes
2 answers

Passing varying array from vertex to geometry shader on Mac

I'd like to be able to pass an arbitrary number of varying values per vertex from the vertex shader to the geometry shader. I know that OpenGL has no dynamic arrays, so the number should be specified at compile time. The whole thing should run on an…
MvG
  • 57,380
  • 22
  • 148
  • 276
3
votes
0 answers

Geometry shaders and depth FBOs

Are there any special rules regarding rendering to an FBO when there's a geometry shader involved? Context: I'm trying to implement shadow mapping in a scene which includes different types of objects being rendered in different ways: Meshes,…
bradshire
  • 341
  • 1
  • 3
  • 6
2
votes
1 answer

GLSL geometry shader using lines_adjacency

I am writing a GLSL geometry shader and I am trying to use the lines_adjacency input layout but it isn't working. My first pass-though test using the lines input layout works fine: // GLSL GEOMETRY SHADER #version 410 layout (lines) in; layout…
atb
  • 1,412
  • 1
  • 14
  • 30
1 2
3
15 16