Newer
Older
DungeonShooting / DungeonShooting_Godot / resource / materlal / Shadow.gdshader
  1. shader_type canvas_item;
  2.  
  3. uniform vec4 shadowColor : hint_color = vec4(0.0, 0.0, 0.0, 0.8);
  4. uniform float schedule = 1.0;
  5. //将贴图渲染为阴影
  6.  
  7. void fragment() {
  8. vec4 textureColor = texture(TEXTURE, UV);
  9. vec4 col = mix(textureColor, shadowColor, schedule);
  10. COLOR = mix(vec4(0.0, 0.0, 0.0, 0.0), col, textureColor.a);
  11. }