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

Geometry shader doesn't emit geometry

I am setting the following pipeline: Vertex shader gets as input 4 vertices to draw as full screen quad with triangle strip : Vertex Shader: #version 420 core layout(location = 0) in vec4 position; out gl_PerVertex { vec4 gl_Position; } ; void…
Michael IV
  • 11,016
  • 12
  • 92
  • 223
0
votes
0 answers

Get coordinates inside circumference sector

I have a database(PostgreSQL) with coordinates of lightning bolts. I want coordinates inside a circumference sector(SQL Query). I have the radius, angle(Z) and point A of circumference, and coordinates of extremal points([lat1,lng1], [lat2,…
Tisp
  • 436
  • 2
  • 15
0
votes
1 answer

Drawing a mix of quads and triangles using the geometry shader and lines_adjacency

My current rendering implementation is as follows: Store all vertex information as quads rather than triangles For triangles, simply repeat the last vertex (i.e. v0 v1 v2 v2) Pass vertex information as lines_adjacency to geometry shader Check if…
Fault
  • 420
  • 3
  • 17
0
votes
1 answer

Invalide value when using EmitVertex in GLSL version 150

This glsl shader compiles fine, but when I try to activate it with glUseProgram(); opengl gives me an invalid value error: @vert #version 150 uniform mat4 projectionmodelview_matrix_; in vec3 global_position_; void main(void) { gl_Position =…
Viktor Sehr
  • 12,825
  • 5
  • 58
  • 90
0
votes
1 answer

Usage of glBindBufferRange with transform feedback

I have a buffer that I would like to fill over successive transform feedbacks, and I am wondering how exactly to do this. glBindBufferRange has five arguments, I understand that the first three are equivalent to the arguments of glBindBufferBase,…
leohutson
  • 95
  • 2
  • 10
0
votes
2 answers

Geometry shader invocations input layout qualifier

What does the "invocations" input layout qualifier of a geometry shader do? The OpenGL wiki just says that it causes the GS to be executed multiple times for each primitive, and goes on to say that: The output primitives from instances are ordered…
leohutson
  • 95
  • 2
  • 10
0
votes
0 answers

Surface at intersection of Clipping Plane and Geometry

I have a geometry with I am displaying using geometry shader in combination with vbo. I also have two clipping planes which are needed to display the portion of the object I want. Now I want to display a surface to cover the opening(I render a…
AdityaG
  • 428
  • 1
  • 3
  • 17
0
votes
0 answers

Updating Attribute variables in Vertex Shader(glVertexAttrib3f) working as glVertex

I am having trouble using Attribute variables for getting a value into vertex shader. I want to provide the geometry shader with one of the points from the previous primitive(line) for some calculation. I am providing this point using a vec3…
AdityaG
  • 428
  • 1
  • 3
  • 17
0
votes
2 answers

Perpendicular to a vector at point on the vector

I am working with a model where I have to calculate a perpendicular to a vector from p1 and p2 (3d) at point p3 on the line joining these points. The arrangement would be some thing like this p1--------p3---------p2 . Some times this p3 may…
AdityaG
  • 428
  • 1
  • 3
  • 17
0
votes
1 answer

How get few vertices on geometry shader in GLSL

I need get 4 vertices after vertex shader processing. Primitive(quad) drawing with target: GL_TRIANGLE_STRIP. My code: layout(lines_adjacency) in; layout(triangle_strip, max_vertices = 4) out; in vs_output { vec4 color; } gs_in[]; out…
toodef
  • 125
  • 1
  • 11
0
votes
2 answers

Geometry shader voxelization wrong

Im trying to make a geometry shader (with shader maker) to legolize a model. First of all im trying to do a voxelization but the results are not good and i can't find what its wrong. En the following code the idea is to find the baricenter of the…
0
votes
1 answer

How to calculate "view inverse matrix"

I’m trying out a particle system example that came out with RenderMonkey and it uses a “view inverse matrix” to billboard the quads for the particle effect. I can see all the values from within RenderMonkey, but I can’t work out how they calculate…
weston
  • 54,145
  • 21
  • 145
  • 203
0
votes
1 answer

World space view direction in Cg geometry shader

How to to get view direction in world space inside the Cg geometry shader?
ChatCloud
  • 1,152
  • 2
  • 8
  • 22
0
votes
1 answer

How do I instance in a geometry shader in DirectX11?

I know that in the vertex shader you do it like this: PixelInputType TextureVertexShader(VertexInputType input) { PixelInputType output; // Change the position vector to be 4 units for proper matrix calculations. input.position.w =…
Brail Brailov
  • 71
  • 1
  • 2
  • 5
0
votes
1 answer

Can I export triangles instead triangle strip in geometry shader?

Is there any possibility of exporting from geometry shader only triangles instead triangle strips? This enables some interesting possibilities. OpenGL 3.3. glProgramParameteriARB(mVoxelShd, GL_GEOMETRY_OUTPUT_TYPE_ARB, GL_TRIANGLE_STRIP); Specifies…
Palax
  • 117
  • 8
1 2 3
15
16