Re: [osg-users] Animating Textures

2015-08-27 Thread sam
Hi Laurens, I created a osg::StateSetCallback that took a osg::TexMat in the ctor and a delay variable. In the operator () I do a check to see if the delay has occurred and then I do a texMax->setMatrix with some incrementing variables. I then attach the callback to the geometries stateset. Thank

Re: [osg-users] Animating Textures

2015-08-26 Thread sam
Nevermind! As always, simply searching OSG popped up what I needed. Thanks! On Wed, Aug 26, 2015 at 3:10 PM, sam wrote: > I can appreciate your stance on going to shaders, and I completely agree. > I'd like to quickly prototype this up and swapping to shaders will, > unfortunately, take me a lit

Re: [osg-users] Animating Textures

2015-08-26 Thread sam
I can appreciate your stance on going to shaders, and I completely agree. I'd like to quickly prototype this up and swapping to shaders will, unfortunately, take me a little bit. Is there an example of modifying the texture matrix? Also would I be better of attaching an update callback to the state

Re: [osg-users] Animating Textures

2015-08-26 Thread Sebastian Messerschmidt
As always I'd suggest shaders, as fixed function pipeline has been deprecated 10 years ago ;-) You could use the osg_SimulationTime uniform to modify the uv-coordinates based on the time passed. Else you will need to modify the texture matrix each frame (like in the suggested callback) Cheers

[osg-users] Animating Textures

2015-08-26 Thread sam
Hi All, I have individual nodes that have textures on them that animate; That's to say the texture moves not the actual mesh. I've been trying to figure out how to accomplish this in OSG. Is there a way to define a texture matrix that does movement? The only other way I can think of is manipulatin

Re: [osg-users] animating textures

2009-04-20 Thread Julia Guo
hi, > I added them just as convenience for quickly visualizing the shape > primitives, without any intention of it being widely used. thats interesting to know. OK I will try to stay away from them until they are refactored. I found that like with lights there is an OpenGL limit on the maxim

Re: [osg-users] animating textures

2009-04-09 Thread Jean-Sébastien Guay
Hi Julia, thanks Skylark! - that would explain the different results Im getting for unit 0 and 1 with a ShapeDrawable. Ive now changed to a model derived from osg::Geometry and the texture animation is working fine. Good to hear! Those ShapeDrawable classes seem limiting ... is there a goal

Re: [osg-users] animating textures

2009-04-09 Thread Robert Osfield
Hi Julia, On Thu, Apr 9, 2009 at 2:17 AM, Julia Guo wrote: > > > Is your drawable a ShapeDrawable? Then you're pretty much out of luck, > > because these only set texture coordinates on unit 0 and don't give you > > access to their internals. > > > thanks Skylark! - that would explain the differ

Re: [osg-users] animating textures

2009-04-08 Thread Julia Guo
> Is your drawable a ShapeDrawable? Then you're pretty much out of luck, > because these only set texture coordinates on unit 0 and don't give you > access to their internals. thanks Skylark! - that would explain the different results Im getting for unit 0 and 1 with a ShapeDrawable. Ive now c

Re: [osg-users] animating textures

2009-04-08 Thread Jean-Sébastien Guay
Hello Julia, Code: geometry->setTexCoordArray(1, geometry->getTexCoordArray(0)); I cant do this because my drawable does not inherit from osg::Geometry, but is something manual like this needed for non-zero textures? Well, there you have it, you need texture coordinates for unit 1 if you

Re: [osg-users] animating textures

2009-04-08 Thread Robert Osfield
Hi Julia, On Wed, Apr 8, 2009 at 2:35 PM, Julia Guo wrote: > hi Robert, > > so if all textures are disabled initially is there any difference between > textures 0 and 1? Because the exact same code works for texture 0 but not > texture 1. > I saw in the archives a snippet ( > http://groups.goog

Re: [osg-users] animating textures

2009-04-08 Thread Julia Guo
hi Robert, so if all textures are disabled initially is there any difference between textures 0 and 1? Because the exact same code works for texture 0 but not texture 1. I saw in the archives a snippet (http://groups.google.com/group/osg-users/browse_thread/thread/616a24590cce9c3) where the te

Re: [osg-users] animating textures

2009-04-08 Thread Robert Osfield
Hi Julia, On Wed, Apr 8, 2009 at 3:57 AM, Julia Guo wrote: > Hi, thanks very much for the advices. > > I now have a basic MultitextureControl example working that fades a single > texture. > However I cant seem to activate texture unit 1. The following example only > shows the texture if I set u

Re: [osg-users] animating textures

2009-04-07 Thread Julia Guo
Hi, thanks very much for the advices. I now have a basic MultitextureControl example working that fades a single texture. However I cant seem to activate texture unit 1. The following example only shows the texture if I set unit to 0: Code: addDrawable(new osg::ShapeDrawable(new osg::Cone()));

Re: [osg-users] animating textures

2009-04-06 Thread Cedric Pinson
Hi Roland, Yes the idea should be to use a UpdateCallback that use easemotion. I will try to make new example with ease motion and stateset callback. I guess that to fade in/out texture, the osgFX::MultitextureControl is ready to use. Cheers, Cedric Roland Smeenk wrote: jguo wrote: I ha

Re: [osg-users] animating textures

2009-04-06 Thread Robert Osfield
Hi Julia, osgFX::MultiTextureControl would be able to do what you want. It uses register combiner extensions to do the blending, but you could use your own fragment shader to control the blending precisely. The other way to do it is use a 3D texture and then vary the r coord. See the osgtexture

Re: [osg-users] animating textures

2009-04-06 Thread Roland Smeenk
jguo wrote: > > I had a look in osgAnimation > (http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01556.html) > but that namespace seems to be just related to geometry. That's not entirely true. osgAnimation can be used to generate animated values. These values will ha

Re: [osg-users] animating textures

2009-04-05 Thread Julia Guo
ah - I should have been more specific with what I meant by animation. I want to fade between two textures so that the previous texture slowly gets weaker while the new texture slowly gets stronger. Can shaders manipulate the texture opacity? (I expect so.) And do you think this is a better appr

Re: [osg-users] animating textures

2009-04-05 Thread Ümit Uzun
Hi Julia, If you mean sliding images in a sequenced order you can look at osgimagesequence example. Or you mean rotating, translating, retexturing in new texture coordinate you can achieve these kind of operation by using fixed openGL functions or you can use GLSL to manipulate texture coordinate

[osg-users] animating textures

2009-04-05 Thread Julia Guo
Hi, I am trying to animate a transition between textures on a surface. I had a look in osgAnimation (http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01556.html) but that namespace seems to be just related to geometry. I found osgFX::MultiTextureControl (http://www.open