DonkeyKong64 grind crash
[carveJwlIkooP6JGAAIwe30JlM.git] / shaders / model_character_view.fs
1 uniform sampler2D uTexMain;
2 uniform vec3 uCamera;
3
4 in vec4 aColour;
5 in vec2 aUv;
6 in vec3 aNorm;
7 in vec3 aCo;
8 in vec3 aWorldCo;
9
10 #include "common_world.glsl"
11 #include "motion_vectors_fs.glsl"
12 #include "depth_compare.glsl"
13
14 void main(){
15 depth_compare_dither();
16 compute_motion_vectors();
17
18 vec3 qnorm = aNorm;
19 vec3 diffuse = texture( uTexMain, aUv ).rgb;
20 vec3 composite = world_compute_lighting( diffuse, qnorm, aWorldCo, 1.0 );
21
22 float dist = distance( aWorldCo, uCamera ) - 0.08;
23 float opacity = clamp( dist*dist, 0.0, 1.0 );
24
25 oColour = vec4( composite, opacity );
26 }