Jump to content
  • Advertisement
Sign in to follow this  
Nocturnus

Shading two different parts. Same model.

This topic is 3577 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 Maya to export my current set of models out to the .x format. What I want to know is if it's possible using DirectX coding to use two different shader effects on the same model. For example. I have a ball with a large pair of eyes. If I want only the eyes to have a pure white cel-shading effect on them and the ball to use another effect. Is it possible to achieve this through coding and using the same .x model file. Comments or links to tutorials would help greatly. (If this can be done) THANKS!

Share this post


Link to post
Share on other sites
Advertisement
Yes, its absolutely possible to handle this case.

What you'll find is that the Maya exporter will (or at least should!) group geometry according to the material it uses. In the simple ID3DXMesh case you'll get a single mesh but multiple subsets.

From the PoV of the hardware you can only have one shader configuration active at a time so you'll have to render each subset seperately and reconfigure the pipeline in between draw calls.

hth
Jack

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!