• Advertisement
Sign in to follow this  

Multiple textures

This topic is 4736 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What is the general approach to applying multiple textures to a single object? I don't mean simply doing multi-texturing. For example, if you had a character, and wanted to use textures for his clothes. Well, you'd want a set of textures of his shirt, one for his pants, etc. Is the character then broken up into several objects, so the different mixes of textures (combinations of shirts/pants) can be applied? If not, how is this done? Would a texture of the shirt cover the whole body and just use the alpha channel for the parts not covered? This seems kind of wastefull, but I can't think of a better way. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Hm..
You could paint everything in one texture and unwrap the texture coordinates.
Or you could create different textures for everything... it's up to you.

Please explain what you are trying to do.

Share this post


Link to post
Share on other sites
I don't have a specific goal in mind at the moment. Just creating my own simple 3D engine as I learn OpenGL. Implementing as I learn to aid in learning. I'm trying to keep it as flexible as I can, and only allowing a couple texture per object seems... limiting. As a note, I dabbled a bit in 3D graphics before (Maya, 3D Studio Max, Lightwave, etc) so a lot of the time I take what I could do with those and try to do the same thing.

Share this post


Link to post
Share on other sites
have a look at doom3 etc u can see the texture files, i myself do break a model up into various meshes(usually 2-5), each gets a material (not a texture) applied to it, thats mainly cause im lazy though, if u had an artist that can afford to fart around with texture coords they wouldnt break up the model so much

Share this post


Link to post
Share on other sites
I'm having the same problem myself.

My project is make a viz of a cave.
My approach is to pre-render everything in max using Vray with GI lighting, and then throw it onto the VertexBufferObjects in GL.

But! The quality is extremely low for the sectors i made, even tho the texture is 1024^2. My approach here is to attach all objects together, then select a part of it "the sector" and detach. After detaching i render everything.

My previous approach was to use single 'complete map' unwrapped from and object and then wrapped onto in GL. But it looked crap and fellas from #coders told me to use at least separate light-map channel.
But that didnt really solve anything, since diffuse texture was still there and texels were killing the world.

Another chat resulted in a solution that i should use regular textures (as in max) so i can reuse the stored texture pixels in multiple objects. Right, so i wont need to bake the 'complete map' channel. Now i need to attach multiple textures to one sector (one mesh), and then multitexture it with lightmap (or do some fancy light shading stuff..).

So here my problem begins. First of all my script exports only one UV channel and only single meshes. It can be rewritten, but i hate maxscript as much as JS :)
Then i need to switch the binded textures in-flight during rendering. Currently im using plain-ol' glDrawArrays, I tried to test glDrawElements today but dont really understand how this func. works.
Luckily the script exports the matID's for each triangle face, but again its only for one channel.

Here some questions are born : can i say export the UV of the lightmap as channel 3, and regular texturing (diffuse) as chan 1?
How can i change the textures on the fly during mesh rendering? The glDrawArrays does not allow this, and i dont feel like pre-rendering every column, stone and stalagmite in my scene :|

My approach here would be exporting these two UV and matID channels. Making two separate vbo arrays of the UV chans and store the matID's in regular system memory. Shouldnt be too hard to import/export since it doubles the existing function.

The problem here is the mentioned changing textures of VBO's and basically determining which texture is which and loading the world.

My current approach to the world is that i pass a directory to my loading routine, it loads and processes all of the $model.n3d files, and then loads the textures named $model.bmp from /tex.

My idea here would be to keep that for the lightmaps and create a list of textures on paper 1-n with names of the textures and keep to that list while assigning matID's in max. A bit of manual work, but hassle free (at least hassle free with the dreaded maxscript).

Thanks for reading that far, and sorry for lenghty explanation but i wanted to make myself understood :)

Thanks in advance for quick help ;]

Edit : just made a bloggie of my project available here : http://ngine.blogspot.com/

[Edited by - NestorPL on March 3, 2005 2:11:29 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement