mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 02:29:17 +02:00
motion blur
This commit is contained in:
@@ -2,9 +2,12 @@
|
||||
|
||||
in vec3 f_normal;
|
||||
in vec2 f_coord;
|
||||
in vec3 f_pos;
|
||||
in vec4 f_pos;
|
||||
in vec4 f_light_pos;
|
||||
|
||||
in vec4 f_clip_pos;
|
||||
in vec4 f_clip_future_pos;
|
||||
|
||||
#include <common>
|
||||
|
||||
#param (color, 0, 0, 4, diffuse)
|
||||
@@ -28,7 +31,7 @@ void main()
|
||||
discard;
|
||||
|
||||
vec3 normal = normalize(f_normal);
|
||||
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;
|
||||
@@ -55,5 +58,13 @@ 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, tex_color.a < 0.9f ? 0.0f : 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user