Reputation: 395
We have an app that allows a user to wipe away a top layer image using a "brush" attached to the mouse. The brush can be any type of shape, such as a circle, star, W, or any random bizarre shape.
This is currently implemented in C++ using DirectX9 and shaders (3.0). It is a legacy system and later versions of DirectX are not available. A single channel opacity map accumulates the brush strokes. The opacity map is then used as the alpha layer between the top and bottom images.
The problem is there is a requirement to auto-wipe the rest of the image when a certain percentage of the image has been revealed. For example, if the user has already revealed 60% of the bottom layer, the app would automatically clear the rest of the opacity map to reveal all of it. The problem is trying to figure out how much of the opacity map has been wiped without locking the surface and counting the pixels, as that is really slow.
Upvotes: 0
Views: 58
Reputation: 2434
You could try the following approach:
Upvotes: 1