Sign in to follow this  

Two or more textures on one 3D mesh?!

This topic is 3487 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

Hello, I liked to map different texture images onto one 3D mesh. But not like blending.. eg you have an 3d quad and six images. Each image should be mapped onto one side. Is there a possibility to do this? Thanks!

Share this post


Link to post
Share on other sites
In my engine, I separate anything that needs a different texture to it's own mesh. I just had to give the 3D designers the rule of not using per-face materials.

It's pretty straightforward to achieve in immediate mode, but once I started adding vertex arrays it got messy, so I reverted to simplicity.

Share this post


Link to post
Share on other sites
You mean cube, not quad. You'll have to either use separate corner vertices for each side (for a total of 24), or make six separate draw calls. In general, one material = one mesh.

Share this post


Link to post
Share on other sites
Actual meshes and draw calls are 2 different things. I let all my level parts have a different material per face and it's not a problem. I just make a new vertex array for each material and add faces into it when it has that material. So when it was time to render the level, it was just a matter of looping through each array and render it. Then again, my level was a collection of static meshes, so I didn't have to worry about any funny situations. It didn't matter that each array was a bunch of random triangles.

Share this post


Link to post
Share on other sites
Thanks for the answers. @Tom, thats right :)

So, it is a possibility to stitch all texture images together and gave each vertex the u/v coordinate. That would be the easiest way for me..

Share this post


Link to post
Share on other sites
Quote:
o, it is a possibility to stitch all texture images together and gave each vertex the u/v coordinate. That would be the easiest way for me..


Yes, of course it is possible. Use a image editor to stitch them together.
In whatever 3D modelling program you use, Blender or SoftImage or 3D Studio Max or Maya, apply the the texture to your object and adjust the texture coordinates.

You could of course calculate the texcoords in your program if you want but it is better to model things using a modelling program and load it in your program.

Share this post


Link to post
Share on other sites
Than I'm going to do that. But I will do it automatically in my program. I also compute the texture coordinates, so there is no problem with that.

Thanks!

Share this post


Link to post
Share on other sites

This topic is 3487 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this