Guest User

Untitled

a guest
Aug 3rd, 2024
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | Source Code | 0 0
  1. shader_type spatial;
  2. render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_lambert, specular_disabled, ambient_light_disabled;
  3.  
  4. uniform vec4 albedo : source_color;
  5. uniform sampler2D texture_albedo : source_color, filter_nearest, repeat_enable;
  6. uniform sampler2D texture_backlight : hint_default_black, filter_nearest, repeat_enable;
  7.  
  8. void vertex() {
  9. mat4 mat_world = mat4(normalize(INV_VIEW_MATRIX[0]), normalize(INV_VIEW_MATRIX[1]), normalize(INV_VIEW_MATRIX[2]), MODEL_MATRIX[3]);
  10. 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));
  11. MODELVIEW_MATRIX = VIEW_MATRIX * mat_world;
  12. MODELVIEW_NORMAL_MATRIX = mat3(MODELVIEW_MATRIX);
  13. }
  14.  
  15. void fragment() {
  16. vec2 base_uv = UV;
  17. vec4 albedo_tex = texture(texture_albedo, base_uv);
  18. vec3 albedo_color = albedo.rgb * albedo_tex.rgb;
  19.  
  20. float intensity = dot(albedo_color, vec3(0.3, 0.59, 0.11));
  21.  
  22. ALBEDO = albedo_color;
  23. ALPHA *= albedo.a * albedo_tex.a;
  24.  
  25. vec3 backlight_tex = texture(texture_backlight, base_uv).rgb;
  26.  
  27. BACKLIGHT = backlight_tex;
  28. ALBEDO = albedo_color *= BACKLIGHT *2.0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment