Blending Mode and Pixel Test

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
Richard L.
Posts: 2
Joined: Thu Jun 02, 2005 9:05 am
Location: Puget Sound, WA

Blending Mode and Pixel Test

Post by Richard L. »

Image

Let's say I have a circular mask and a rectangle as shown in the picture above. I'm looking for a blending mode and pixel test mode that would allow me to render both the mask and the rectangle so that only the area of the rectangle covered by the mask is shown. I'm fairly new at this, so I would appreciate any suggestions.
TheBrooster
Posts: 16
Joined: Wed Jun 01, 2005 8:55 am

Dest Alpha test

Post by TheBrooster »

You could render the MASK into the alpha channel then render the rectange using dest alpha test. I am not sure if this is supported within any of the homebrew libs, but it shouldn't been too hard to do.

Draw order becomes an issue when you do this as to get the correct result you should really start with a blank alpha channel, write the MASK in then the rectange. If there is stuff in the alpha channel already you may have to clear it, which in itself may provide its own issues.
TheBrooster
Posts: 16
Joined: Wed Jun 01, 2005 8:55 am

Post by TheBrooster »

Or you could achieve the same effect by using Z, may be easier.
Richard L.
Posts: 2
Joined: Thu Jun 02, 2005 9:05 am
Location: Puget Sound, WA

Post by Richard L. »

Thanks for the replies. I will give it a shot.
TheBrooster
Posts: 16
Joined: Wed Jun 01, 2005 8:55 am

Post by TheBrooster »

No worries. Post back here with your results - I would be curious to see how you get on.
Post Reply