Jump to content
  • Advertisement
Sign in to follow this  
ashade

one vertex, two textures: how do I?

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

I'm learning direct3d9, and i'm trying to make a "3ds view" application, that loads .3ds files and displays it. It's working fine now, I learned a lot, but today I got a very confusing doubt: Imagine you have: two faces, let's say face A (with texture 1 - large texture, high tiling) and face B (with texture 2 - no tiling); one vertex that belongs to the faces A and B; the flexible vertex format used is: struct Vertex { D3DXVECTOR3 position, normal; float u, v; //texture coordinates }; The question: how can the same vertex share the texture coordinates for the two faces to witch it belongs?

Share this post


Link to post
Share on other sites
Advertisement
is there no way to do this without duplicating the vertex? I'm afraid duplicating the vertex can slow down the 3d engine.

Share this post


Link to post
Share on other sites
I just realized there's another solution: take the vertex, set texture 1 active, draw, lock the vertex buffer, change the texture coordinates, unlock the buffer, set texture 2 active and draw again. What is better: this solution or duplicating the vertex???

Share this post


Link to post
Share on other sites
I'd be very surprised if it had a performance impact - vertex processing is very seldom a bottleneck in most engines.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!