Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

How would I load two diffuse maps onto one mesh. I have a mesh with multiple sub meshes but each one of those sub meshes has a vertex buffer and I don't think that's very efficient. How could I have two diffuse maps on one mesh without having to go into 3d modeling software and merge the Uv coordinates of the two objects. I'm using directX and C++.

share|improve this question
    
"I don't think that's very efficient" - have you actually benchmarked this? Until you have hard evidence that it's actually not very efficient, you're indulging in premature optimization. –  Darth Satan yesterday
1  
Why wouldn't you do this in 3D modeling software exactly? That's the normal way of solving this problem. –  JarkkoL yesterday
    
Just wanted to know if there was another way to go about it to minimize vertex buffer switches. –  Andrew Wilson yesterday
    
@AndrewWilson Why do you need to switch vertex buffers? Do the submeshes have different input layouts? –  MooseBoys yesterday
    
@MooseBoys May be out of inexperience. But I thought for each distinct mesh you should have a separate vertex buffer? –  Andrew Wilson 21 hours ago

1 Answer 1

The only way I can even think of accomplishing this would be to add some sort of selector data to the vertex information that would allow a custom shader to select between the two textures to be applied. This technique can be applied with a little custom code to rewrite/combine the two vertex buffers, and of course the custom shader to take the new vertex format and the two textures to be used.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.