lots of weird changes to frag shader.
This commit is contained in:
@@ -1 +1 @@
|
||||
4
|
||||
5
|
||||
|
||||
@@ -113,29 +113,30 @@ vec3 HUEtoRGB(float H)
|
||||
return clamp(vec3(R,G,B), 0.0, 1.0);
|
||||
}
|
||||
|
||||
vec3 HSLtoRGB(vec3 HSL)
|
||||
vec4 HSLtoRGB(vec3 HSL)
|
||||
{
|
||||
vec3 RGB = HUEtoRGB(HSL.x);
|
||||
float C = (1.0 - abs(2.0 * HSL.z - 1.0)) * HSL.y;
|
||||
return (RGB - 0.5) * C + HSL.z;
|
||||
vec3 result = (RGB - 0.5) * C + HSL.z;
|
||||
return vec4(result[0], result[1], result[2], 0.0);
|
||||
}
|
||||
|
||||
|
||||
vec3 RGBtoHSL(vec3 RGB)
|
||||
vec4 RGBtoHSL(vec4 RGB)
|
||||
{
|
||||
vec3 HCV = RGBtoHCV(RGB);
|
||||
vec3 HCV = RGBtoHCV(RGB.rgb);
|
||||
float L = HCV.z - HCV.y * 0.5;
|
||||
float S = HCV.y / (1.0 - abs(L * 2.0 - 1.0) + Epsilon);
|
||||
return vec3(HCV.x, S, L);
|
||||
return vec4(HCV.x, S, L, 0.0);
|
||||
}
|
||||
|
||||
vec3 BlendHue(vec3 base, vec3 blend)
|
||||
vec4 BlendHue(vec4 base, vec4 blend)
|
||||
{
|
||||
if (blend.r == blend.g && blend.g == blend.b) {
|
||||
return base;
|
||||
}
|
||||
else {
|
||||
vec3 baseHSL = RGBtoHSL(base);
|
||||
vec4 baseHSL = RGBtoHSL(base);
|
||||
return HSLtoRGB(vec3(RGBtoHSL(blend).r, baseHSL.g, baseHSL.b));
|
||||
}
|
||||
}
|
||||
@@ -150,27 +151,27 @@ void main ()
|
||||
vec2 sz = vec2 (2048.0, 2048.0);
|
||||
vec3 step = vec3 (1.0 / 4.0, 1.0 / 4.0, 0.0);
|
||||
vec2 tex_pixel = sz * v_texCoords - step.xy / 2.0;
|
||||
float a = texture2D (u_texture, v_texCoords).w;
|
||||
|
||||
vec2 corner = floor (tex_pixel) + 1.0;
|
||||
vec2 frac = min ((corner - tex_pixel) * vec2 (4.0, 4.0), vec2 (1.0, 1.0));
|
||||
vec2 corner = floor (tex_pixel) + 1.0;
|
||||
vec2 frac = min ((corner - tex_pixel) * vec2 (4.0, 4.0), vec2 (1.0, 1.0));
|
||||
|
||||
vec4 c1 = texture2D (u_texture, (floor (tex_pixel + step.zz) + 0.5) / sz);
|
||||
vec4 c2 = texture2D (u_texture, (floor (tex_pixel + step.xz) + 0.5) / sz);
|
||||
vec4 c3 = texture2D (u_texture, (floor (tex_pixel + step.zy) + 0.5) / sz);
|
||||
vec4 c4 = texture2D (u_texture, (floor (tex_pixel + step.xy) + 0.5) / sz);
|
||||
vec4 c1 = texture2D (u_texture, (floor (tex_pixel + step.zz) + 0.5) / sz);
|
||||
vec4 c2 = texture2D (u_texture, (floor (tex_pixel + step.xz) + 0.5) / sz);
|
||||
vec4 c3 = texture2D (u_texture, (floor (tex_pixel + step.zy) + 0.5) / sz);
|
||||
vec4 c4 = texture2D (u_texture, (floor (tex_pixel + step.xy) + 0.5) / sz);
|
||||
|
||||
c1 *= frac.x * frac.y;
|
||||
c2 *= (1.0 - frac.x) * frac.y;
|
||||
c3 *= frac.x * (1.0 - frac.y);
|
||||
c4 *= (1.0 - frac.x) * (1.0 - frac.y);
|
||||
c1 *= frac.x * frac.y;
|
||||
c2 *= (1.0 - frac.x) * frac.y;
|
||||
c3 *= frac.x * (1.0 - frac.y);
|
||||
c4 *= (1.0 - frac.x) * (1.0 - frac.y);
|
||||
vec4 scaledColor = (c1 + c2 + c3 + c4);
|
||||
|
||||
vec4 scaledColor = (c1 + c2 + c3 + c4);
|
||||
vec4 multiplied = mix(scaledColor.rgba, v_color.rgba * scaledColor.rgba, multiply_amount * 0.67 );
|
||||
vec4 hued = mix(multiplied, BlendHue(multiplied.rgba, v_color.rgba), hue_amount * 0.67);
|
||||
vec4 final = hued;
|
||||
|
||||
vec3 multiplied = mix(scaledColor.rgb, v_color.rgb * scaledColor.rgb, multiply_amount * 0.67 );
|
||||
vec3 hued = mix(multiplied, BlendHue(multiplied.rgb, v_color.rgb), hue_amount * 0.67);
|
||||
vec3 final = hued;
|
||||
|
||||
gl_FragColor = vec4(final[0], final[1], final[2], scaledColor.a * v_color.a);
|
||||
gl_FragColor = vec4(final.xyz, a);
|
||||
|
||||
}
|
||||
")
|
||||
@@ -1434,7 +1435,7 @@ void main ()
|
||||
[last-pos-x last-pos-y] (utils/unproject screen nil last-pos)
|
||||
last-pos-x (double last-pos-x)
|
||||
last-pos-y (double last-pos-y)
|
||||
#_#_entities (if (and (@utils/settings :camera-man? true)
|
||||
entities (if (and (@utils/settings :camera-man? true)
|
||||
(not (get-in entities [:cam :paused?]))
|
||||
(nil? (get-in entities [:tweens :cam-x]))
|
||||
(= 1 (rand-int 20)))
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.0.4</string>
|
||||
<string>2.0.5</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<string>19</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>8.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
|
||||
Reference in New Issue
Block a user