Jump to content
  • Advertisement
Sign in to follow this  
blaze02

Alpha and Color Blending Possiblities

This topic is 4455 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 had a great idea, but had somehow got confused as to the possibilities with blending. I wanted to "clear" a texture to 127 (half color), then render a type of bump map to the texture such that the "color" will either go down or up from 127. And if 2 bump maps are rendered on top of each other, the maps will blend together on the texture. Then I was going to take the texture and apply it to something else for the actual rendering. Anyways, I was planning to use the texture operation (D3DTOP_ADDSIGNED) to achieve somewhat of this smoother blending. The problem is that the dest/src blending does not allow this type of blending, its only for textures. So now to the real question: the D3DBLENDOP only supports a few types of blending. Adding, subtracting (both directions), min and max. Does subtraction wrap or clamp the final color? I'm guessing its vid. card defined and I'm out of luck. But it never hurts to ask. Anyone know? Thanks for any help or suggestions.

Share this post


Link to post
Share on other sites
Advertisement
I came up with a work-around... and I like it better than the original.

I had an extra color channel to work with, so I store the number of renders to that pixel by setting the channel to one. So when the color gets blended, the value goes up by one. Now instead of doing a singed add or subtract, I'll just add up the total, and divide by the number of renders. Thus, I get an average which is what I was looking for in the first place.
If there are a bunch of renders to one pixel, it is possible to get some clamping problems, but I'm not going to be overlapping enough for that.

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!