16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 13:39:18 +02:00

motion blur

This commit is contained in:
milek7
2018-07-23 01:22:36 +02:00
parent cfb066f678
commit d5ce1d57e7
32 changed files with 358 additions and 159 deletions

View File

@@ -2,10 +2,13 @@
in vec3 f_normal;
in vec2 f_coord;
in vec3 f_pos;
in vec4 f_pos;
in mat3 f_tbn;
in vec4 f_light_pos;
in vec4 f_clip_pos;
in vec4 f_clip_future_pos;
#include <common>
#param (color, 0, 0, 4, diffuse)
@@ -33,7 +36,7 @@ void main()
discard;
vec3 normal = f_tbn * normalize(texture(normalmap, f_coord).rgb * 2.0 - 1.0);
vec3 refvec = reflect(f_pos, normal);
vec3 refvec = reflect(f_pos.xyz, normal);
vec3 envcolor = texture(envmap, refvec).rgb;
vec3 result = ambient * 0.5 + param[0].rgb * emission;
@@ -60,5 +63,11 @@ void main()
result += light.color * (part.x * param[1].x + part.y * param[1].y);
}
gl_FragColor = vec4(apply_fog(result * tex_color.rgb), tex_color.a);
gl_FragData[0] = vec4(apply_fog(result * tex_color.rgb), tex_color.a);
{
vec2 a = (f_clip_future_pos.xy / f_clip_future_pos.w) * 0.5 + 0.5;;
vec2 b = (f_clip_pos.xy / f_clip_pos.w) * 0.5 + 0.5;;
gl_FragData[1] = vec4(a - b, 0.0f, 0.0f);
}
}