One graph, four runtimes
Export paired .glsl + .vert files for WebGL 2 and Three.js,
mainImage for Shadertoy, or native .gdshader for Godot 4
from the Blender Shader Editor sidebar.
Compile one material graph in Blender into standalone, readable shader code for WebGL 2, Three.js, Shadertoy, and Godot 4 — without runtime wrappers or hand-porting.
Every preset below was serialized from a Blender node graph and compiled directly
by NodeRelay. Inspect all four targets or drop your own exported .glsl
file onto the canvas.
#version 300 es
// Transpiled with NodeRelay
precision highp float;
in vec2 vUv; in vec3 vWorldPosition; in vec3 vNormal; in vec3 vTangent; in vec4 vColor; in vec3 vObjectPosition; in vec3 vObjectNormal;
uniform vec3 uCameraPosition;
out vec4 fragColor;
uniform vec3 uLightColor; // directional light color * intensity
const vec3 SCENE_LIGHT_DIR = vec3(0.5, -0.8, 1.0); // direction toward light source (Blender Z-up space)
const vec3 SCENE_AMBIENT = vec3(0.15); // ambient light level
vec3 scene_light_dir() { return normalize(SCENE_LIGHT_DIR); }
vec3 scene_light_color() { return dot(uLightColor, uLightColor) > 0.0 ? uLightColor : vec3(1.0); }
vec3 scene_ambient() { return SCENE_AMBIENT; }
#define PI 3.14159265358979323846
#define TAU 6.28318530717958647692
float safe_divide(float a, float b) { return (abs(b) > 1e-8) ? (a / b) : 0.0; }
vec3 safe_divide(vec3 a, vec3 b) { return vec3(safe_divide(a.x, b.x), safe_divide(a.y, b.y), safe_divide(a.z, b.z)); }
float safe_pow(float a, float b) { return pow(max(a, 0.0), b); }
float sqr(float a) { return a * a; }
vec3 safe_normalize(vec3 v) { float l2 = dot(v, v); return (l2 > 1e-12) ? (v * inversesqrt(l2)) : vec3(0.0, 0.0, 1.0); }
vec3 safe_normalize_fallback(vec3 v, vec3 fb) { float l2 = dot(v, v); return (l2 > 1e-12) ? (v * inversesqrt(l2)) : fb; }
float rgb_to_bw(vec4 col) { return dot(col.rgb, vec3(0.2126, 0.7152, 0.0722)); }
float vec_to_float(vec3 v) { return (v.x + v.y + v.z) * 0.33333333; }
struct Closure { vec3 albedo; float metallic; float roughness; vec3 normal; vec3 emission; float alpha; float transmission; float ior; };
Closure default_closure() { return Closure(vec3(0.0), 0.0, 0.5, vec3(0.0, 0.0, 1.0), vec3(0.0), 1.0, 0.0, 1.0); }
Closure mix_closure(Closure a, Closure b, float fac) {
float f = clamp(fac, 0.0, 1.0);
return Closure(mix(a.albedo, b.albedo, f), mix(a.metallic, b.metallic, f), mix(a.roughness, b.roughness, f), safe_normalize(mix(a.normal, b.normal, f)), mix(a.emission, b.emission, f), mix(a.alpha, b.alpha, f), mix(a.transmission, b.transmission, f), mix(a.ior, b.ior, f));
}
Closure add_closure(Closure a, Closure b) {
return Closure(a.albedo + b.albedo, a.metallic, a.roughness, safe_normalize(a.normal + b.normal), a.emission + b.emission, clamp(a.alpha + b.alpha, 0.0, 1.0), a.transmission, a.ior);
}
vec3 shade_closure(Closure c, vec3 V) {
bool has_bsdf = dot(c.albedo, c.albedo) > 0.0 || c.metallic > 0.0 || abs(c.ior - 1.0) > 1e-4;
if (!has_bsdf) return vec3(0.0);
vec3 N = safe_normalize(c.normal), L = scene_light_dir(), Vn = safe_normalize_fallback(V, N), H = safe_normalize_fallback(L + Vn, N);
float NdL = max(dot(N, L), 0.0), NdV = max(dot(N, Vn), 1e-4), NdH = max(dot(N, H), 0.0), VdH = max(dot(Vn, H), 0.0);
float a = max(c.roughness * c.roughness, 1e-3), a2 = a * a, dn = NdH * NdH * (a2 - 1.0) + 1.0;
float D = a2 / (PI * dn * dn);
float k = sqr(c.roughness + 1.0) / 8.0;
float G = (NdV / (NdV * (1.0 - k) + k)) * (NdL / (NdL * (1.0 - k) + k));
vec3 F0 = mix(vec3(sqr((c.ior - 1.0) / (c.ior + 1.0))), c.albedo, c.metallic);
vec3 F = F0 + (1.0 - F0) * pow(1.0 - VdH, 5.0);
vec3 spec = D * G * F / max(4.0 * NdV * NdL, 1e-4);
vec3 kd = (1.0 - F) * (1.0 - c.metallic) * (1.0 - c.transmission);
vec3 direct = (kd * c.albedo + spec * PI) * scene_light_color() * NdL;
vec3 ambient = scene_ambient() * mix(c.albedo * (1.0 - c.transmission), F0, c.metallic);
return direct + ambient;
}
vec4 evaluate_closure(Closure c, vec3 V) { return vec4(shade_closure(c, V) + c.emission, c.alpha); }
vec3 rgb_to_hsv(vec3 c) {
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y), e = 1.0e-10;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
vec3 hsv_to_rgb(vec3 c) {
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
vec3 rgb_to_hsl(vec3 c) {
float cmax = max(c.r, max(c.g, c.b)), cmin = min(c.r, min(c.g, c.b)), l = (cmax + cmin) * 0.5, d = cmax - cmin;
if (d < 1e-6) return vec3(0.0, 0.0, l);
float s = l > 0.5 ? d / (2.0 - cmax - cmin) : d / (cmax + cmin);
float h = (cmax == c.r) ? ((c.g - c.b) / d + (c.g < c.b ? 6.0 : 0.0)) : ((cmax == c.g) ? ((c.b - c.r) / d + 2.0) : ((c.r - c.g) / d + 4.0));
return vec3(h / 6.0, s, l);
}
float hue_to_rgb(float p, float q, float t) {
if (t < 0.0) t += 1.0; if (t > 1.0) t -= 1.0;
if (t < 1.0/6.0) return p + (q - p) * 6.0 * t;
if (t < 1.0/2.0) return q;
if (t < 2.0/3.0) return p + (q - p) * (2.0/3.0 - t) * 6.0;
return p;
}
vec3 hsl_to_rgb(vec3 c) {
if (c.y == 0.0) return vec3(c.z);
float q = c.z < 0.5 ? c.z * (1.0 + c.y) : c.z + c.y - c.z * c.y, p = 2.0 * c.z - q;
return vec3(hue_to_rgb(p, q, c.x + 1.0/3.0), hue_to_rgb(p, q, c.x), hue_to_rgb(p, q, c.x - 1.0/3.0));
}
vec3 blend_color(int mode, float fac, vec3 c1, vec3 c2) {
fac = clamp(fac, 0.0, 1.0);
if (mode == 0) return mix(c1, c2, fac);
if (mode == 1) return mix(c1, c1 * c2, fac);
if (mode == 2) return mix(c1, c1 + c2, fac);
if (mode == 3) return mix(c1, c1 - c2, fac);
if (mode == 4) return 1.0 - (1.0 - fac + fac * (1.0 - c2)) * (1.0 - c1);
if (mode == 5) {
vec3 r = vec3(
(c1.x < 0.5) ? (2.0 * c1.x * c2.x) : (1.0 - 2.0 * (1.0 - c1.x) * (1.0 - c2.x)),
(c1.y < 0.5) ? (2.0 * c1.y * c2.y) : (1.0 - 2.0 * (1.0 - c1.y) * (1.0 - c2.y)),
(c1.z < 0.5) ? (2.0 * c1.z * c2.z) : (1.0 - 2.0 * (1.0 - c1.z) * (1.0 - c2.z))
);
return mix(c1, r, fac);
}
if (mode == 6) return mix(c1, abs(c1 - c2), fac);
if (mode == 7) return mix(c1, min(c1, c2), fac);
if (mode == 8) return mix(c1, max(c1, c2), fac);
if (mode == 9) return mix(c1, safe_divide(c1, 1.0 - c2), fac);
if (mode == 10) return mix(c1, 1.0 - safe_divide(1.0 - c1, c2), fac);
if (mode == 11) { vec3 sc = 1.0 - (1.0 - c1) * (1.0 - c2); return mix(c1, ((1.0 - c1) * c2 * c1) + (c1 * sc), fac); }
if (mode == 12) return c1 + fac * (2.0 * (c2 - vec3(0.5)));
if (mode == 13) return mix(c1, safe_divide(c1, c2), fac);
if (mode == 14) { vec3 h1 = rgb_to_hsv(c1), h2 = rgb_to_hsv(c2); return (h2.y != 0.0) ? mix(c1, hsv_to_rgb(vec3(h2.x, h1.y, h1.z)), fac) : c1; }
if (mode == 15) { vec3 h1 = rgb_to_hsv(c1), h2 = rgb_to_hsv(c2); return (h1.y != 0.0) ? hsv_to_rgb(vec3(h1.x, mix(h1.y, h2.y, fac), h1.z)) : c1; }
if (mode == 16) { vec3 h1 = rgb_to_hsv(c1), h2 = rgb_to_hsv(c2); return (h2.y != 0.0) ? mix(c1, hsv_to_rgb(vec3(h2.x, h2.y, h1.z)), fac) : c1; }
if (mode == 17) { vec3 h1 = rgb_to_hsv(c1), h2 = rgb_to_hsv(c2); return hsv_to_rgb(vec3(h1.x, h1.y, mix(h1.z, h2.z, fac))); }
if (mode == 18) return max(mix(c1, c1 + c2 - 2.0 * c1 * c2, fac), vec3(0.0));
return c1;
}
void node_tex_gradient(vec3 p, int gt, out vec4 out_c, out float out_f) {
float r = 0.0;
if (gt == 0) r = p.x;
else if (gt == 1) r = max(p.x, 0.0) * max(p.x, 0.0);
else if (gt == 2) { float t = clamp(p.x, 0.0, 1.0); r = t * t * (3.0 - 2.0 * t); }
else if (gt == 3) r = (p.x + p.y) * 0.5;
else if (gt == 4) r = max(1.0 - length(p), 0.0);
else if (gt == 5) { float t = max(1.0 - length(p), 0.0); r = t * t; }
else if (gt == 6) r = atan(p.y, p.x) / TAU + 0.5;
out_f = clamp(r, 0.0, 1.0); out_c = vec4(vec3(out_f), 1.0);
}
vec4 ramp_n8_NebulaPalette(float fac) {
float t = clamp(fac, 0.0, 1.0);
if (t <= 0.08) return vec4(0.001, 0.002, 0.008, 1.0);
if (t <= 0.32) return mix(vec4(0.001, 0.002, 0.008, 1.0), vec4(0.012, 0.052, 0.22, 1.0), smoothstep(0.08, 0.32, t));
if (t <= 0.56) return mix(vec4(0.012, 0.052, 0.22, 1.0), vec4(0.14, 0.035, 0.34, 1.0), smoothstep(0.32, 0.56, t));
if (t <= 0.78) return mix(vec4(0.14, 0.035, 0.34, 1.0), vec4(0.44, 0.065, 0.3, 1.0), smoothstep(0.56, 0.78, t));
if (t <= 0.96) return mix(vec4(0.44, 0.065, 0.3, 1.0), vec4(0.78, 0.24, 0.26, 1.0), smoothstep(0.78, 0.96, t));
return vec4(0.78, 0.24, 0.26, 1.0);
}
vec4 ramp_n53_FilamentPalette(float fac) {
float t = clamp(fac, 0.0, 1.0);
if (t <= 0.05) return vec4(0.0, 0.0, 0.0, 1.0);
if (t <= 0.45) return mix(vec4(0.0, 0.0, 0.0, 1.0), vec4(0.02, 0.36, 0.58, 1.0), smoothstep(0.05, 0.45, t));
if (t <= 0.95) return mix(vec4(0.02, 0.36, 0.58, 1.0), vec4(0.28, 0.86, 1.0, 1.0), smoothstep(0.45, 0.95, t));
return vec4(0.28, 0.86, 1.0, 1.0);
}
vec4 ramp_n78_StarFar_Temp(float fac) {
float t = clamp(fac, 0.0, 1.0);
if (t <= 0.1) return vec4(0.5, 0.76, 1.0, 1.0);
if (t <= 0.55) return mix(vec4(0.5, 0.76, 1.0, 1.0), vec4(0.95, 0.97, 1.0, 1.0), safe_divide(t - 0.1, 0.55 - 0.1));
if (t <= 0.92) return mix(vec4(0.95, 0.97, 1.0, 1.0), vec4(1.0, 0.72, 0.42, 1.0), safe_divide(t - 0.55, 0.92 - 0.55));
return vec4(1.0, 0.72, 0.42, 1.0);
}
vec4 ramp_n97_StarNear_Temp(float fac) {
float t = clamp(fac, 0.0, 1.0);
if (t <= 0.1) return vec4(0.55, 0.82, 1.0, 1.0);
if (t <= 0.5) return mix(vec4(0.55, 0.82, 1.0, 1.0), vec4(1.0, 0.99, 0.96, 1.0), safe_divide(t - 0.1, 0.5 - 0.1));
if (t <= 0.9) return mix(vec4(1.0, 0.99, 0.96, 1.0), vec4(1.0, 0.66, 0.28, 1.0), safe_divide(t - 0.5, 0.9 - 0.5));
return vec4(1.0, 0.66, 0.28, 1.0);
}
void main() {
vec2 g_UV = vUv, g_WindowUV = vUv;
vec3 g_Generated = (dot(vColor.rgb, vColor.rgb) > 0.0) ? vec3(vColor.x, 1.0 - vColor.z, vColor.y) : vec3(vUv, 0.5);
vec3 g_WorldPos = vec3(vWorldPosition.x, -vWorldPosition.z, vWorldPosition.y);
vec3 g_ObjectPos = vec3(vObjectPosition.x, -vObjectPosition.z, vObjectPosition.y);
vec3 g_CameraPos = vec3(vWorldPosition.x - uCameraPosition.x, uCameraPosition.z - vWorldPosition.z, vWorldPosition.y - uCameraPosition.y);
vec3 g_Normal = safe_normalize(vec3(vNormal.x, -vNormal.z, vNormal.y));
vec3 g_ObjectNormal = safe_normalize(vec3(vObjectNormal.x, -vObjectNormal.z, vObjectNormal.y));
vec3 g_Tangent = safe_normalize(vec3(vTangent.x, -vTangent.z, vTangent.y));
vec3 g_ViewVec = safe_normalize(vec3(uCameraPosition.x - vWorldPosition.x, vWorldPosition.z - uCameraPosition.z, uCameraPosition.y - vWorldPosition.y));
vec4 g_VertexColor = vColor; float g_Backfacing = gl_FrontFacing ? 0.0 : 1.0;
vec3 n16_ViewRayIn_vec = reflect(reflect(-g_ViewVec, g_Normal), safe_normalize(g_ObjectNormal));
vec3 n15_RefractRay_vec = refract(n16_ViewRayIn_vec, safe_normalize(g_ObjectNormal), 0.68);
vec3 n14_DepthShallow_vec = (n15_RefractRay_vec * vec3(0.26, 0.26, 0.26) + g_ObjectPos);
vec3 n13_CoreEnvScale_vec = (n14_DepthShallow_vec * 0.42);
vec4 n12_CoreGradient_c; float n12_CoreGradient_f; node_tex_gradient(n13_CoreEnvScale_vec, 4, n12_CoreGradient_c, n12_CoreGradient_f);
vec3 n24_DepthDeep_vec = (n15_RefractRay_vec * vec3(1.68, 1.68, 1.68) + g_ObjectPos);
vec3 n25_TiltO1_Cross_vec = cross(n24_DepthDeep_vec, vec3(0.55, -0.43, 0.61));
vec3 n23_TiltO1_Rot_vec = (n24_DepthDeep_vec * vec3(0.82, 0.82, 0.82) + n25_TiltO1_Cross_vec);
float n26_NebulaScale_v = 3.55;
vec3 n22_ScaleDeep_vec = (n23_TiltO1_Rot_vec * n26_NebulaScale_v);
vec3 n21_NebO1_Pos_vec = (n22_ScaleDeep_vec * vec3(0.95, 0.95, 0.95) + vec3(1.15, 0.65, 2.05));
vec3 n20_NebO1_Sin_vec = sin(n21_NebO1_Pos_vec);
vec3 n29_NebO1_Sep_v = n21_NebO1_Pos_vec;
vec3 n28_NebO1_YZX_v = vec3(n29_NebO1_Sep_v.y, n29_NebO1_Sep_v.z, n29_NebO1_Sep_v.x);
vec3 n27_NebO1_Cos_vec = cos(n28_NebO1_YZX_v);
float n19_NebO1_Dot_val = dot(n20_NebO1_Sin_vec, n27_NebO1_Cos_vec);
vec3 n36_WarpNebula1_vec = (n20_NebO1_Sin_vec * vec3(0.38, 0.38, 0.38) + n14_DepthShallow_vec);
vec3 n37_TiltO2_Cross_vec = cross(n36_WarpNebula1_vec, vec3(-0.48, 0.62, 0.37));
vec3 n35_TiltO2_Rot_vec = (n36_WarpNebula1_vec * vec3(0.82, 0.82, 0.82) + n37_TiltO2_Cross_vec);
vec3 n34_ScaleMid_vec = (n35_TiltO2_Rot_vec * n26_NebulaScale_v);
vec3 n33_NebO2_Pos_vec = (n34_ScaleMid_vec * vec3(2.15, 2.15, 2.15) + vec3(1.7, 0.4, 2.2));
vec3 n32_NebO2_Sin_vec = sin(n33_NebO2_Pos_vec);
vec3 n40_NebO2_Sep_v = n33_NebO2_Pos_vec;
vec3 n39_NebO2_YZX_v = vec3(n40_NebO2_Sep_v.y, n40_NebO2_Sep_v.z, n40_NebO2_Sep_v.x);
vec3 n38_NebO2_Cos_vec = cos(n39_NebO2_YZX_v);
float n31_NebO2_Dot_val = dot(n32_NebO2_Sin_vec, n38_NebO2_Cos_vec);
vec3 n46_WarpNebula2_vec = (n32_NebO2_Sin_vec * vec3(0.28, 0.28, 0.28) + n34_ScaleMid_vec);
vec3 n47_TiltO3_Cross_vec = cross(n46_WarpNebula2_vec, vec3(0.64, 0.39, -0.51));
vec3 n45_TiltO3_Rot_vec = (n46_WarpNebula2_vec * vec3(0.82, 0.82, 0.82) + n47_TiltO3_Cross_vec);
vec3 n44_NebO3_Pos_vec = (n45_TiltO3_Rot_vec * vec3(4.6, 4.6, 4.6) + vec3(0.9, 2.5, 1.3));
vec3 n43_NebO3_Sin_vec = sin(n44_NebO3_Pos_vec);
vec3 n50_NebO3_Sep_v = n44_NebO3_Pos_vec;
vec3 n49_NebO3_YZX_v = vec3(n50_NebO3_Sep_v.y, n50_NebO3_Sep_v.z, n50_NebO3_Sep_v.x);
vec3 n48_NebO3_Cos_vec = cos(n49_NebO3_YZX_v);
float n42_NebO3_Dot_val = dot(n43_NebO3_Sin_vec, n48_NebO3_Cos_vec);
float n41_WeightO3_val = (n42_NebO3_Dot_val * 0.32);
float n30_CombineO2O3_val = (n31_NebO2_Dot_val * 0.45 + n41_WeightO3_val);
float n18_NebFbm_val = (n19_NebO1_Dot_val * 0.5 + n30_CombineO2O3_val);
float n11_NebEnvelope_val = (n12_CoreGradient_f * 0.24 + n18_NebFbm_val);
float n52_WispDetailAbs_val = abs(n42_NebO3_Dot_val);
float n51_WispDetailMod_f = safe_divide(n52_WispDetailAbs_val - 0.0, 1.35 - 0.0);
n51_WispDetailMod_f = clamp(n51_WispDetailMod_f, 0.0, 1.0);
float n51_WispDetailMod_r = mix(1.0, 0.42, n51_WispDetailMod_f);
float n10_NebWispCarve_val = (n11_NebEnvelope_val * n51_WispDetailMod_r);
float n9_NebulaDensity_f = safe_divide(n10_NebWispCarve_val - -0.18, 1.62 - -0.18);
n9_NebulaDensity_f = clamp(n9_NebulaDensity_f, 0.0, 1.0);
n9_NebulaDensity_f = n9_NebulaDensity_f * n9_NebulaDensity_f * n9_NebulaDensity_f * (n9_NebulaDensity_f * (n9_NebulaDensity_f * 6.0 - 15.0) + 10.0);
float n9_NebulaDensity_r = mix(0.0, 1.0, n9_NebulaDensity_f);
vec4 n8_NebulaPalette_rgba = ramp_n8_NebulaPalette(n9_NebulaDensity_r);
float n58_FilamentMixScalar_val = (n31_NebO2_Dot_val * 0.62 + n41_WeightO3_val);
float n57_FilamentAbs_val = abs(n58_FilamentMixScalar_val);
float n56_FilamentRidge_f = safe_divide(n57_FilamentAbs_val - 0.0, 0.34 - 0.0);
n56_FilamentRidge_f = clamp(n56_FilamentRidge_f, 0.0, 1.0);
n56_FilamentRidge_f = n56_FilamentRidge_f * n56_FilamentRidge_f * n56_FilamentRidge_f * (n56_FilamentRidge_f * (n56_FilamentRidge_f * 6.0 - 15.0) + 10.0);
float n56_FilamentRidge_r = mix(1.0, 0.0, n56_FilamentRidge_f);
float n55_FilamentPow_val = safe_pow(n56_FilamentRidge_r, 3.2);
float n59_FilamentMaskClamp_r = clamp(n9_NebulaDensity_r, 0.0, 1.0);
float n54_FilamentWeighted_val = (n55_FilamentPow_val * n59_FilamentMaskClamp_r);
vec4 n53_FilamentPalette_rgba = ramp_n53_FilamentPalette(n54_FilamentWeighted_val);
vec3 n7_AddFilaments_rgb = blend_color(2, 0.65, (n8_NebulaPalette_rgba).rgb, (n53_FilamentPalette_rgba).rgb);
vec4 n7_AddFilaments_r = vec4(n7_AddFilaments_rgb, mix((n8_NebulaPalette_rgba).a, (n53_FilamentPalette_rgba).a, clamp(0.65, 0.0, 1.0)));
vec3 n68_DepthStarsFar_vec = (n15_RefractRay_vec * vec3(1.82, 1.82, 1.82) + g_ObjectPos);
vec3 n67_StarFar_Scale_vec = (n68_DepthStarsFar_vec * 20.0);
vec3 n66_StarFar_Frac_vec = fract(n67_StarFar_Scale_vec);
vec3 n75_StarFar_Cell_vec = floor(n67_StarFar_Scale_vec);
float n74_StarFar_HashDot_val = dot(n75_StarFar_Cell_vec, vec3(12.9898, 78.233, 37.719));
vec3 n73_StarFar_HashVec_vec = (vec3(1.0, 1.37, 2.19) * n74_StarFar_HashDot_val);
vec3 n72_StarFar_HashSin_vec = sin(n73_StarFar_HashVec_vec);
vec3 n71_StarFar_HashMul_vec = (n72_StarFar_HashSin_vec * 437.585);
vec3 n70_StarFar_Rnd_vec = fract(n71_StarFar_HashMul_vec);
vec3 n69_StarFar_Jitter_vec = (n70_StarFar_Rnd_vec * vec3(0.52, 0.52, 0.52) + vec3(0.24, 0.24, 0.24));
float n65_StarFar_Dist_val = distance(n66_StarFar_Frac_vec, n69_StarFar_Jitter_vec);
float n64_StarFar_Shape_f = safe_divide(n65_StarFar_Dist_val - 0.0, 0.22 - 0.0);
n64_StarFar_Shape_f = clamp(n64_StarFar_Shape_f, 0.0, 1.0);
n64_StarFar_Shape_f = n64_StarFar_Shape_f * n64_StarFar_Shape_f * n64_StarFar_Shape_f * (n64_StarFar_Shape_f * (n64_StarFar_Shape_f * 6.0 - 15.0) + 10.0);
float n64_StarFar_Shape_r = mix(1.0, 0.0, n64_StarFar_Shape_f);
float n63_StarFar_CorePow_val = safe_pow(n64_StarFar_Shape_r, 7.2);
float n62_StarFar_Gain_val = (n63_StarFar_CorePow_val * 3.4);
vec3 n77_StarFar_RndSep_v = n70_StarFar_Rnd_vec;
float n76_StarFar_Sparse_f = safe_divide(n77_StarFar_RndSep_v.x - 0.42, 0.99 - 0.42);
n76_StarFar_Sparse_f = clamp(n76_StarFar_Sparse_f, 0.0, 1.0);
n76_StarFar_Sparse_f = n76_StarFar_Sparse_f * n76_StarFar_Sparse_f * n76_StarFar_Sparse_f * (n76_StarFar_Sparse_f * (n76_StarFar_Sparse_f * 6.0 - 15.0) + 10.0);
float n76_StarFar_Sparse_r = mix(0.0, 1.0, n76_StarFar_Sparse_f);
float n61_StarFar_Intensity_val = (n62_StarFar_Gain_val * n76_StarFar_Sparse_r);
vec4 n78_StarFar_Temp_rgba = ramp_n78_StarFar_Temp(n77_StarFar_RndSep_v.y);
vec3 n60_StarFar_Tint_rgb = blend_color(0, n61_StarFar_Intensity_val, (vec4(0.0, 0.0, 0.0, 1.0)).rgb, (n78_StarFar_Temp_rgba).rgb);
vec4 n60_StarFar_Tint_r = vec4(n60_StarFar_Tint_rgb, mix((vec4(0.0, 0.0, 0.0, 1.0)).a, (n78_StarFar_Temp_rgba).a, clamp(n61_StarFar_Intensity_val, 0.0, 1.0)));
vec3 n6_AddFarStars_rgb = blend_color(2, 1.0, (n7_AddFilaments_r).rgb, (n60_StarFar_Tint_r).rgb);
vec4 n6_AddFarStars_r = vec4(n6_AddFarStars_rgb, mix((n7_AddFilaments_r).a, (n60_StarFar_Tint_r).a, clamp(1.0, 0.0, 1.0)));
vec3 n87_DepthStarsNear_vec = (n15_RefractRay_vec * vec3(0.2, 0.2, 0.2) + g_ObjectPos);
vec3 n86_StarNear_Scale_vec = (n87_DepthStarsNear_vec * 9.6);
vec3 n85_StarNear_Frac_vec = fract(n86_StarNear_Scale_vec);
vec3 n94_StarNear_Cell_vec = floor(n86_StarNear_Scale_vec);
float n93_StarNear_HashDot_val = dot(n94_StarNear_Cell_vec, vec3(12.9898, 78.233, 37.719));
vec3 n92_StarNear_HashVec_vec = (vec3(1.0, 1.37, 2.19) * n93_StarNear_HashDot_val);
vec3 n91_StarNear_HashSin_vec = sin(n92_StarNear_HashVec_vec);
vec3 n90_StarNear_HashMul_vec = (n91_StarNear_HashSin_vec * 437.585);
vec3 n89_StarNear_Rnd_vec = fract(n90_StarNear_HashMul_vec);
vec3 n88_StarNear_Jitter_vec = (n89_StarNear_Rnd_vec * vec3(0.52, 0.52, 0.52) + vec3(0.24, 0.24, 0.24));
float n84_StarNear_Dist_val = distance(n85_StarNear_Frac_vec, n88_StarNear_Jitter_vec);
float n83_StarNear_Shape_f = safe_divide(n84_StarNear_Dist_val - 0.0, 0.19 - 0.0);
n83_StarNear_Shape_f = clamp(n83_StarNear_Shape_f, 0.0, 1.0);
n83_StarNear_Shape_f = n83_StarNear_Shape_f * n83_StarNear_Shape_f * n83_StarNear_Shape_f * (n83_StarNear_Shape_f * (n83_StarNear_Shape_f * 6.0 - 15.0) + 10.0);
float n83_StarNear_Shape_r = mix(1.0, 0.0, n83_StarNear_Shape_f);
float n82_StarNear_CorePow_val = safe_pow(n83_StarNear_Shape_r, 5.8);
float n81_StarNear_Gain_val = (n82_StarNear_CorePow_val * 3.8);
vec3 n96_StarNear_RndSep_v = n89_StarNear_Rnd_vec;
float n95_StarNear_Sparse_f = safe_divide(n96_StarNear_RndSep_v.x - 0.62, 0.99 - 0.62);
n95_StarNear_Sparse_f = clamp(n95_StarNear_Sparse_f, 0.0, 1.0);
n95_StarNear_Sparse_f = n95_StarNear_Sparse_f * n95_StarNear_Sparse_f * n95_StarNear_Sparse_f * (n95_StarNear_Sparse_f * (n95_StarNear_Sparse_f * 6.0 - 15.0) + 10.0);
float n95_StarNear_Sparse_r = mix(0.0, 1.0, n95_StarNear_Sparse_f);
float n80_StarNear_Intensity_val = (n81_StarNear_Gain_val * n95_StarNear_Sparse_r);
vec4 n97_StarNear_Temp_rgba = ramp_n97_StarNear_Temp(n96_StarNear_RndSep_v.y);
vec3 n79_StarNear_Tint_rgb = blend_color(0, n80_StarNear_Intensity_val, (vec4(0.0, 0.0, 0.0, 1.0)).rgb, (n97_StarNear_Temp_rgba).rgb);
vec4 n79_StarNear_Tint_r = vec4(n79_StarNear_Tint_rgb, mix((vec4(0.0, 0.0, 0.0, 1.0)).a, (n97_StarNear_Temp_rgba).a, clamp(n80_StarNear_Intensity_val, 0.0, 1.0)));
vec3 n5_AddNearStars_rgb = blend_color(2, 1.0, (n6_AddFarStars_r).rgb, (n79_StarNear_Tint_r).rgb);
vec4 n5_AddNearStars_r = vec4(n5_AddNearStars_rgb, mix((n6_AddFarStars_r).a, (n79_StarNear_Tint_r).a, clamp(1.0, 0.0, 1.0)));
float n102_FresnelDot_val = dot(g_ObjectNormal, reflect(-g_ViewVec, g_Normal));
float n101_FresnelAbs_val = abs(n102_FresnelDot_val);
float n100_FresnelEdge_f = safe_divide(n101_FresnelAbs_val - 0.0, 1.0 - 0.0);
n100_FresnelEdge_f = clamp(n100_FresnelEdge_f, 0.0, 1.0);
float n100_FresnelEdge_r = mix(0.82, 0.0, n100_FresnelEdge_f);
float n99_FresnelPow_val = safe_pow(n100_FresnelEdge_r, 4.0);
vec4 n103_CrystalRimColor_c = vec4(0.24, 0.72, 1.0, 1.0);
vec3 n98_TintCrystalRim_rgb = blend_color(0, n99_FresnelPow_val, (vec4(0.0, 0.0, 0.0, 1.0)).rgb, (n103_CrystalRimColor_c).rgb);
vec4 n98_TintCrystalRim_r = vec4(n98_TintCrystalRim_rgb, mix((vec4(0.0, 0.0, 0.0, 1.0)).a, (n103_CrystalRimColor_c).a, clamp(n99_FresnelPow_val, 0.0, 1.0)));
vec3 n4_AddCrystalRim_rgb = blend_color(2, 0.58, (n5_AddNearStars_r).rgb, (n98_TintCrystalRim_r).rgb);
vec4 n4_AddCrystalRim_r = vec4(n4_AddCrystalRim_rgb, mix((n5_AddNearStars_r).a, (n98_TintCrystalRim_r).a, clamp(0.58, 0.0, 1.0)));
vec4 n3_GradeCosmos_c = vec4(max((1.0 + 0.04) * (n4_AddCrystalRim_r).rgb + (0.0 - 0.04 * 0.5), vec3(0.0)), (n4_AddCrystalRim_r).a);
vec4 n2_DepthGamma_c = vec4(pow(max((n3_GradeCosmos_c).rgb, vec3(0.0)), vec3(1.05)), (n3_GradeCosmos_c).a);
Closure n1_Principled_BSDF_b = Closure((vec4(0.003, 0.005, 0.012, 1.0)).rgb, clamp(0.0, 0.0, 1.0), clamp(0.045, 0.0, 1.0), safe_normalize_fallback(g_Normal, g_Normal), (n2_DepthGamma_c).rgb * 1.25, clamp(1.0, 0.0, 1.0), clamp(0.0, 0.0, 1.0), 1.52);
Closure final_closure = n1_Principled_BSDF_b;
vec4 final_rgba = evaluate_closure(final_closure, g_ViewVec);
fragColor = final_rgba;
}
Export paired .glsl + .vert files for WebGL 2 and Three.js,
mainImage for Shadertoy, or native .gdshader for Godot 4
from the Blender Shader Editor sidebar.
NodeRelay emits only the helper functions your material uses, verified across 48 byte-for-byte golden comparisons on Windows, Linux, and macOS.
Hardware-limited nodes like Light Path, Raycast, or
Tex IES are flagged in the sidebar and export log with safe pass-through
or documented approximations.
Start in Free with a real working compiler — including the Astral Crystal sample shown at the top of this page. Upgrade when your graphs need Noise, Voronoi, Image Textures, Curves, or nested Node Groups.
| Capability | NodeRelay Free | NodeRelay Pro |
|---|---|---|
| Supported shader nodes | 21 core nodes (22 IDs) | 94 working nodes (73 Pro-only, incl. 10 approximations) |
| Textures & procedural | Gradient, Checker | Noise, Voronoi, Wave, Musgrave, Brick, Magic, White Noise, Image Texture, Radial Tiling |
| Node Groups & NPR | — | Nested reusable Node Groups, Shader to RGB, Toon, Glass, Translucent, Glossy |
| Normals & curves | Color Ramp, Mix, Map Range, Clamp, Invert, Gamma, Bright/Contrast | Bump, Normal Map, Mapping, Vector Rotate, Float / RGB / Vector Curves, Layer Weight, Fresnel |
| Export runtimes | WebGL 2 · Three.js · Shadertoy · Godot 4 | WebGL 2 · Three.js · Shadertoy · Godot 4 |
| License & offline use | Free ($0+) · zero network calls | One-time lifetime license · up to 5 devices · 14-day offline lease |
Light Path,
Object Info, Attribute, Particle Info,
Hair Info, Volume Info, Raycast,
Tex IES, Tex Point Density, Script) use documented
GLSL approximations; unsupported nodes fall back to safe pass-through and are listed
before export.
Generated GLSL and .gdshader output is yours for commercial and personal
projects with zero runtime dependencies or attribution requirements.