Today I decided to implement a nice little effect I often notice in games, which is that sort of dithering pattern that is gradually replacing transparency in new games. For example, Mario Odissey exclusively use it throughout the game.
The reasons for its use are mainly to be found in performance, as the dithering pattern drastically reduces the overdraw, and also for its support of deferred rendering. Personally, I even find it more pleasing to the eye than transparency in some situations (i.e. an object disappearing with camera occlusion).
I implemented it by sampling a dither texture, and tiling sections of it across the screen, depending on the alpha value. For the alpha, I added an alpha attribute to the shaders, as well as finally adding support for opacity textures, which I somehow had never done before.
In the picture you can see:
- proper opacity support for the leaves, with some dithering effect around the edges
- the dithering pattern, which I increased with depth just for the sake of this picture, while normally it uses alpha

Nessun commento:
Posta un commento