color changes
This commit is contained in:
Binary file not shown.
Binary file not shown.
BIN
src/game/data/puzzles/0.pzl
LFS
BIN
src/game/data/puzzles/0.pzl
LFS
Binary file not shown.
Binary file not shown.
@@ -86,12 +86,26 @@ float dither(float brightness, vec2 inputUv)
|
||||
|
||||
vec4 rgbToCmyk(vec3 rgb)
|
||||
{
|
||||
return vec4(1.0, 1.0, 1.0, 1.0);
|
||||
float k = min(1.0 - rgb.r, min(1.0 - rgb.g, 1.0 - rgb.b));
|
||||
vec3 cmy = vec3(0.0, 0.0, 0.0);
|
||||
float invK = 1.0 - k;
|
||||
if (invK != 0.0)
|
||||
{
|
||||
cmy.x = 1.0 - rgb.r - k;
|
||||
cmy.y = 1.0 - rgb.g - k;
|
||||
cmy.z = 1.0 - rgb.b - k;
|
||||
cmy /= invK;
|
||||
}
|
||||
return saturate(vec4(cmy, k));
|
||||
}
|
||||
|
||||
vec3 cmykToRgb(vec4 cmyk)
|
||||
{
|
||||
return vec3(1.0, 1.0, 1.0);
|
||||
float invK = 1.0 - cmyk.w;
|
||||
float r = 1.0 - min(1.0, cmyk.x * invK + cmyk.w);
|
||||
float g = 1.0 - min(1.0, cmyk.y * invK + cmyk.w);
|
||||
float b = 1.0 - min(1.0, cmyk.z * invK + cmyk.w);
|
||||
return saturate(vec3(r,g,b));
|
||||
}
|
||||
|
||||
vec2 rotateUV(vec2 uv, vec2 angle)
|
||||
@@ -117,17 +131,17 @@ void main()
|
||||
float r = dither(texColor.r * brightness, v_uv0);
|
||||
float g = dither(texColor.g * brightness, v_uv0);
|
||||
float b = dither(texColor.b * brightness, v_uv0);
|
||||
vec3 ditheredColor = vec3(r,g,b);
|
||||
// vec3 ditheredColor = vec3(r,g,b);
|
||||
|
||||
vec4 cmyk = rgbToCmyk(texColor * brightness);
|
||||
cmyk.x = dither(cmyk.x, rotateUV(v_uv0, float2(0.966, 0.259)));
|
||||
cmyk.y = dither(cmyk.y, rotateUV(v_uv0, float2(0.259, 0.966)));
|
||||
cmyk.z = dither(cmyk.z, rotateUV(v_uv0, float2(1.000, 0.000)));
|
||||
cmyk.w = dither(cmyk.w, rotateUV(v_uv0, float2(0.707, 0.707)));
|
||||
// vec3 ditheredColor = cmykToRgb(cmyk);
|
||||
vec3 ditheredColor = cmykToRgb(cmyk);
|
||||
|
||||
// finalize
|
||||
vec3 finalColor = mix(baseColor, ditheredColor, ditheredColor);
|
||||
gl_FragColor = vec4(finalColor, 1.0);
|
||||
// gl_FragColor = vec4(texColor * brightness, 1.0);
|
||||
gl_FragColor = vec4(finalColor.rg, finalColor.b * 0.99, 1.0);
|
||||
// gl_FragColor = vec4(ditheredColor, 1.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user