/
obj.frag.input
54 lines (41 loc) · 1.46 KB
/
obj.frag.input
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#version 450
#extension GL_ARB_separate_shader_objects : enable
const int MAX_MATERIALS_PER_MODEL = 32;
const int MAX_MODELS = 128;
INCLUDE(../../data/glsl/lighting.glsl)
layout(std140, set = 1, binding = 1) uniform material_ubo
{
Material materials[MAX_MATERIALS_PER_MODEL * MAX_MODELS];
} Mat;
layout(std140, set = 2, binding = 0) uniform light_ubo
{
Light sun;
} L;
struct ShadowMapData {
mat4 light_viewproj;
uint shadow_map_size;
uint pfc_kernel_size; /* Overriden by specialization constant */
};
layout (constant_id = 0) const int SHADOW_MAP_PCF_KERNEL_SIZE = 2;
layout(std140, set = 2, binding = 1) uniform ubo_shadow_map_data {
ShadowMapData shadow_map_data;
} SMD;
layout(set = 3, binding = 0) uniform sampler2DShadow shadow_map;
layout(set = 4, binding = 0) uniform sampler2D tex_diffuse;
layout(set = 4, binding = 1) uniform sampler2D tex_normal;
layout(set = 4, binding = 2) uniform sampler2D tex_specular;
layout(location = 0) in vec2 in_uv;
layout(location = 1) flat in uint in_material_idx;
layout(location = 2) in vec3 in_eye_normal;
layout(location = 3) in vec4 in_eye_pos;
layout(location = 4) in vec3 in_eye_view_dir;
layout(location = 5) in vec4 in_eye_light_pos;
layout(location = 6) in vec4 in_light_space_pos;
layout(location = 7) in vec3 in_eye_tangent;
layout(location = 8) in vec3 in_eye_bitangent;
layout(location = 9) in vec3 in_debug;
layout(location = 0) out vec4 out_color;
void main()
{
INCLUDE(compute_forward_lighting.glsl)
}