[osg-users] Glsl structs and osg::Uniform. How?

Johny Canes catchaller at gmail.com
Thu Jan 26 05:31:30 PST 2017


Knowing mods can combine posts if they get irritated I'm going to follow this up.

The best thing to do here is to use glsl layouts.

It appears Khronos likes to use Thing as well for a hypothetical struct;


Code:
struct Thingy
{
  vec4 an_array[3];
  int foo;
};
layout(location = 2) uniform Thingy some_thingies[6];



Osg comes to the rescue here with a Buffer / Uniform Block feature...

Keywords to look for are UniformBlockBindingList, addBindUniformBlock, BufferIndexBinding

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70055#70055








More information about the osg-users mailing list