Jump to content
  • Advertisement
Sign in to follow this  
rcz

Object Color modulation

This topic is 4839 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 have some complex objects I'd like to color, where complex means lots of verticies. To save memory, I'd like to have just Pos formatted vertex lists (rather that PosDiffuse verts). This is also because the Clr part of every vert would be the same, ie. I'd like these to be flatly colored. But, I'd like to draw several of these 'complex' objects, each with an overall color. Ideally.. D3DDev->SetTextureStageState ( D3DTSS_COLOROP, D3DTA_SELECTARG1); D3DDev->SetTextureStageState ( D3DTSS_COLORARG1, D3DTA_CONSTANT ); D3DDev->SetTextureStageState ( D3DTSS_CONSTANT, overall_object_clr ); ..draw vertex buffer.. I'd like to also be able to do this with textured objects as well, which would basically apply an overall "coloring" to the textured object, as in: D3DDev->SetTextureStageState ( D3DTSS_COLOROP, D3DTA_MODULATE); D3DDev->SetTextureStageState ( D3DTSS_COLORARG1, D3DTA_TEXTURE ); D3DDev->SetTextureStageState ( D3DTSS_COLORARG2, D3DTA_CONSTANT ); D3DDev->SetTextureStageState ( D3DTSS_CONSTANT, overall_object_clr ); Unfortunately, it seems my hardware (Raedon 9600, not an old card) doesn't support D3DTA_CONSTANT (other posts suggest few cards do). It seems the only alternative is to make my vertex buffers PosDiffuse, and assign the object color to every vertex each time a different color is used. But this is a waste of CPU time. Is there any other way to do overall object color modulation? -rcz

Share this post


Link to post
Share on other sites
Advertisement
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!