Re: [osg-users] Using different textures for the same geometry

2008-10-10 Thread Tomlinson, Gordon
The normal way to do this, is that you need to break the model in to component 
pieces and have a geode for each piece you want to apply a different texture to 
using the standard OSG state mechanism and you also have ensure you have the 
correct texture coordinates etc.

Trying to have one lump of geometry and then trying to figure out how to apply 
a different texture to a certain pixel say in a shader is not the way I would 
go about it,



Gordon

__
Gordon Tomlinson

Product Manager 3D
Email  : gtomlinson @ overwatch.textron.com
__

Self defence is not a function of learning tricks 
but is a function of how quickly and intensely one 
can arouse one's instinct for survival 
- Master Tambo Tetsura

 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of GMD 
GammerMaxyandex.ru
Sent: Friday, October 10, 2008 6:53 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Using different textures for the same geometry

Shaders...

 
 Hi Robert,
 
 Thank you very much for your reply.
 
 I have a single geometry and I want to apply different textures for 
 it. That is, imagine a figure of a woman which is a single geometry. 
 However, I have a texture for the head, another one for the body, 
 another one for the shirt, etc... Do you understand? Sorry if I 
 explained it badly, but I am not good explaining things and even worse 
 in english :)
 
 Thanks a lot for your reply Robert,
 
 Regards,
 
 Aitor


Яндекс.Почта. Поищите спам где-нибудь еще http://mail.yandex.ru/nospam 
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Using different textures for the same geometry

2008-10-10 Thread Robert Osfield
Hi Aitor,

The most efficient way to render such a character is to use a texture
atlas and have the texcoords on the geometry pick out the appropriate
parts of the character.

A decent modelling problem should be able to do the texture
atalas/geometry generation for you.  Doing it as a post process is
possible but is rather awkward.

Robert.

On Fri, Oct 10, 2008 at 11:35 AM, Aitor Arrieta [EMAIL PROTECTED] wrote:
 Hi Robert,

 Thank you very much for your reply.

 I have a single geometry and I want to apply different textures for it. That
 is, imagine a figure of a woman which is a single geometry. However, I have
 a texture for the head, another one for the body, another one for the shirt,
 etc... Do you understand? Sorry if I explained it badly, but I am not good
 explaining things and even worse in english :)

 Thanks a lot for your reply Robert,

 Regards,

 Aitor

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Using different textures for the same geometry

2008-10-10 Thread GMD GammerMaxyandex.ru
Shaders...

 
 Hi Robert,
 
 Thank you very much for your reply.
 
 I have a single geometry and I want to apply different textures for it. That 
 is, imagine a figure of a woman which is a single geometry. However, I have a 
 texture for the head, another one for the body, another one for the shirt, 
 etc... Do you understand? Sorry if I explained it badly, but I am not good 
 explaining things and even worse in english :)
 
 Thanks a lot for your reply Robert,
 
 Regards,
 
 Aitor


Яндекс.Почта. Поищите спам где-нибудь еще http://mail.yandex.ru/nospam 
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Using different textures for the same geometry

2008-10-10 Thread Aitor Arrieta
Hi Robert,

Thank you very much for your reply.

I have a single geometry and I want to apply different textures for it. That
is, imagine a figure of a woman which is a single geometry. However, I have
a texture for the head, another one for the body, another one for the shirt,
etc... Do you understand? Sorry if I explained it badly, but I am not good
explaining things and even worse in english :)

Thanks a lot for your reply Robert,

Regards,

Aitor
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Using different textures for the same geometry

2008-10-10 Thread Aitor Arrieta
Hi Paul

Thank you very much for your reply.

I think it will be easier to take the solution #2. For our application, the
only restriction we have is that we must use a single vertex array. But if
you say that this is possible to do even when using different geometries, I
will investigate more about this option.

Thanks a lot Paul

Regards,

Aitor
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Using different textures for the same geometry

2008-10-09 Thread Robert Osfield
Hi Aitor,

Do you want to render your geometry with both textures at the same
time and using multi-texturing or have two different variants of your
geometry, one with each texture?

Robert.

On Thu, Oct 9, 2008 at 4:57 PM, Aitor Arrieta [EMAIL PROTECTED] wrote:
 Hi all

 First of all, this is my first time writing here so sorry if I do something
 wrong...

 Here is my question. I have an obj file, which I have exported from Poser. I
 have modified this file in order to have only one geometry, that is, there
 is only one osg::node. This new file works fine in my application and I can
 see the figure with no problems. However, the problem comes when I try to
 apply the original textures to this figure, because I have more than one
 image files for the single osg::Node.

 As far as I know, there could be two different solutions for this problem:

 1- Create a single texture combining all the textures I have and then apply
 it to the node
 2- Apply a different texture to each vertex group

 For the first one, I have googled for some days and I am not able to find a
 program which can do it.
 For the second one, I know which vertex should be with any of the different
 textures, but I do not know the way to do it from c++ using the osg
 libraries.

 Can anyone please help me? I know that my explanation was not very good so
 if you need further information just ask for it.

 Thank you very much in advance.

 Regards,

 Aitor

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Using different textures for the same geometry

2008-10-09 Thread Paul Martz
For solution #1, just create a single image file containing both textures,
then go back into your modeling software and set the texture coordinates so
that they index into the appropriate portion of the new combined image. You
might also take a look at the osgUtil::Optimizer, which has an option to
create a texture atlas.
 
For solution #2, you should have a single osg::Geode with two osg::Geometry
objects added to it. The two Geometry objects can share the same vertex
array, if that makes things easier. Each Geometry has its own StateSet, so
each can have its own texture.
 
I hope that helps.
   -Paul
 


  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Aitor
Arrieta
Sent: Thursday, October 09, 2008 9:57 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Using different textures for the same geometry


Hi all

First of all, this is my first time writing here so sorry if I do something
wrong...

Here is my question. I have an obj file, which I have exported from Poser. I
have modified this file in order to have only one geometry, that is, there
is only one osg::node. This new file works fine in my application and I can
see the figure with no problems. However, the problem comes when I try to
apply the original textures to this figure, because I have more than one
image files for the single osg::Node.

As far as I know, there could be two different solutions for this problem:

1- Create a single texture combining all the textures I have and then apply
it to the node
2- Apply a different texture to each vertex group

For the first one, I have googled for some days and I am not able to find a
program which can do it.
For the second one, I know which vertex should be with any of the different
textures, but I do not know the way to do it from c++ using the osg
libraries.

Can anyone please help me? I know that my explanation was not very good so
if you need further information just ask for it.

Thank you very much in advance.

Regards,

Aitor


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org