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
1
vote
0 answers

Is it possible to pass geometry to a geometry shader?

Is there a way to pass an array of vertex data from the cpu straight to a geometry shader? If i want to build a sphere inside a GS, I'd rather have a pre calculated array of points that I can access from within the shader instead of generating them…
Roman
  • 107
  • 7
1
vote
2 answers

Can I use an array of 6 int from Vertex Shader to Geometry Shader?

I am trying to generate OpenGL primitives out of a 6 integer Vertex. I.E. the 6 integer value will generate 4 custom line_strip. First I am trying to move the 6 integer array from Vertex to Shader and in order to do that I am doing a simple test as…
M.E.
  • 4,955
  • 4
  • 49
  • 128
1
vote
1 answer

How do you move variables from Vertex shader to Geometry shader?

I have the following Vertex shader: #version 330 layout (location = 0) in ivec4 inOHLC; layout (location = 1) in int inVolume; layout (location = 2) in int inTimestamp; out ivec4 outOHLC; out int outVolume; out int outTimestamp; void main() { …
M.E.
  • 4,955
  • 4
  • 49
  • 128
1
vote
2 answers

Can a geometry shader access OpenGL culling and front face settings?

Is it possible for a OpenGL geometry shader to access the current settings for glFrontFace and glCullFace, and whether face culling is enabled? I have a geometry shader that renders normals for vertexes of triangles, and would like to render them…
Sam Buss
  • 411
  • 4
  • 9
1
vote
0 answers

Difficulty in understanding how tex2Dlod works

I am new to shader programming. I was just referring to some blogs to learn more on this area. I came across this article https://halisavakis.com/my-take-on-shaders-grass-shader-part-i/ According to them, they are using a displacement texture to…
MrRobot9
  • 2,402
  • 4
  • 31
  • 68
1
vote
1 answer

Vulkan 2D geometry shader generated geometry lines exhibiting parralellogram shape

I am trying to add support for geometry shaders for a Vulkan project, so I am just starting with something simple for now. The goal is, given a list of vertices, generate a perfect rectangle encompassing that line. For that effect I made this…
Makogan
  • 8,208
  • 7
  • 44
  • 112
1
vote
0 answers

Generating an optimal set of procedural 3D particles for a view frustum

Let's say you want make a simple rain/snow/dust/starfield effect in a 3D scene. Putting individual raindrops, snowflakes, dust particles or stars as individual nodes in a scene hierarchy would be too slow. Another solution would be to use some kind…
gman
  • 100,619
  • 31
  • 269
  • 393
1
vote
0 answers

Hard coded triangle in HLSL geometry shader doesn't show on screen

In Unity I'm planning on using a geometry shader for processing points into quads and can't quite figure out why I'm not getting output from my geometry shader. I've edited it down to a minimum working example, as seen here: Shader "foo/bar" { …
Fraser
  • 290
  • 3
  • 11
1
vote
1 answer

Layered rendering cubemap in one pass

I am trying to make a dynamic cubemap with geometry shader and gl_Layer where each face have is own texture but it doesn't work like expected. Or I have a black cubemap with nothing or I have nothing... this is where I initialize my texture and…
Bomu
  • 11
  • 4
1
vote
2 answers

Implementing clip planes with geometry shaders?

What am I using: Qt 5.11.1, MinGW 5.3, Windows 10, C++11, GPU: NVidia 820M (supports OpenGL 4.5) My task: I have non-solid (just surface) object, rendering by glDrawArrays, and i need to get cross-section of this object by plane. I have found…
1
vote
1 answer

Receive and cast shadows (custom GEOMETRY Grass Shader) - Unity C#

I was following a tutorial made by Sam Wronski aka. World of Zero (Tutorial by World of Zero) where he codes a geometry shader for a point cloud grass generator. Great tutorial but I am wondering (and didn't find a proper solution after days of…
M_NEN
  • 135
  • 1
  • 3
  • 13
1
vote
1 answer

Can't get openGL's glDrawElements to work with geometry shader

i have attached the shader but i can't find any info on how to use glDrawElements with a goemetry shader attached to the shader program. The program would output a quad on the screen without the geometry shader, now i'm trying to do the same but…
Hamaro
  • 49
  • 9
1
vote
1 answer

Geometry Emission Shader in Unity3D

I'm working on trying to create a cg shader that emits a quad from each vertex of a mesh. I know I'm looking at making a Geometry shader, but can't find any documentation or examples of geometry addition shaders that play well with Unity - most only…
1
vote
1 answer

Inputs and Outputs of the Geometry Shader

I was wondering if anyone would be so kind as to pin-point the problem with my program. I am certain the setback has something to do with the way in which data is passed through the GS. If, for instance, the geometry shader is taken out of the code…
NAKASSEIN
  • 45
  • 1
  • 6
1
vote
0 answers

fill between two radius of circle by geometry shader with radius

I'm confused in using geometry shader for solve this problem: I have two radius of a circle that every radius is a line and I called that's a line. every line is made of list of points that every points have a color. so how fill between two lines…