Creating a Super Mario World-like Platform Mask in Unity.
by Fabrizio Espindola
Published |
Share
Sprite Masks on 3D Quads? Not quite, but with the power of shaders, you can create a similar effect!
It’s well known that if you want to create a mask for a platform in your 2D game, you can use ‘Sprite Masks.’ However, this approach assumes that your game’s environment is built with Sprites. But, what if your game is created using 3D Quads? Unfortunately, there are no built-in masking options for 3D objects, so you will need to create a custom shader to achieve this effect.
When creating a mask shader for 3D objects, there are a few considerations. For instance, you will need to use vertex position in world space to ensure that the mask consistently follows the character’s position as needed.
Want to try it yourself? A shader package is available for free download under the [CC BY-NC 4.0] license. Get it at the following link!
Get the asset for free!
Click here to check out the full tutorial and subscribe to our newsletter to download the asset!
Shader Graph is great for multi-platform games, but for advanced control and efficiency, learning HLSL and ShaderLab is key. Explore these techniques in depth with the Unity Shaders Bible!