This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // modified from https://gist.github.com/Spongert/b52a24aa110933a918cf47c777fea1c8 | |
| // Unity 6 TMP changed some things; adapt the shader for U6. Plus allow scale of transform to affect it. | |
| // See https://discussions.unity.com/t/upgraded-to-6000-0-and-my-custom-tmp-urp-shader-rendered-failed/947435 | |
| // And https://discussions.unity.com/t/billboard-shader-that-respects-gameobjects-transform-localscale/652220/4 | |
| Shader "TextMeshPro/Distance Field-BillboardFacing" { | |
| // Billboarding version for TextMeshPro (tested in 2018.3), based on default Distance Field shader. | |
| // ** Important part is to DISABLE the dynamic batching! (happens in this shader) ** | |
| // ...Took a while to figure out that one. | |
| // | |
| // Use as you like! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shader "Custom/WorldSpaceExample" | |
| { | |
| Properties | |
| { | |
| [Toggle(ENABLE_DEBUG)] | |
| _Lighting ("Enable Debug", Float) = 1 | |
| _MainTex("Diffuse", 2D) = "white" {} | |
| _MaskTex("Mask", 2D) = "white" {} | |
| _NormalMap("Normal Map", 2D) = "bump" {} |