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

Geometry Shader support in Mesa i965 DRI for Intel SandyBridge Hardware

I am trying to run the GS demo code of Mesa from here : http://cgit.freedesktop.org/mesa/demos/tree/src/gs, by git cloning this: http://cgit.freedesktop.org/mesa/demos However, I get the error as "needs GL_ARB_geometry_shader4 extension". I am not…
Yusuf Husainy
  • 625
  • 8
  • 19
0
votes
1 answer

Directional per-face lighting using Geometry Shader?

Because of limitations I have to calculate vertex normals inside my geometry shader. Because of this limitation the normals are per-face instead of interpolated between faces on the vertex, meaning per-pixel directional lighting is just a waste.…
ManIkWeet
  • 1,298
  • 1
  • 15
  • 36
0
votes
0 answers

OpenGL: Avoid geometry shader for cubemap framebuffer

I want to render an environment map into a cubemap framebuffer but I dislike the fact, that I have to use the geometry shader to set gl_Layer because the geometry shader would be a basic passthrough shader. Additionally a geometry shader could stall…
tly
  • 1,202
  • 14
  • 17
0
votes
1 answer

C++, OpenGL - geometry shader

I'm stuck with geometry shaders in OpenGL - c++ programming. I want to create simple cube by repeating 6 times drawing one rotated wall. Here is my vertex shader (everyting has #version 330 core in preamble): uniform mat4 MVP; uniform mat4…
Cheshire Cat
  • 335
  • 3
  • 13
0
votes
0 answers

GLSL How to provide line input for geometry shader?

When using layout(points) in in geometry shader, I can simply forward the data through the vertex shader by suppling gl_Position with a vec4: // Vertex Shader in vec2 position; void main() { gl_Position = vec4(position, 0.0, 1.0); } // cpp…
Scraph
  • 175
  • 6
0
votes
1 answer

How do you find the Y position of a point between four vertices? HLSL

Let's say there is a grid terrain for a game composed of tiles made of two triangles - made from four vertices. How would we find the Y (up) position of a point between the four vertices? I have tried this: float diffZ1 = lerp(heights[0],…
Obi-Dan
  • 113
  • 1
  • 8
0
votes
0 answers

Conditional output from geometry-shader GLSL

I am trying to figure out how to switch outputs in the geometry shader, specifically these two outputs: layout(points, max_vertices = 1) out; // OUTPUT 1 layout(triangle_strip, max_vertices = 4) out; // OUTPUT 2 I am doing a rendering of…
mike
  • 194
  • 1
  • 2
  • 18
0
votes
2 answers

opengl draw in 2D coordinates instead of vertex coordinate system

how can i draw in 2D coordinates instead of vertex coordinate system, as this => drawPoint(50 , 100 , 0.01f); this is my code , a background texture and a point static void Draw(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); …
NPLS
  • 521
  • 2
  • 8
  • 20
0
votes
2 answers

opengl texture coordinates for full-screen effect

how can i create the full-screen effect with a texture image ? till now i do this : static void Draw(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glTranslatef(0.0f,0.0f,-5.0f); texture[0] =…
NPLS
  • 521
  • 2
  • 8
  • 20
0
votes
1 answer

OpenGL Geometry Shader Compilation Error OSX-Mavericks

I started with a working OpenGL program (with vertex and fragment shaders) that draws a single GL_POINT. Then I attached a simple geometry shader that outputs two points given a single point as input: #version 400 layout(points) in; layout(points,…
Dustin Biser
  • 372
  • 4
  • 13
0
votes
0 answers

Geometry Shader Quad Post Processing

Using directx 11, I'm working on a graphics effect system that uses a geometry shader to build quads in world space. These quads then use a fragment shader in which the main texture is the rendered scene texture. Effectively producing post process…
Jester
  • 51
  • 1
  • 5
0
votes
1 answer

Is specifying EndStreamPrimitive() necessary in Geometry shader with streams

EndStreamPrimitive() can only be used in case of Geometry shader with streams. Geometry shader with streams can only emit GL_POINTS. But In GL_POINTS, each vertex itself is a primitive. So what is the point of having a function like…
viktorzeid
  • 1,521
  • 1
  • 22
  • 35
0
votes
1 answer

Vertex Shader -> Geometry Shader, error "Getting the location of inactive Uniform"

I have something like the following setup, Vertex Shader (... for irrelevant stuff): #version 330 core uniform mat4 ModelViewMatrix; ... in vec4 position; ... out vec4 out_position; ... void main() { ... out_position = ModelViewMatrix…
Vitali
  • 321
  • 1
  • 2
  • 10
0
votes
1 answer

geometry shader falsely interpreted as vertex shader

I'm trying to get my simple geometry shader to work. But I have some weird error messages. It seems like opengl thinks that my geometry shader is my vertex shader. This is the error message: 0<10> : error C7575: OpenGL does not allow input…
Jonas
  • 3
  • 3
0
votes
1 answer

Debug Geometry Shader in draw call DrawInstancedIndirect

My program is a rain particle system based on the compute shader for advancing rain drops and another rendering shader(vertex shader, geometry shader, pixel shader) for rendering the advanced rain drops. I use the draw call: DrawInstancedIndirect to…
khanhhh89
  • 317
  • 5
  • 19