Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define H 0.3
- #define W 0.6
- #define rw 0.06
- #define rh 0.06
- #define bw 0.25
- #define bh 0.10
- #define ww 0.02
- #define wh 0.02
- #define x 0.06
- #define x1 0.011111111111111
- const vec3 RED = vec3(0.77647058823529411764705882352941, 0.06274509803921568627450980392157, 0.09411764705882352941176470588235);
- const vec3 BLUE = vec3(0.0, 0.15294117647058823529411764705882, 0.46274509803921568627450980392157);
- const vec3 WHITE = vec3(1.0, 1.0, 1.0);
- const ivec2 DIMENSIONS = ivec2(1200, 600);
- glsl vec3 UnitedKingdomFlag ( vec2 coord ) {
- vec2 pos = vec2( W, H ) * coord;
- if ( pos.x >= bw + ww && pos.r <= bw + ww + rw || pos.y >= bh + wh && pos.y < bh + wh + rh ) {
- return RED;
- } else if ( pos.r >= bw && pos.r <= bw + ww + rw + ww || pos.y >= bh && pos.y <= bh + wh + rh + wh ) {
- return WHITE;
- }
- if ( pos.y < 0.15 ) {
- if ( pos.y < 0.5 * pos.r + -x1 - x1 && pos.y > 0.5 * pos.r - x1 - x1 - x1 ) {
- return WHITE;
- } else if ( pos.y > 0.5 * pos.r + -x1 - x1 && pos.y < 0.5 * pos.r + 0 ) {
- return RED;
- } else if ( pos.y > 0.5 * pos.r + 0 && pos.y < 0.5 * pos.r + x1 + x1 + x1 ) {
- return WHITE;
- }
- if ( pos.y < -0.5 * pos.r + 0.3 - 0 && pos.y > -0.5 * pos.r + 0.3 - x1 - x1 - x1 ) {
- return WHITE;
- } else if ( pos.y > -0.5 * pos.r + 0.3 - x1 + x1 && pos.y < -0.5 * pos.r + 0.3 + x1 + x1 ) {
- return RED;
- } else if ( pos.y > -0.5 * pos.r + 0.3 - x1 && pos.y < -0.5 * pos.r + 0.3 + x1 + x1 + x1 ) {
- return WHITE;
- }
- } else if ( pos.y > 0.15 ) {
- if ( pos.y < 0.5 * pos.r -0 && pos.y > 0.5 * pos.r - x1 - x1 - x1) {
- return WHITE;
- } else if ( pos.y > 0.5 * pos.r - x1+x1 && pos.y < 0.5 * pos.r + x1+x1 ) {
- return RED;
- } else if ( pos.y > 0.5 * pos.r - x1 && pos.y < 0.5 * pos.r + x1 + x1 + x1 ) {
- return WHITE;
- }
- if ( pos.y < -0.5 * pos.r + 0.3 + -x1 - x1 && pos.y > -0.5 * pos.r + 0.3 - x1 - x1 - x1 ) {
- return WHITE;
- } else if ( pos.y > -0.5 * pos.r + 0.3 + -x1 - x1 && pos.y < -0.5 * pos.r + 0.3 + 0 ) {
- return RED;
- } else if ( pos.y > -0.5 * pos.r + 0.3 + 0 && pos.y < -0.5 * pos.r + 0.3 + x1 + x1 + x1 ) {
- return WHITE;
- }
- }
- return BLUE;
- }
- image UnitedKingdom = glsl(UnitedKingdomFlag, 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( UnitedKingdom, coord ).rgb;
- return diffFactor * abs( b - a );
- }
- //image Differance = glsl(Compare, DIMENSIONS);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement