Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define H 1.0
- #define W 1.6
- #define Cross 0.2
- #define Q1x 0.5
- #define Q1y 0.4
- const vec3 YELLOW = vec3(0.9960784313725490196078431372549, 0.8, 0.0);
- const vec3 BLUE = vec3(0.0, 0.41568627450980392156862745098039, 0.65490196078431372549019607843137);
- const ivec2 DIMENSIONS = ivec2(1600, 1000);
- glsl vec3 SwedishFlag ( vec2 coord ) {
- vec2 pos = vec2( W, H ) * coord;
- if ( pos.x < Q1x && pos.y < Q1y ) {
- return BLUE;
- } else if ( pos.x > Q1x + Cross && pos.y < Q1y ) {
- return BLUE;
- } else if ( pos.x < Q1x && pos.y > Q1y + Cross ) {
- return BLUE;
- } else if ( pos.x > Q1x + Cross && pos.y > Q1y + Cross ) {
- return BLUE;
- }
- return YELLOW;
- }
- image Sweden = glsl(SwedishFlag, DIMENSIONS);
- param float diffFactor = 1.0 : logrange (1.0, 256.0);
- //image Reference = file();
- glsl vec3 Compare(vec2 coord) {
- vec3 a = texture( Reference, coord ).rgb;
- vec3 b = texture( Sweden, coord ).rgb;
- return diffFactor * abs( b - a );
- }
- //image Differance = glsl(Compare, DIMENSIONS);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement