surface_template.shader 823 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. shader_type spatial;
  2. render_mode blend_mix,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx;
  3. uniform sampler2D tx_o : hint_albedo;
  4. uniform sampler2D tx_b : hint_albedo;
  5. uniform sampler2D tx_g : hint_albedo;
  6. uniform sampler2D tx_r : hint_albedo;
  7. uniform vec4 blendx;
  8. const float power=1.25;
  9. void vertex() {
  10. }
  11. void fragment() {
  12. vec2 tuv = UV;
  13. METALLIC = 0.;
  14. ROUGHNESS = 1.;
  15. SPECULAR = 0.5;
  16. vec3 col=vec3(0);
  17. vec3 c1=vec3(0);
  18. vec3 c2=vec3(0);
  19. vec3 c3=vec3(0);
  20. vec3 c4=vec3(0);
  21. if(blendx.x>0.)c1=texture(tx_o,tuv).rgb*power;
  22. if(blendx.y>0.)c2=texture(tx_b,tuv).rgb*power;
  23. if(blendx.z>0.)c3=texture(tx_g,tuv).rgb*power;
  24. if(blendx.w>0.)c4=texture(tx_r,tuv).rgb*power;
  25. col=c2*blendx.y+c3*blendx.z+c4*blendx.w;
  26. //col=clamp(col,0.,1.);
  27. col=c1*blendx.x+col;
  28. ALBEDO=col;
  29. EMISSION=col;
  30. }