Jump to content
  • Advertisement
Sign in to follow this  

Geometry shaders renders nothing

This topic is 2944 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For my other question to work I need to get geometry shaders working. So far I never managed to get them working. It's simply nothing rendered. The vertex and geometry shader work without the geometry shader (just outputs a solid color quad). As soon as geometry shader is involved nothing is rendered at all anymore. The shader looks like this:

#extension GL_EXT_geometry_shader4: enable

precision highp float;
precision highp int;

layout( points ) in;
layout( triangle_strip, max_vertices=4 ) out;

in vec4 inParticle0[ 1 ];
in vec4 inParticle1[ 1 ];
in vec4 inParticle2[ 1 ];
in vec4 inParticle3[ 1 ];

out vec4 gBillboard; // x, y, u, v
out vec4 gParticle0;
out vec4 gParticle1;
out vec4 gParticle2;
out vec4 gParticle3;

const vec4 billboard1 = vec4( -0.5, -0.5, 0.0, 0.0 );
const vec4 billboard2 = vec4( 0.5, -0.5, 1.0, 0.0 );
const vec4 billboard3 = vec4( 0.5, 0.5, 1.0, 1.0 );
const vec4 billboard4 = vec4( -0.5, 0.5, 0.0, 1.0 );

void main( void ){
gParticle0 = inParticle0[ 0 ];
gParticle1 = inParticle1[ 0 ];
gParticle2 = inParticle2[ 0 ];
gParticle3 = inParticle3[ 0 ];
gl_PrimitiveID = gl_PrimitiveIDIn;
gl_Layer = 0;

gBillboard = billboard1;
gBillboard = billboard2;
gBillboard = billboard3;
gBillboard = billboard4;

The idea is to have a pass-through type geometry shader which simply turns a point into a quad (hence a 2-triangle triangle-strip). I'm using "1.5" as version. Any idea what could be wrong? Do I have to use use glProgramParameteriARB to set input and output type?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!