Files
Diabolo/Demon_v0.19/soul_cloth.gdshader

24 lines
839 B
Plaintext

shader_type spatial;
render_mode cull_disabled, depth_prepass_alpha;
uniform vec4 base_color:source_color=vec4(.48,.52,.47,1.0);
uniform float clock=0.0;
uniform float flutter=.15;
uniform float phase=0.0;
uniform float reveal=1.0;
uniform float transfer_visibility=1.0;
void vertex(){
float free_edge=UV.y*UV.y;
VERTEX.z+=free_edge*(sin(clock*5.0+UV.y*6.5+phase)*.025+sin(clock*8.0+UV.x*4.0+phase)*.009)*flutter;
VERTEX.x+=free_edge*sin(clock*3.5+UV.y*4.0+phase)*.012*flutter;
}
void fragment(){
if(transfer_visibility<=0.0||reveal<=.2)discard;
float grain=fract(sin(dot(floor(UV*120.0),vec2(12.9898,78.233)))*43758.5453);
if(grain>transfer_visibility)discard;
float thread=.92+.08*sin(UV.x*130.0)*sin(UV.y*180.0);
ALBEDO=base_color.rgb*thread;
ROUGHNESS=1.0;
EMISSION=base_color.rgb*.12;
ALPHA=.70*smoothstep(.2,.6,reveal);
}