This shader is quite different from the ones created before, yet it is relatively short. For this reason, the entire code is provided in the following steps:
- Copy this code to the newly created shader:
shader " Heatmap" { Properties { _HeatTex ("Texture", 2D) = "white" {} } Subshader { Tags {"Queue"="Transparent"} Blend SrcAlpha OneMinusSrcAlpha // Alpha blend Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag struct vertInput { float4 pos : POSITION; }; struct vertOutput { float4 pos : POSITION; fixed3 worldPos : TEXCOORD1; }; vertOutput vert(vertInput input) { vertOutput o; o.pos = mul(UNITY_MATRIX_MVP, input.pos); o.worldPos = mul(_Object2World, input.pos).xyz; return o; } uniform int _Points_Length = 0; uniform ...