Demo reel build

This commit is contained in:
2024-09-17 23:56:50 -07:00
parent 27fa657f92
commit b7a982d340
75 changed files with 4531 additions and 220 deletions

View File

@@ -15,15 +15,15 @@ uniform sampler2D to_gradient: hint_default_black;
int dithering_pattern(ivec2 fragcoord) {
const int pattern[] = {
-4, +0, -3, +1,
+2, -2, +3, -1,
-3, +1, -4, +0,
-4, +0, -3, +1,
+2, -2, +3, -1,
-3, +1, -4, +0,
+3, -1, +2, -2
};
int x = fragcoord.x % 4;
int y = fragcoord.y % 4;
return pattern[y * 4 + x];
}
@@ -55,7 +55,7 @@ vec3 rgb2hsv(vec3 rgb) { //Converts RGB values to HSV
s = delta / cmax;
}
return vec3(h,s,cmax); // Keep original alpha value
return vec3(h,s,cmax); // Keep original alpha value
}
@@ -91,13 +91,13 @@ vec3 hsv2rgb(vec3 hsv) { //Converts HSV values to RGB
rgb[1] = rgb[1] + m;
rgb[2] = rgb[2] + m;
return rgb;
return rgb;
}
void fragment() {
ivec2 uv;
vec3 color;
if(scale_resolution){
uv = ivec2(FRAGCOORD.xy / float(target_resolution_scale));
color = texelFetch(TEXTURE, uv * target_resolution_scale, 0).rgb;
@@ -105,7 +105,7 @@ void fragment() {
uv = ivec2(FRAGCOORD.xy);
color = texelFetch(TEXTURE, uv, 0).rgb;
}
if(enable_recolor){
vec3 hsv = rgb2hsv(color);
float color_pos = (hsv.x / 360.0);
@@ -117,15 +117,15 @@ void fragment() {
color.rgb = final_rgb;
}
// Convert from [0.0, 1.0] range to [0, 255] range
ivec3 c = ivec3(round(color * 255.0));
// Apply the dithering pattern
if (dithering) {
c += ivec3(dithering_pattern(uv));
}
vec3 final_color;
if(change_color_depth){
// Truncate from 8 bits to color_depth bits
@@ -134,7 +134,7 @@ void fragment() {
} else {
final_color = vec3(c) / float(1 << 8);
}
// Convert back to [0.0, 1.0] range
COLOR.rgb = final_color;
}