Skip to content

Instantly share code, notes, and snippets.

@zephyo
zephyo / TMP_SDF_Billboard.shader
Last active November 19, 2025 12:32
Unity 6 TextMeshPro Billboard / always facing camera shader / Modified for Unity 6 and transform scaling
// 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!
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" {}