Skip to main content
GameDev.net gamedev.net
🔒 Locked

Blending Mask?

Started by Funkymunky Jun 1, 2003 at 12:36 PM 0 replies 350+ views
Original Post
Funkymunky
Funkymunky
Hey, I don''t really understand the way directx alpha blending calls take effect, and I think that''s the answer to my question, but here goes: Say I have a full screen texture. This texture has different sections of color, like a big black floor and then blobs of green and white in the sky. These are solid colors, mind you. How can I draw a texture on one color alone? By this I mean I could have a dirt texture that I draw only on the black part, and then two other textures which correspond to the white and green. And this needs to be done fast, otherwise I would just copy pixel for pixel and save a big texture. Any Help?
SoaringTortoise
SoaringTortoise
I think you''ve got it very wrong. The purpose of the alpha blending is to allow you to render a texture with transparent bits in it. I think that you could use multiple masks to achieve what you''re after, but the end result would be painful to produce. Think of it like a good old pen & paper stencil. You''d have to create alpha masks for every ''layer'' in your scene, and then flood-fill the entire scene with a texture, mask out the bits that you want to keep and render the next texture, add the mask for that layer to the previous mask and render the next texture... etc.

Pretty nasty. It''s not too clear from your post what you''re trying to achieve, but you may want to consider going for depth-sorted tiling or scenery chunks instead. This way you''d create the green grass with an alpha mask contained within it, and then just render the grass texture with alpha blending enabled.

Using color-keyed fills (which is what I think you''re wanting to do), isn''t really going to work purely by an alpha test. You may be able to get something going using pixel shaders, but... wow, that''s a serious investment in technology for a relatively simplistic effect.
Always prey on the weak, the timid and the stupid. Otherwise you'll just get your butt kicked
For a tortoise, this is extremely hard to do, but when you get it right... the expression on their faces ...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.