1
0
Fork 0
fgdata/Shaders/HDR/geometry-chrome.frag
Fernando García Liñán 9f39644199 HDR: Optimize the G-Buffer and do not separate the occlusion texture
- The G-Buffer layout has been redesigned to be 96 bits per pixel. There are 24
unused bits that can be used for extra material parameters later (like
clearcoat).
- Add better debug views for the G-Buffer.
- Use octahedron normal encoding. This yields the same results as the previous
method but uses 16 bits less.
- Use rg11fb10f for the environment mapping cubemaps.
- Tweak the shadow mapping parameters and add a colored debug mode.
- Only render shadow maps for objects that inherit from model-default.eff or
model-pbr.eff instead of having a fallback Effect. Now transparent objects
should be ignored (if they are marked as such with model-transparent or
similar).
- Remove the separate occlusion texture. Now the PBR Effect expects a single
texture where R=occlusion, G=roughness and B=metallic.
2021-08-27 00:03:43 +02:00

23 lines
531 B
GLSL

#version 330 core
layout(location = 0) out vec4 outGBuffer0;
layout(location = 1) out vec4 outGBuffer1;
layout(location = 2) out vec4 outGBuffer2;
in vec3 normalVS;
const float CHROME_METALNESS = 1.0;
const float CHROME_ROUGHNESS = 0.1;
vec2 encodeNormal(vec3 n);
void main()
{
outGBuffer0.rg = encodeNormal(normalVS);
outGBuffer0.b = CHROME_ROUGHNESS;
outGBuffer0.a = 1.0;
outGBuffer1.rgb = vec3(1.0);
outGBuffer1.a = CHROME_METALNESS;
outGBuffer2.rgb = vec3(0.0);
outGBuffer2.a = 1.0;
}