Hi!

I've written plenty of #version 330 core GLSL shaders I'd like to reuse along 
with the OSG 3.2.0 framework, and try to figure out how to get the state from 
the OSG I need to pass in by uniforms, and how to set them without having to 
change well-tested shader code, as well as how to populate arbitrarily named 
attributes.

Some example give rise to a notion of aliasing certain attribute and uniform 
names to "osg_", but I'd like to use arbitrary names for the uniforms,


Code:
uniform mat4 uMVMatrix;
/*...*/


and to refer, or let the OSG refer, to the attributes by their numbers only, so 
sth like this


Code:
/*...*/
layout(location = 0) in vec4 aPosition;
layout(location = 1) in vec3 aNormal;
layout(location = 2) in vec2 aST;


as used in my legacy shaders, I'd like the OSG framework to populate with the 
vbo it already maintains for the "Drawables", or, at least, use an API call and 
do it myself.

I addition, I'd like to populate uniforms for lights and shawdowmaps by means 
of the scenegraph and the visitors; "somewhere" and "somehow" in the SG there 
must be light and esp shadow information be aggregated for default shading, so 
I'd like simply like to use this data and tailor it to fit to my custom shaders.

So the fundamental question is

How to populate arbitrary GLSL 330 shaders with data from within OSG without 
having to resent to redundant uniform assignment - providing my "u[..]Matrix" 
manually in addition to the "osg_[...]" uniform set by OSG - or changing 
attribute names in the shader sources?

With kind regards,
S.

P.S.: !0 days ago I asked this at Stack Overflow¹ (SO) but, despite  even 
offering a "bounty"  (a SO feature) I received no answer yet, and have 
requested to close the thread there, so I don't. think cross-posting oddities 
are to expected.

¹my first post, I'm not allowed to post links yet here

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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to