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
2 answers

differant color for two side of a plane in OpenGL

I want to give different colors for two sides of plane to mesh in opengl. Can I use clip_Distance like variables to cut the face in two halfs? or by writing custom geometry shader to emit vertices at the cut planes. Can I use the face cutting…
0
votes
1 answer

Is it possible to share a variable between iterations of a geometry shader?

Overview I am generating a graph segments whose functions I know. What I want to do is add another function to this graph of tall bars of known area and height. The problem is that these bars can bleed from one segment to the…
Neil G
  • 32,138
  • 39
  • 156
  • 257
0
votes
0 answers

HLSL Stream Out Entries don't work correctly

I want implement Particle system based on stream out structure to my bigger project. I saw few articles about that method and I build one particle. It works almost correctly but in geometry shader with stream out i cant get value of InitVel.z and…
0
votes
1 answer

How to render point sprites in 3D space among other objects

What is the best way to render a mixture point sprites and 3D objects? Say for example, I wanted to model "space dust" particles as point sprites. In space I could have large asteroid objects (cubes for simplicity) and the space dust particles could…
SparkyNZ
  • 6,266
  • 7
  • 39
  • 80
0
votes
0 answers

HLSL alphablending in geometry shader

I am rather new to HLSL and I am struggling with implementing a grass shader. In the geometry shader I create quads which will display the grass blades. However when I try blending in the pixelshader things get weird. Sometimes it ignores everything…
Quinten Henry
  • 125
  • 1
  • 2
  • 10
0
votes
0 answers

DirectX Intel HD and NVIDIA different behavior Geometry Shader

My code uses a geometry shader to produce thick lines using this: https://forum.libcinder.org/topic/smooth-thick-lines-using-geometry-shader (Uses geometry shader approach) I get it work on my local machine using an Intel HD Graphics card. However,…
Jonas Bräuer
  • 183
  • 2
  • 15
0
votes
1 answer

HLSL Geometry Shader Thick Lines DirectX

I try to draw a thick lined Sinus curve using this approach : https://forum.libcinder.org/topic/smooth-thick-lines-using-geometry-shader I tried to port it to HLSL geometry shader: Setting the dimension to fix 500/500 atm THICKNESS seems not to…
Jonas Bräuer
  • 183
  • 2
  • 15
0
votes
1 answer

Geometry shader doesn't work (unity3d)

I'm developing a shader in unity. The shader must contain vertex, fragment and geometry shaders, and while the first two work fine, I have problems with geometry shader. When I use the code below, the shaded object the shader just gets painted pink,…
ekaerovets
  • 1,158
  • 10
  • 18
0
votes
1 answer

Can you pass an array as input to a geometry shader?

Can you pass an array of vec2's to a geometry shader as input? If so what is the syntax?
Crook
  • 733
  • 1
  • 6
  • 9
0
votes
1 answer

Vector processing feedback loop in OpenGL ES 2.0

Reading the OpenGL ES 2.0 spec and available extensions there seem to be no way of processing vertices from one buffer into another. The extensions seem to target ES 3.0+ only. The best bet so far seem to be OpenCL with OpenGL interop... Function…
Andreas
  • 5,086
  • 3
  • 16
  • 36
0
votes
1 answer

Do I need to pass color though my geometry shader to the fragment shader?

So I have three shaders in my program. Vertex: #version 330 core in vec2 Inpoint; in vec2 texCoords; out vec2 TexCoords; uniform mat4 model; uniform mat4 projection; void main() { TexCoords = texCoords; gl_Position = projection * model *…
0
votes
1 answer

OpenGL - Geometry shader shadow mapping pass performing terribly

I'm calculating shadows for a number of point lights using Variance Shadow Mapping. All 6 faces of the cubemap are rendered in a single pass with a geometry shader, this repeats for each light source, and the whole lot is stored in a cubemap array.…
livin_amuk
  • 1,285
  • 12
  • 26
0
votes
1 answer

OpenGL TES, possible to have adjacency information in output?

I am wondering whether a Tessellation Evaluation Shader (TES) can somehow output adjacency information that can then be used by a Geometry Shader (GS). Let's take as example a TCS/TES combination rendering some isocurves using layout (isolines,…
Ailurus
  • 731
  • 1
  • 10
  • 23
0
votes
1 answer

Vulkan: VkVertexInputBindingDescription always wrong with geometry shader

I'm trying to implement billboarded quads in a geomerty shader to render particle effects. The geometry shader input is points (vec3), and its output is a triangle strip with position and UV coordinates (vec3, vec2). I've tried two variations of…
Brent
  • 4,153
  • 4
  • 30
  • 63
0
votes
2 answers

What color does a fragment get if there are two vertices at the very same position with two different colors?

I have a question concerning the OpenGL rendering pipeline. I have recently been reading theory about the GLSL's Geometry Shader. I think I do understand the basics of how to emit new geometry and assign colors to the new vertices. I am, however,…
Walter
  • 396
  • 1
  • 5
  • 16