Skill effects in 2D games

xiaoxiao2021-03-06  46

In our 2D graphic game, you can not lack a lot of light and shadow, skill effects, and the implementation of the magic effect in Diablo II. Fortunately, we have a powerful CPU to achieve Alpha mixed and color saturation, let us discuss it. How to use these methods to implement the skills special effects needed in our game. First, Alpha mixed special effects

Alpha mix allows us to mix an image with another image with another image (Figure 1), but ordinary alpha mixes and is not suitable for display in the game, at this time Just add some data to make the mix more accurate, in order to achieve this effect, we will add Alpha channel data into the image (Figure 2), then we can get a mixing effect of Figure 3 according to the channel data. Now it seems to be more like effect. :)

However, the problem is always there, as long as it is carefully observed, it is not difficult to find that there is a black shadow around the effects in Figure 3, which seems to add a little defect to our skills, why? Because our program is based on the channel data on the image, different levels of Alpha hybrid, but in fact the RGB color value is closer to black (R = 0, g = 0, b = 0), once this After mixing, there will be black sides, but you can rest assured that we can use a simple skill to avoid the production of black edges, that is, the RGB color map in Figure 2 is filled with gray background, so after mixing There is no black side, at least it doesn't seem to be obvious, there is no last rendering, the final effect is still implemented by your own program.

Figure 1 Common Outline Alpha Mix Figure 2 Figure 3Alpha Channel Mixed Recommodation Figure 4 Effect of Color Saturation

转载请注明原文地址:https://www.9cbs.com/read-53439.html

New Post(0)