Advertisement
Joshua_Blackmon

Uv_controler

Feb 6th, 2022
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. // NOTE: Shader automatically converted from Godot Engine 3.4.stable's SpatialMaterial.
  2.  
  3. shader_type spatial;
  4. render_mode blend_mix,depth_draw_opaque,cull_disabled,diffuse_burley,specular_schlick_ggx;
  5. uniform vec4 albedo : hint_color;
  6. uniform sampler2D texture_albedo : hint_albedo;
  7. uniform float specular;
  8. uniform float metallic;
  9. uniform float alpha_scissor_threshold;
  10. uniform float roughness : hint_range(0,1);
  11. uniform float point_size : hint_range(0,128);
  12. uniform sampler2D texture_normal : hint_normal;
  13. uniform float normal_scale : hint_range(-16,16);
  14. uniform vec2 uv1_scale;
  15. uniform vec2 uv1_offset;
  16. uniform vec2 uv2_scale;
  17. uniform vec2 uv2_offset;
  18. uniform vec3 emission = vec3(0,0,0);
  19. uniform float Albedo_on_off = 0.0;
  20. uniform float texture_1_on = 0;
  21. uniform float texture_2_on = 1;
  22. uniform float alpha_1_on = 1;
  23. uniform float alpha_2_on = 0;
  24. void vertex() {
  25. UV=UV*uv1_scale.xy+uv1_offset.xy;
  26. }
  27.  
  28.  
  29.  
  30.  
  31. void fragment() {
  32. vec2 base_uv = UV * uv1_scale + uv1_offset;
  33. vec2 base_uv2 = UV2 * uv2_scale + uv2_offset;
  34. vec4 albedo_tex = texture(texture_albedo,base_uv);
  35. vec4 albedo_tex2 = texture(texture_albedo,base_uv2);
  36. albedo_tex *= COLOR;
  37. ALBEDO = (albedo.rgb * albedo_tex.rgb * texture_1_on) + (albedo.rgb * albedo_tex2.rgb * texture_2_on) ;
  38. METALLIC = metallic;
  39. ROUGHNESS = roughness;
  40. SPECULAR = specular;
  41. NORMALMAP = texture(texture_normal,base_uv).rgb;
  42. NORMALMAP_DEPTH = normal_scale;
  43. ALPHA =(albedo.a * albedo_tex.a* alpha_1_on) + (albedo.a * albedo_tex2.a * alpha_2_on);
  44. ALPHA_SCISSOR=alpha_scissor_threshold;
  45. EMISSION = emission + (ALBEDO * Albedo_on_off);
  46. }
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement