Advertisement
RightSorcerer

Untitled

Mar 29th, 2023
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. shader_type spatial;
  2.  
  3. render_mode async_visible,blend_add,depth_draw_opaque,cull_back,diffuse_burley,specular_schlick_ggx,unshaded;
  4.  
  5. uniform float dissolve_value : hint_range(0, 1) = 0.5;
  6. uniform float opacity : hint_range(0, 1) = 1.0;
  7.  
  8. uniform vec3 uv1_scale = vec3(1, 1, 1);
  9. uniform vec3 uv1_offset;
  10.  
  11. uniform sampler2D albedo_texture;
  12. uniform sampler2D nosie_texture;
  13.  
  14. void vertex() {
  15. UV *= uv1_scale.xy + uv1_offset.xy;
  16. mat4 mat_world = mat4(normalize(CAMERA_MATRIX[0])*length(WORLD_MATRIX[0]),normalize(CAMERA_MATRIX[1])*length(WORLD_MATRIX[0]),normalize(CAMERA_MATRIX[2])*length(WORLD_MATRIX[2]),WORLD_MATRIX[3]);
  17. mat_world = mat_world * mat4( vec4(cos(INSTANCE_CUSTOM.x),-sin(INSTANCE_CUSTOM.x), 0.0, 0.0), vec4(sin(INSTANCE_CUSTOM.x), cos(INSTANCE_CUSTOM.x), 0.0, 0.0),vec4(0.0, 0.0, 1.0, 0.0),vec4(0.0, 0.0, 0.0, 1.0));
  18. MODELVIEW_MATRIX = INV_CAMERA_MATRIX * mat_world;
  19. }
  20.  
  21. void fragment() {
  22. vec4 texture_mask = texture(albedo_texture, UV) * COLOR;
  23. ALBEDO = texture_mask.rgb;
  24. float nosie_mask = texture(nosie_texture, UV).r;
  25. ALPHA = opacity * texture_mask.a * step(dissolve_value, texture_mask.a - nosie_mask);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement