non functional deferred rendering and also camera paths and instanced GUIs

This commit is contained in:
Halbear 2026-06-14 13:39:49 +01:00
parent 4569b471d5
commit 2d37c574d6
25 changed files with 933 additions and 315 deletions

View file

@ -0,0 +1,12 @@
#version 450
layout(location = 0) in vec2 inTextCoord;
layout(location = 0) out vec4 outFragColor;
layout(set = 0, binding = 0) uniform sampler2D albedoSampler;
layout(set = 0, binding = 1) uniform sampler2D depthSampler;
void main() {
outFragColor = vec4(texture(albedoSampler, inTextCoord).rgb, 1.0);
}

View file

@ -0,0 +1,8 @@
#version 450
layout(location = 0) out vec2 outTextCoord;
void main() {
outTextCoord = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2);
gl_Position = vec4(outTextCoord.x * 2.0f - 1.0f, outTextCoord.y * - 2.0f + 1.0f, 0.0f, 1.0f);
}

View file

@ -3,7 +3,7 @@
const int MAX_TEXTURES = 500;
layout(location = 0) in vec2 inTextCoords;
layout(location = 0) out vec4 outFragColor;
layout(location = 0) out vec4 outAlbedo;
struct Material{
vec4 diffuseColor;
@ -28,8 +28,8 @@ void main()
if(material.hasTexture == 1){
vec4 texColor = texture(textSampler[material.textureIdx],inTextCoords);
if(texColor.a < 0.1){discard;}
outFragColor = texColor;
outAlbedo = texColor;
} else{
outFragColor = material.diffuseColor;
outAlbedo = material.diffuseColor;
}
}

View file

@ -3,7 +3,7 @@
const int MAX_TEXTURES = 500;
layout(location = 0) in vec2 inTextCoords;
layout(location = 0) out vec4 outFragColor;
layout(location = 0) out vec4 outAlbedo;
struct Material{
vec4 diffuseColor;
@ -28,8 +28,8 @@ void main()
if(material.hasTexture == 1){
vec4 texColor = texture(textSampler[material.textureIdx],inTextCoords);
if(texColor.a < 0.9){discard;}
outFragColor = texColor;
outAlbedo = texColor;
} else{
outFragColor = material.diffuseColor;
outAlbedo = material.diffuseColor;
}
}

View file

@ -3,7 +3,7 @@
const int MAX_TEXTURES = 500;
layout(location = 0) in vec2 inTextCoords;
layout(location = 0) out vec4 outFragColor;
layout(location = 0) out vec4 outAlbedo;
struct Material{
vec4 diffuseColor;
@ -28,8 +28,8 @@ void main()
if(material.hasTexture == 1){
vec4 texColor = texture(textSampler[material.textureIdx],inTextCoords);
if(texColor.a < 0.05 || texColor.a >= 0.9){discard;}
outFragColor = texColor;
outAlbedo = texColor;
} else{
outFragColor = material.diffuseColor;
outAlbedo = material.diffuseColor;
}
}