Jump to content
  • Advertisement
Sign in to follow this  
JoCCo

Information from the Attribute Table

This topic is 4853 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 using the D3DXConcatenateMeshes to add all my worldmeshes into a big worldmesh for lightning computation. But I'm currently having a bit of a problem with the attribute tables. I'm using the effect instances of the meshes to know what effects I should use for diffrent parts of the mesh, but when I add all meshes together (its automaticlly sorted when concating meshes ) the order and number of effects is no longer valid ( some subsets are combined due to the fact that some are just diffrent instances of the same mesh ). Now I can get a new attribute table for the new mesh, and therefor I know how many subsets there are, the problem is that I don't know what effect the diffrent subsets belong to, any idea how I can get that information? I can't get the vertex or face information from the attribute table, but I don't know what vertices I orignally had... So, in summary, I need someway of knowing what materials / effects / textures are bound to a specific attribute ID (subset)...

Share this post


Link to post
Share on other sites
Advertisement
Here's what I'd do: before you add all your meshes to the world mesh, set each object's entire attribute buffer to a certain index. That number indexes into an array of effect instances. When the meshes are sorted, the attribute buffer should automatically get sorted too, and you can just look up the correct effect in the effect instance buffer.

BTW, I'm just curious: why do you need to know which effects to use if you're just calculating lighting stuff? Are you trying to take into account the different materials' attributes?

N'eways, good luck!

Share this post


Link to post
Share on other sites
I thought of doing something like that, but wouldn't there be a problem with the subsets that are concated, i.e. the parts of the mesh that are small and use the same effects ( have identical attributes )? I'm currently doing something similar to what you described but it dosen't work ( could be I'm doing it wrong ).

I'm using the effect instances to diffrentiate between material effects and the alike, so thats why I need them, the lightning part of the effects are identical across all subsets...

[EDIT] Oh, I just realised what you meant by that last part of the message, I don't need the effect information to calculate light, but after I have calculated light I need it to render the worldmesh correctly (i.e. it's materials). And the Mesh i'm creating will in the future by my worldmesh, so it need the correct information.
[/EDIT]

[Edited by - JoCCo on August 8, 2005 11:22:23 AM]

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!