Advertisement
Guest User

shadron SWE flag

a guest
Jul 7th, 2017
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. #define H 1.0
  2. #define W 1.6
  3.  
  4. #define Cross 0.2
  5. #define Q1x 0.5
  6. #define Q1y 0.4
  7.  
  8.  
  9. const vec3 YELLOW = vec3(0.9960784313725490196078431372549, 0.8, 0.0);
  10. const vec3 BLUE = vec3(0.0, 0.41568627450980392156862745098039, 0.65490196078431372549019607843137);
  11.  
  12. const ivec2 DIMENSIONS = ivec2(1600, 1000);
  13.  
  14. glsl vec3 SwedishFlag ( vec2 coord ) {
  15. vec2 pos = vec2( W, H ) * coord;
  16. if ( pos.x < Q1x && pos.y < Q1y ) {
  17. return BLUE;
  18. } else if ( pos.x > Q1x + Cross && pos.y < Q1y ) {
  19. return BLUE;
  20. } else if ( pos.x < Q1x && pos.y > Q1y + Cross ) {
  21. return BLUE;
  22. } else if ( pos.x > Q1x + Cross && pos.y > Q1y + Cross ) {
  23. return BLUE;
  24. }
  25. return YELLOW;
  26. }
  27.  
  28. image Sweden = glsl(SwedishFlag, 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( Sweden, 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