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

Billboard using the Geometry shader

I am trying to render billboards using a geometry-shader which takes points as input and outputs a triangle stream (using DirectX11). However the current result is not what I expect it to be. For comparison, here are two screenshots, rendering the…
Simon
  • 428
  • 5
  • 19
1
vote
1 answer

Geometry Shader Additional Primitives

I wanted to use a GLSL geometry shader to look at a line strip and determine the place to put a textured annotation, taking into account the current ModelView. It seems I'm limited to only getting 4 vertices per invokation (using…
Chris
  • 452
  • 3
  • 14
1
vote
0 answers

GLGS: How do I "connect" a sampler to a texture?

I am trying to read from a 3D texture inside a geometry shader: #version 150 layout(points) in; // origo of cell layout(points, max_vertices = 1) out; uniform sampler3D text; void main (void) { for(int i = 0; i < gl_in.length(); ++i) …
Andy
  • 3,251
  • 4
  • 32
  • 53
1
vote
1 answer

Reading output from geometry shader on CPU

I'm trying to read the output from a geometry shader which is using stream-output to output to a buffer. The output buffer used by the geometry shader is described like this: D3D10_BUFFER_DESC vbdesc = { numPoints * sizeof( MESH_VERTEX ), …
Tchami
  • 4,647
  • 1
  • 32
  • 45
1
vote
1 answer

Render to 3D Texture with OpenGL on OSX (multi-layer framebuffer attachment)

I have an OpenGL 3.2 CORE context on OSX 10.7.5 set up and trying to render to a 3D texture, using a layered rendering approach. The geometry shader feature "gl_layer" is supported, but I cannot bind a GL_TEXTURE_3D to my framebuffer attachment. It…
FHoenig
  • 349
  • 1
  • 10
1
vote
1 answer

CgFX geometry shader

How to use geometry shaders with CgFX? Actually how to specify geometry shader within the 'technique'? The listing is below, vertex and fragment shaders are compiled well. But 'NVIDIA FX Composer 2.5' fires an 'error C3001 no program defined' after…
ChatCloud
  • 1,152
  • 2
  • 8
  • 22
1
vote
1 answer

HLSL Geometry Shader quads are moving

i am trying to convert a single point into a quad using the geometry shader in HLSL. When i am not using the geometry shader and try to display the single pixel it works just fine. But when i use it, the quads are getting drawn but they seem to move…
puelo
  • 5,464
  • 2
  • 34
  • 62
0
votes
1 answer

Multiple subdivision of an icosahedron using HLSL Geometry Shader

Currently I'm subdividing an icosahedron once by using the following Geometry Shader: [maxvertexcount(8)] void gs(triangle VS_OUT gin[3], inout TriangleStream s) { // p1 // / \ // / \ // m0 --- m1 …
0xbadf00d
  • 17,405
  • 15
  • 67
  • 107
0
votes
0 answers

Applying a Geometry Shader on Existing Material in GLB Using Filament Android

I'm working on an Android project using the Filament rendering engine to display 3D models in GLB format. I have successfully loaded and displayed models with existing materials using Filament. However, I would like to apply a custom shader to an…
0
votes
1 answer

3D point in triangle test, is the cross product required?

The point-in-triangle test from Scratchapixel lists the following pseudocode for determining of a point that lies in the plane of a triangle is also within the bounds of its edges. Vec3f edge0 = v1 - v0; Vec3f edge1 = v2 - v1; Vec3f edge2 = v0 -…
Carpetfizz
  • 8,707
  • 22
  • 85
  • 146
0
votes
0 answers

Water shader turns into a circle

circle shader graph My shader looks like a circle for some reason, any ideas how to fix it? I already tried chaning node's "Object" Space into others, for example world, but that didnt helped.
0
votes
0 answers

Shader to draw a cube or sphere at each vertex

Can someone help me write or find a shader (in HLSL, shadergraph, etc.) that does the following on the gpu? 1- takes the input vertex array (ignores triangles, etc), 2- in place of each vertex, draws a predetermined simple shape (such as a cube, no…
totellini
  • 1
  • 1
0
votes
1 answer

SFML 2.5.1 - Geometry shaders are not supported, Ubuntu 22.04, NVIDIA GeForce RTX Mobile

After changing the operating system, I could no longer use the SFML geometry shader and always got the following error: Failed to create a shader: your system doesn't support geometry shaders (you should test Shader::isGeometryAvailable() before…
kaiserm99
  • 146
  • 8
0
votes
0 answers

OpenGL - Layered Rendering Cube Only Render the First Face

Description I'm trying to set up a framebuffer for point light shadows. For this I create a shader as described below (VS/GS/FS). To the framebuffer I then attach a cubemap texture and assign each side with a 2D texture. I then try to render the…
John Smith
  • 111
  • 1
  • 11
0
votes
0 answers

OpenGL Triangle pipe around line segment

I would like to ask how can I render in geometry shader a triangle pipe from a line segment? I first compute perpendicular vector "perp" to the line vector "axis". Then I rotate the "perp" vector few times by "rotate" function. Since mesh is…