trimming stuff down.

This commit is contained in:
Bryce Covert
2015-10-26 14:41:34 +01:00
parent 56f1d94269
commit dc5c4d71d5
27 changed files with 1755 additions and 1779 deletions

View File

@@ -134,15 +134,36 @@ vec3 BlendHue(vec3 base, vec3 blend)
#define BlendOpacity(base, blend, F, O) (F(base, blend) * O + blend * (1.0 - O))
void main()
void main ()
{
vec2 sz = vec2 (1024.0, 1024.0);
vec3 step = vec3 (1.0 / 4.0, 1.0 / 4.0, 0.0);
vec2 tex_pixel = sz * v_texCoords - step.xy / 2.0;
vec3 multiplied = mix(texture2D(u_texture, v_texCoords).rgb, v_color.rgb * texture2D(u_texture, v_texCoords).rgb, multiply_amount * 0.67 );
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);
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);
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], texture2D(u_texture, v_texCoords).a * v_color.a);
gl_FragColor = vec4(final[0], final[1], final[2], scaledColor.a * v_color.a);
}
")
;
@@ -968,6 +989,7 @@ void main()
(let [[^OrthographicCamera cam] (utils/setup-viewport screen 320 240)]
(set! (. cam zoom) 0.95)
(let [shader (ShaderProgram. ^String v-shader ^String pix-shader)
_ (println (.getLog shader))
_ (update! screen :shader shader)