Sign in to follow this  

A simple D3DXSplitMesh() question

This topic is 2843 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 all, Currently I'm working on my deferred renderer and I have a question, please help. I added frustum culling feature for static (I'm not sure this word can explain, but I mean "non-animated") meshes and it works well for small ones (e.g. cars, human/monster models etc). But for "big" ones (e.g. large buildings, terrains etc), I split'em into several meshes and compute bounding volumes, then perform frustum culling for each and this works nice, too. Now, the question comes: I know each piece is made up of 1 subset (/w num. 0). While rendering, you know I've to pass some material/texture data to the shader. But I don't know how to determine the subset that each piece belongs to. So, I don't know which material/texture I must pass for a piece. Can you help me with this? Regards. Rohat.

Share this post


Link to post
Share on other sites
First, I've never used D3DXSplitMesh before. However, the docs provide clues about the data you'll have available when you do the split.

It appears you'll have to use the face remap array from the D3DXMeshSplit call and lookup the attribute (subset) for each face you don't cull in the attribute buffer.

That is, you'll have to keep track of which face (or set of faces) you run your cull test on, determine the face in the original mesh that corresponds to, and use the attribute in the original mesh's attribute buffer.

It may be easiest to build a table of new-mesh-face to old-mesh-attribute for each new mesh and use that for lookup.

[Edited by - Buckeye on March 1, 2010 10:51:14 AM]

Share this post


Link to post
Share on other sites

This topic is 2843 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this