Advertisement
Kindo_Saur_Prod

Reddit Post Silhouette Code

Sep 5th, 2022
970
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Godot GLSL 0.44 KB | Source Code | 0 0
  1. shader_type spatial;
  2.  
  3. render_mode depth_test_disable, skip_vertex_transform, unshaded;
  4.  
  5. void vertex() {
  6.  
  7.     VERTEX = (MODELVIEW_MATRIX * vec4(VERTEX, 1.0)).xyz;
  8.    
  9. }
  10.  
  11. void fragment() {
  12.    
  13.     float zdepth = texture(DEPTH_TEXTURE, SCREEN_UV).r;
  14.     float zpos = FRAGCOORD.z;
  15.    
  16.     if (zdepth < zpos) {
  17.        
  18.         ALBEDO = vec3(0,0,0);
  19.         ALPHA = 0.5;
  20.    
  21.     } else {
  22.         discard;
  23.     }
  24. }
  25.  
  26. // credit:  https://github.com/effectivearm7/occludedhighlight
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement