Hej Hylke !

> > > Is it possible for a sinle face to have materials, while all the other
> > > materials don't?
> >While all the other _faces_ don't, you mean ?
> >If you look into player.c, you see that every face might introduce a
> >material change.
> Yeah, that's what I meant. Sorry, I should have reread my e-mail before
> sending :-)
Nono, it's ok - I was just a bit cranky that day, didn't use a lot of
smileys :-)

> >For efficient representation in a VBO, you would need to group all the
> >faces/triangles that have a common material, and upload them at once.
> But let's say, you have a model which is a charachter(-> human or whatever),
> who consists of multiple textures(8 or so), one for the skin, one for the
> head, one for the suit and so on.
> Wouldn't it be faster to just create one big texture, and adjust the texture
> coordinates to match the right texture? Because OpenGL 2.0 now supports
> non-power of 2 textures, so I could make one big texture, with each texture
> to the right of the other.
Sure, you can do that, and that's what e.g. Cal3D ( cal3d.sf.net )
uses for its models -
it is just a tradeoff between having to touch the texture coordinates on
the CPU (repositioning all the coordinates), and doing a texture switch, which
is not that expensive anymore, I think.

> >Besides, materials as an OpenGL concept are obsolete by now anyways, so
> >when you already use VBOs, you might want to switch to shaders, too. That
> >way, you could provide material parameters as an extra data channel, and
> >thus upload all parameters at once.
> I've read the first couple of chapters of my OpenGL orange
> book(unfortuneatly I don't have time to read it any further now :'( ), but I
> don't see how this can help me with my material applying(I don't completly
> understand the last sentence).
Forget what I wrote before; that was an assumption from Cg (a
near-to-obsolete shader programming language), where material properties
where not accessible from inside the shader.

Material properties basically boil down to diffuse and specular color
calculations in the vertex shader.
For more advanced material properties, like anisotropic specular
effects, you will need to upload more parameters than the "classic
material properties". That is done with so called uniform variables.

So, to keep things consistent, and not to mix the old-fashioned
OpenGL material properties with some extra uniform variables, one could
represent all the material setup with uniform variables, and switch shader
after the material property that the current 3DS material imposes.

Heck, it would even be possible to specify _a shader file_ as a file name,
making arbitrary material shading possible (see CgFX), but I am
disgressing, and probably pushing the good ol' 3DS format a bit too far ;)
( COLLADA can handle such things, much more modern solution ).

> Looks cool, but it's not explained very well in the presentation(the
> functions are giving the idea that it's only for non-changing objects, while
> in the begining they say you can change color and matrix transformations).
Well, basically, while some of the data channel are re-read repeatedly,
others only increase once for every iteration. That is how some data
channels can hold instance-specific data like transformation or color
changes.

I had been writing up my previous mail in a bit of a hurry, so my ideas
were not that well-carved - but that topic is interesting to me, so dont
hesitate to bring new things up once in a while :-)

Servus,
  Gernot

-- 
T----------------------------W-E-L-C-O-M-E------------------------------T
O  The Austria <=> Sweden <=> Germany <=> Netherlands connection.....   H
|  http://www.mpi-sb.mpg.de/~gziegler | http://www.lysator.liu.se/~gz   E
\-----------------------------F-U-T-U-R-E-------------------------------/


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
lib3ds-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lib3ds-devel

Reply via email to