Untitled
Loading...
Searching...
No Matches
shadow.frag
Go to the documentation of this file.
1
2
3#version 460
4#extension GL_ARB_bindless_texture : require
5
7
8struct Material
9{
10
16 uint pad0;
17 uint pad1;
19 uint pad2;
20 uint pad3;
21
22 sampler2D albedo_tex;
23 sampler2D normal_tex;
24 sampler2D arm_tex;
25 sampler2D emissive_tex;
26
27 float metallic;
28 float roughness;
29 float ao_strength;
30 float normal_scale;
31 uint alpha_mode;
32 float alpha_cutoff;
33 uint double_sided;
35
36};
37
38
39layout(std430, binding = 2) buffer MaterialData {
40
41 Material materials[];
42
43};
45flat in uint Mat;
46void main()
47{
48
49
50 Material mat = materials[Mat];
51
52 vec4 albedo = texture(mat.albedo_tex, UV);
53
54 if (albedo.a < 0.5f)
55 {
56 discard;
57 }
58
59}
layout(local_size_x=16, local_size_y=16) in
void main()
in vec2 UV
flat in uint Mat
The GPU side SSBO structure.
sampler2D albedo_tex
float normal_scale
Unused - Used to determine how much of the texture normal to use.
sampler2D emissive_tex
float emissive_strength
sampler2D arm_tex
sampler2D normal_tex
float alpha_cutoff
Used to discard transparent Materials.
float absorption_coefficients[6]
How much audio is absorbed when hitting this Material.
float scattering_coefficients[6]
How much audio specularly reflects when hitting this Material.
The Materials parsed in from scene files that determine rendering pipeline setup, uploads,...
in vec3 FragWorldPos
Definition types.h:11
Definition types.h:12
Definition types.h:13