one vertex, two textures: how do I?
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?
is there no way to do this without duplicating the vertex? I'm afraid duplicating the vertex can slow down the 3d engine.
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???
I'd be very surprised if it had a performance impact - vertex processing is very seldom a bottleneck in most engines.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement