Skip to main content

Timeline for glGetUniformLocation Returns -1

Current License: CC BY-SA 3.0

8 events
when toggle format what by license comment
Jan 8, 2014 at 18:53 comment added Shadow Although the geometry shaders may cause a performance hit, the RAM I saved was well worth the hit. I believe my test project showed little to no fps drop from switching, but the RAM usage dropped from ~1GB to ~600MB. (Just as a side note, switching to using a geometry shader in my shader program was not the only optimization I made)
Jan 8, 2014 at 18:52 comment added Shadow Pretty much the only reason I want to use a geometry shader is because I've been experimenting with using voxels, and RAM is usually an issue for me, as I try to load as many voxels as I can. I originally used just a vertex shader and fragment shader for rendering, and stored each vertex, but that used up tons of RAM. I began using geometry shaders because of that, so that I could simply store a single point and a number corresponding to which side should be rendered from the point.
Jan 8, 2014 at 17:34 comment added Andon M. Coleman @Shadow: I had not even noticed the naming issues with your interface blocks. I feel silly now, as that is usually the first place I look when there is a GS issue. Regarding my earlier comment about GS performance, it is not usually a huge hit but generally if you are using a GS because you think that emitting 4-6 vertices from 1 point is going to improve vertex performance you will wind up with a small performance penalty in the end. Often people discover this when they implement omni-shadows with a GS, thinking that 1 draw call will magically be quicker than 6 to draw into a cube map.
Jan 8, 2014 at 6:36 vote accept Shadow
Jan 8, 2014 at 6:34 comment added Shadow Thank you VERY much for that explanation! Although I partially understood how active uniforms were determined before, your post really clarified it. Also, thanks to your post, I took a better look at my shaders inputs & outputs and found why it wasn't working! Take a closer look at the names of the output from the geometry shader: out FragmentData and the input from the fragment shader: in FragData After renaming those two structs to the same name, I get a valid uniform location back.
Jan 8, 2014 at 1:50 history edited Andon M. Coleman CC BY-SA 3.0
added 17 characters in body
Jan 8, 2014 at 1:33 history edited Andon M. Coleman CC BY-SA 3.0
added 329 characters in body
Jan 8, 2014 at 1:26 history answered Andon M. Coleman CC BY-SA 3.0