veloren/assets/voxygen/shaders/player-shadow-frag.glsl

46 lines
791 B
Plaintext
Raw Normal View History

2020-04-04 19:36:55 +00:00
#version 330 core
#include <globals.glsl>
in vec3 f_pos;
in vec3 f_col;
flat in vec3 f_norm;
layout (std140)
uniform u_locals {
mat4 model_mat;
vec4 model_col;
int flags;
};
struct BoneData {
mat4 bone_mat;
};
layout (std140)
uniform u_bones {
BoneData bones[16];
};
#include <sky.glsl>
#include <light.glsl>
#include <srgb.glsl>
out vec4 tgt_color;
void main() {
2020-05-18 22:40:28 +00:00
float distance = distance(vec3(cam_pos), focus_pos.xyz) - 2;
float opacity = clamp(distance / distance_divider, 0, 1);
if(threshold_matrix[int(gl_FragCoord.x) % 4][int(gl_FragCoord.y) % 4] > opacity) {
discard;
}
if(threshold_matrix[int(gl_FragCoord.x) % 4][int(gl_FragCoord.y) % 4] > shadow_dithering) {
discard;
}
2020-04-04 19:36:55 +00:00
tgt_color = vec4(0.0,0.0,0.0, 1.0);
2020-05-18 22:40:28 +00:00
}