Code cleanup, simplification

This commit is contained in:
Sascha Willems 2024-01-20 13:05:02 +01:00
parent 3dd195fe35
commit b92e210bbe
8 changed files with 285 additions and 396 deletions

View file

@ -2,11 +2,6 @@
layout (location = 0) out vec2 outUV;
out gl_PerVertex
{
vec4 gl_Position;
};
void main()
{
outUV = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2);

View file

@ -6,6 +6,7 @@ layout (binding = 0) uniform UBO {
mat4 projection;
mat4 modelview;
mat4 inverseModelview;
float exposure;
} ubo;
layout (location = 0) in vec3 inUVW;
@ -22,10 +23,6 @@ layout (constant_id = 0) const int type = 0;
#define PI 3.1415926
#define TwoPI (2.0 * PI)
layout (binding = 2) uniform Exposure {
float exposure;
} exposure;
void main()
{
vec4 color;
@ -86,7 +83,7 @@ void main()
// Color with manual exposure into attachment 0
outColor0.rgb = vec3(1.0) - exp(-color.rgb * exposure.exposure);
outColor0.rgb = vec3(1.0) - exp(-color.rgb * ubo.exposure);
// Bright parts for bloom into attachment 1
float l = dot(outColor0.rgb, vec3(0.2126, 0.7152, 0.0722));

Binary file not shown.

View file

@ -9,6 +9,7 @@ layout (binding = 0) uniform UBO {
mat4 projection;
mat4 modelview;
mat4 inverseModelview;
float exposure;
} ubo;
layout (location = 0) out vec3 outUVW;
@ -17,11 +18,6 @@ layout (location = 2) out vec3 outNormal;
layout (location = 3) out vec3 outViewVec;
layout (location = 4) out vec3 outLightVec;
out gl_PerVertex
{
vec4 gl_Position;
};
void main()
{
outUVW = inPos;

Binary file not shown.