PM
To: 'OpenSceneGraph Users'
Subject: Re: [osg-users] array of floats to a shader?
I haven't used an array Uniform before either. In the past I've used a 1D
float texture. If you get this to work, let us know how it goes.
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859
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
...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] 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
Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC wrote:
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...:)
Jason,
Good info...thanks for sharing...
-Shayne
-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jason Daly
Sent: Wednesday, April 08, 2009 3:15 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users
Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC wrote:
I believe I found something...osg::Uniform::setArray(osg::FloatArray
*array)? Hopefully this is correct.
I'm assuming there's something to specify the number of elements?
You can use setNumElements() and setElement(). I haven't used
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jason Daly
Sent: Tuesday, April 07, 2009 12:19 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] array of floats to a shader?
Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC wrote:
I believe I found something...osg::Uniform::setArray
7 matches
Mail list logo