Yes, on the shader side, the float array is declared as

uniform float altitudes[10];

The array size itself is just passed in as another uniform int.

Thanks for bringing that up. I had forgotten to include the shader side of
things...:)

-Shayne

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Jean-Sébastien Guay
Sent: Wednesday, April 08, 2009 1:25 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] array of floats to a shader?

Hi Shayne,

> I was successful in getting a floating point array uniform going for my
> shader. At Paul's request, here's what I did...
> 
> In the shader setup code:
[...]
> In the update callback:

And what about the shader itself? How do you access it from there? Is it 
as simple as

float altitudes[10];

? What about the array size? Do you pass another uniform for that?

J-S
-- 
______________________________________________________
Jean-Sebastien Guay    [email protected]
                                http://www.cm-labs.com/
                         http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

Reply via email to