Mandala Shader

Mandala Shader on the Unity AssetStore

I came up with the idea to create a mandala shader after I made some mandalas from images using photoshop. it is a very simple technique, where I duplicate a layer with the original image, rotate the layer and apply the lighten blend mode to it. by creating multiple layers, you get a mandala.
I figured I could turn this into a shader.

The shader does the same, it first loads the base image into a variable, then rotates the UV coordinates by a given angle and applies the rotated base image to a new variable that represents the finished image.
the shader then outputs the new combined image. You can find the UV rotation code below.

		float2x2 Rotation(float angle) {
			float c = cos(angle);
			float s = sin(angle);
			return float2x2(c, -s, s, c);

		float2 ModifyUV(float2 InputUVs, float InputAngle, float4 ST) {
			float2 pivot = float2(0.5 * ST.x - ST.z, 0.5 * ST.y - ST.w);
			float2 UVs = (InputUVs * ST.xy) - pivot;
			float2 rotPos = mul(UVs, Rotation(InputAngle));
			rotPos += pivot;
			rotPos +=;
			return rotPos;