Advertisement
Guest User

shadron ICE flag

a guest
Jul 7th, 2017
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. #define HEIGHT 1.8
  2. #define WIDTH 2.5
  3.  
  4. #define BH 0.7
  5. #define BW1 0.7
  6. #define BW2 0.14
  7. #define R 0.2
  8. #define W 0.1
  9.  
  10.  
  11. const vec4 WHITE = vec4(1.0, 1.0, 1.0, 1.0);
  12. const vec4 BLUE = vec4(0.0078431372549019607843137254902, 0.32156862745098039215686274509804, 0.61176470588235294117647058823529, 1.0);
  13. const vec4 RED = vec4(0.86274509803921568627450980392157, 0.11764705882352941176470588235294, 0.2078431372549019607843137254902, 1.0);
  14.  
  15.  
  16. const ivec2 DIMENSIONS = ivec2(1280, 922);
  17.  
  18. glsl vec4 IcelandicFlag ( vec2 coord ) {
  19. vec2 pos = vec2( WIDTH, HEIGHT ) * coord;
  20. if ( pos.x >= BW1+W && pos.x <= BW1+W+R || pos.y >= BH+W && pos.y < BH +W+R ) {
  21. return RED;
  22. } else if ( pos.x >= BW1 && pos.x <= BW1 + W + R + W || pos.y >= BH && pos.y <= BH + W + R + W ) {
  23. return WHITE;
  24. }
  25. return BLUE;
  26. }
  27.  
  28. image Iceland = glsl(IcelandicFlag, DIMENSIONS);
  29.  
  30. param float diffFactor = 1.0 : logrange (1.0, 256.0);
  31. //image Reference = file();
  32.  
  33. glsl vec3 Compare(vec2 coord) {
  34. vec3 a = texture( Reference, coord ).rgb;
  35. vec3 b = texture( Iceland, coord ).rgb;
  36. return diffFactor * abs( b - a );
  37. }
  38.  
  39. //image Differance = glsl(Compare, DIMENSIONS);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement