cruelcore1
cruelcore1

Reputation: 578

How do I apply different textures to multiple primitives? (Direct3D 9)

I am creating a game in which every primitive needs its own texture, but I can't seem to figure out how. I searched through Google but it only displays results about texture blending. Can you please tell me how to apply multiple textures on multiple non-indexed primitives? Or do they have to be indexed?

Upvotes: 0

Views: 223

Answers (2)

Dish
Dish

Reputation: 509

You can change textures by calling SetTexture before each of DrawPrimitives.

Upvotes: 1

cdoubleplusgood
cdoubleplusgood

Reputation: 1379

I think using an UV atlas can solve your problem. An atlas is basically a large texture made up of smaller textures, like a photo collage. The UV coordinates of your vertices of course refer to the large texture, but if you know the position of your "small" textures, this is easy to calculate.
Of course you have to create that atlas texture first.

Upvotes: 0

Related Questions