harvest/prototype/resources/bird.gdshader
2026-10-03 12:14:28 -04:00

23 lines
708 B
Text

shader_type spatial;
// Shared bird material (one MultiMesh batch). Wings (local |x|) flap in the vertex shader with
// a per-bird phase from INSTANCE_CUSTOM.r, so the static OBJ reads as alive at no CPU cost.
// Rim lighting keeps the near-black crow readable against the floor.
render_mode cull_disabled;
uniform vec3 base_color : source_color = vec3(0.07, 0.07, 0.09);
uniform float flap_speed = 11.0;
uniform float flap_amount = 0.55;
void vertex() {
float span = abs(VERTEX.x);
float phase = INSTANCE_CUSTOM.r * 6.2831853;
VERTEX.y += sin(TIME * flap_speed + phase) * span * flap_amount;
}
void fragment() {
ALBEDO = base_color;
ROUGHNESS = 0.55;
SPECULAR = 0.4;
RIM = 0.8;
RIM_TINT = 0.3;
}