Unity Software Inc.

04/29/2024 | Press release | Distributed by Public on 04/29/2024 07:26

Find a treasure trove of lighting and visual effects in our new match-3 sample Gem Hunter Match

2D puzzle/match-3 games are popular because they're cute and colorful, easy and fun to play, and accessible to anyone from almost anywhere.

They can also include beautiful artwork, but with their static camera, repetitive gameplay, and, in many cases, prebaked lighting and shadows, they're not known for bleeding-edge light and visual effects. And yet there are plenty of ways you can add pops of sparkles and glimmer for extra fun.

A Sprite Custom Lit shader is one of the techniques used for creating the visual effects in Gem Hunter Match. This shader substitutes for scene lighting, allowing us to modify the 2D light texture information and control the lighting on each piece. The result is creative illumination of the sprites, like the shimmery effect that moves over the pieces.

The light position data is moved into the shader, eliminating the need for actual light objects in the scene, which also helps to keep it neat. The encapsulated per-object lighting in the shader works well for better isolation and editing at scale and improves performance where batching is possible.