Jump to content
  • Advertisement
Sign in to follow this  
Tiresias

texturing weapons/armors noob question

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

Hi Gurus!

i a total noob in graphics theory so please be indulgent.

I have a question concerning how i shall implement object (weapons and armors to be exact) texturing.

i.e : lest assume we have 2 weapon meshes. There is 10 matters available for those 2 weapons. The UV map for a weapon is the same for any matters.

Shall we:

1- have 2*10 "weapon object resources" (maya or whatever) stored somewhere, one per matter per weapon (so 2 weapons * 10 matters)

2. or shall we texture the weapon in real time in code using its UV map + texture file , in this case we will have 2 weapon meshes, 2*1 UV (one UV mapping per weapon wathever the matter is), and 10 texture files.

If this is 2, what would be pseudo code (independently of the game engine, like pointing out the 3d resources involved for the texturing: weapon mesh, uv and texture)

Thanks , sorry if this doesnt make too much sense.

Share this post


Link to post
Share on other sites
Advertisement

Thanks , sorry if this doesnt make too much sense.

It definitely is challenging to make sense out of it, but i try:


If this is 2, what would be pseudo code (independently of the game engine, like pointing out the 3d resources involved for the texturing: weapon mesh, uv and texture)

It generally goes like this:
* load the vertex data (pos/normal/texcoord/whatever-else) and upload to GPU (vertex/index-buffers).
* load the textures
* load the shaders
... ie, they are separate things (usually, but definitely not always, vertex data contains no "material" data and is hence independent)

To render:
* draw object using the shader / texture / vertex-buf set your particular object needs and draw it.

Sort state per shader first, vertex/index-buf (use one buffer for multiple meshes) and texture next.

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!