shader_type spatial; render_mode diffuse_burley, specular_schlick_ggx; // Luneraria energy vein: a carved channel in the plaza floor through which the Ancient's // energy flows to its base towers and gates. Pulses travel along UV.x towards the heart // (u = 0 at the Ancient); `energy` follows the Ancient's state, `flicker` its instability. instance uniform vec4 tint : source_color, instance_index(4) = vec4(.5, .78, 1.0, 1.0); instance uniform float energy : instance_index(5) = 1.0; instance uniform float flicker : instance_index(6) = 0.0; instance uniform float seed : instance_index(3) = 0.0; #include "res://scripts/luneraria/view/materials/lune_common.gdshaderinc" void fragment() { float across = abs(UV.y - .5) * 2.0; float core = 1.0 - smoothstep(.15, .7, across); float lip = smoothstep(.72, .95, across); float flow = fract(UV.x * .35 + TIME * .45 + seed); float pulse = smoothstep(.0, .12, flow) * (1.0 - smoothstep(.12, .45, flow)); float live = energy; if (flicker > 0.0) live *= mix(1.0, step(.4, noise3(vec3(TIME * 4.0, UV.x * .3, seed))), flicker); vec3 carved = vec3(.08, .08, .1) + vec3(.3, .29, .27) * lip; ALBEDO = mix(carved, tint.rgb * .2, core * .6); ROUGHNESS = mix(.85, .3, core); EMISSION = tint.rgb * core * live * (.55 + pulse * 1.6); }