2023-04-07 08:17:37 +02:00
|
|
|
#version 330 core
|
|
|
|
|
2024-01-31 00:24:01 +01:00
|
|
|
in VS_OUT {
|
|
|
|
float flogz;
|
|
|
|
vec3 vertex_normal;
|
|
|
|
} fs_in;
|
2023-04-07 08:17:37 +02:00
|
|
|
|
|
|
|
const float CHROME_METALLIC = 1.0;
|
|
|
|
const float CHROME_ROUGHNESS = 0.1;
|
|
|
|
|
|
|
|
// gbuffer_pack.glsl
|
|
|
|
void gbuffer_pack(vec3 normal, vec3 base_color, float metallic, float roughness,
|
|
|
|
float occlusion, vec3 emissive, uint mat_id);
|
2024-01-31 00:24:01 +01:00
|
|
|
// logarithmic_depth.glsl
|
|
|
|
float logdepth_encode(float z);
|
2023-04-07 08:17:37 +02:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2024-01-31 00:24:01 +01:00
|
|
|
vec3 N = normalize(fs_in.vertex_normal);
|
2023-04-17 05:09:24 +02:00
|
|
|
gbuffer_pack(N, vec3(1.0), CHROME_METALLIC, CHROME_ROUGHNESS, 1.0, vec3(0.0), 3u);
|
2024-01-31 00:24:01 +01:00
|
|
|
gl_FragDepth = logdepth_encode(fs_in.flogz);
|
2023-04-07 08:17:37 +02:00
|
|
|
}
|