Advertisement
Miraculixx

Untitled

Apr 6th, 2023 (edited)
663
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #version 150
  2.  
  3. #moj_import <fog.glsl>
  4.  
  5. uniform sampler2D Sampler0;
  6.  
  7. uniform vec4 ColorModulator;
  8. uniform float FogStart;
  9. uniform float FogEnd;
  10. uniform vec4 FogColor;
  11. uniform vec4 Color;
  12.  
  13. in float vertexDistance;
  14. in vec4 vertexColor;
  15. in vec2 texCoord0;
  16.  
  17. out vec4 fragColor;
  18.  
  19. // Color --> vec4(r, g, b, alpha)
  20.  
  21. void main() {
  22.     vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator;
  23.     if (color.a < 0.1) {
  24.         discard;
  25.     }
  26.    
  27.     // Static Colors
  28.     vec3 RED = vec3(1.0, 0.0, 0.0); //RED
  29.     vec3 GREEN = vec3(0.0, 1.0, 0.0); //GREEN
  30.     vec3 BLUE = vec3(0.0, 0.0, 1.0); //BLUE
  31.    
  32.     // Filter Colors
  33.     vec3 rawColor = Color.xyz;
  34.     float opacity = Color.a;
  35.     if (rawColor == RED) { // Filter RED
  36.         fragColor = vec4(GREEN, opacity);
  37.        
  38.     } else { // Display Default
  39.         fragColor = linear_fog(vertexColor, vertexDistance, FogStart, FogEnd, FogColor);
  40.     }
  41. }
  42.  
  43. //linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor); - VANILLA
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement