Skip to content

Instantly share code, notes, and snippets.

@sneha-belkhale
sneha-belkhale / Fbm.cginc
Last active January 21, 2026 17:06
Fractal Brownian Motion function to include in Unity Shader
float hash (float2 n)
{
return frac(sin(dot(n, float2(123.456789, 987.654321))) * 54321.9876 );
}
float noise(float2 p)
{
float2 i = floor(p);
float2 u = smoothstep(0.0, 1.0, frac(p));
float a = hash(i + float2(0,0));
@yumayanagisawa
yumayanagisawa / warp_shadertoy.shader
Last active August 27, 2021 02:20
Shadertoy to Unity (GLSL to HLSL)
Shader "Custom/warp_shadertoy" {
Properties{
/*
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
*/
}
SubShader{