Merge branch 'master' of https://github.com/tmj-fstate/maszyna into tmj-master

This commit is contained in:
stele
2020-03-09 19:15:01 +01:00
49 changed files with 1026 additions and 410 deletions

View File

@@ -111,15 +111,15 @@ vec2 calc_headlights(light_s light, vec3 fragnormal)
vec3 apply_lights(vec3 fragcolor, vec3 fragnormal, vec3 texturecolor, float reflectivity, float specularity, float shadowtone)
{
fragcolor *= param[0].rgb;
fragcolor *= param[1].x;
vec3 emissioncolor = param[0].rgb * emission;
vec3 envcolor = envmap_color(fragnormal);
if(lights_count == 0U)
return (fragcolor + emissioncolor + envcolor * reflectivity) * texturecolor;
// fragcolor *= lights[0].intensity;
// fragcolor *= lights[0].intensity;
vec2 sunlight = calc_dir_light(lights[0], fragnormal);
float diffuseamount = (sunlight.x * param[1].x) * lights[0].intensity;

View File

@@ -0,0 +1,21 @@
in vec2 f_coords;
layout(location = 0) out vec4 out_color;
#texture (color_tex, 0, RGB)
uniform sampler2D iChannel0;
void main()
{
float amount = 0.001;
vec2 uv = f_coords;
vec3 col;
col.r = texture( iChannel0, vec2(uv.x+amount,uv.y) ).r;
col.g = texture( iChannel0, uv ).g;
col.b = texture( iChannel0, vec2(uv.x-amount,uv.y) ).b;
col *= (1.0 - amount * 0.5);
out_color = vec4(col,1.0);
}