Alpha and Color Blending Possiblities

Started by
0 comments, last by blaze02 17 years, 8 months ago
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.
-------Harmotion - Free 1v1 top-down shooter!Double Jump StudiosBlog
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.
-------Harmotion - Free 1v1 top-down shooter!Double Jump StudiosBlog

This topic is closed to new replies.

Advertisement