Sure,
Here is one example from the tutorial above. Again, the issue is the fact that in his tutorial the “intensity” and location of the points is randomized. With my grid its laid out in a uniform way so its making the whole thing look like its perfectly symetrical.
I posted the code for the shader below. I believe what its doing, is for each pixel its looping through each data point and getting the radius + intensity and then adding it to the “h” value to determine what color to make the texture.
In the shader code you can see there is a “dist” calculation that is essentially calculating, for each pixel, the distance to these points, which is making everything be circular, if that makes sense. Picture a circle of a “dist” radius around each item in the _Point array so when it checks each pixel the distance within that radius is always close enough to make it a color.
There is also a c# sharp script where I am passing the array values with radius, location, and intensity of each point. So you can see in this image the more intense items are in the center and I pass in less intensity in the surrounding grid tiles.

// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// Alan Zucconi
// www.alanzucconi.com
Shader "Hidden/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 = UnityObjectToClipPos(input.pos);
o.worldPos = mul(unity_ObjectToWorld, input.pos).xyz;
return o;
}
float random (float2 uv)
{
return frac(sin(dot(uv,float2(12.9898,78.233)))*43758.5453123);
}
uniform int _Points_Length = 0;
uniform float4 _Points[1000]; // (x, y, z) = position
uniform float4 _Properties[1000]; // x = radius, y = intensity
sampler2D _HeatTex;
half4 frag(vertOutput output) : COLOR{
// Loops over all the points
half h = 0;
for (int i = 0; i < _Points_Length; i++)
{
// Calculates the contribution of each point
half di = distance(output.worldPos, _Points[i].xyz);
//half di_y = distance(output.worldPos.y, _Points[i].y);
//half di_x = distance(output.worldPos.x, _Points[i].x);
half ri = _Properties[i].x;
half hi = 1 - saturate(di / ri);
h += hi * _Properties[i].y;
//h += hi * (_Properties[i].y / 5);
}
// Converts (0-1) according to the heat texture
h = saturate(h);
half4 color = tex2D(_HeatTex, fixed2(h, 0.5f));
return color;
}
ENDCG
}
}
Fallback "Diffuse"
}
I also tried another method just placing planes of different colors at each data point but the problem is there is no gradient transition between them. It’s just large squares of different colors all over the place.
Would you happen to have a link or example to how I could accomplish this with a vertex attributes or texture as you described above?
I’d love to get away from needing to pass this array (_Points in above script) in of tens of thousands of data points and have the shader have to loop through them all. It doesnt seem very efficient.