Hi Julia,
On Wed, Apr 8, 2009 at 3:57 AM, Julia Guo <[email protected]> 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 unit to 0:
>
> Code:
> addDrawable(new osg::ShapeDrawable(new osg::Cone()));
> texture = new osg::Texture2D;
> texture->setImage(osgDB::readImageFile("brick1.TGA"));
> int unit = 1; // works fine when unit=0
> getOrCreateStateSet()->setTextureAttributeAndModes(unit, texture);
>
This doesn't really provide enough info about your overall texture set to
know whether it's appropriate. Most likely the problems you are seeing are
related to not setting up the scene graph appropriately, but as to what you
are doing wrong I can't say.
> Like lights, is only texture 0 activated by default? Am I missing something
> to activate the texture?
>
All textures are off by default, you have to explicitly enable them all.
> > The other way to do it is use a 3D texture and then vary the r coord.
> See the osgtexture3D example for an example of this.
> >
>
> hi Robert: is there an advantage to this technique or has it been obsoleted
> by MultitextureControl?
>
It's just a different way of doing it, there are pros and cons of both
ways. The OSG/OpenGL are just the basic language that you the programmer
use to construct your graphics app, how you use it depends upon what you are
trying to achieve.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org