Skip to content

Commit

Permalink
add black/white masks to subpixel mask function
Browse files Browse the repository at this point in the history
  • Loading branch information
hizzlekizzle committed Jun 10, 2022
1 parent 94b4fc4 commit 1472163
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions include/subpixel_masks.h
Expand Up @@ -322,6 +322,26 @@ vec3 mask_weights(vec2 coord, float mask_intensity, int phosphor_layout){
weights = slot[w][z];
return weights;
}

else if(phosphor_layout == 22){
// black and white aperture; good for weird subpixel layouts and low brightness; good for 1080p and lower
vec3 bw3[3] = vec3[](black, white, white);

z = int(floor(mod(coord.x, 3.0)));

weights = bw3[z];
return weights;
}

else if(phosphor_layout == 23){
// black and white aperture; good for weird subpixel layouts and low brightness; good for 4k
vec3 bw4[4] = vec3[](black, black, white, white);

z = int(floor(mod(coord.x, 4.0)));

weights = bw4[z];
return weights;
}

else return weights;
}
Expand Down Expand Up @@ -642,6 +662,28 @@ vec3 mask_weights_alpha(vec2 coord, float mask_intensity, int phosphor_layout, o
alpha = 21./96.;
return weights;
}

else if(phosphor_layout == 22){
// black and white aperture; good for weird subpixel layouts and low brightness; good for 1080p and lower
vec3 bw3[3] = vec3[](black, white, white);

z = int(floor(mod(coord.x, 3.0)));

weights = bw3[z];
alpha = 2./3.;
return weights;
}

else if(phosphor_layout == 23){
// black and white aperture; good for weird subpixel layouts and low brightness; good for 4k
vec3 bw4[4] = vec3[](black, black, white, white);

z = int(floor(mod(coord.x, 4.0)));

weights = bw4[z];
alpha = 0.5;
return weights;
}

else return weights;
}

0 comments on commit 1472163

Please sign in to comment.