feat: basic shadow map + renderdoc labels

This commit is contained in:
2026-10-11 01:02:26 +02:00
parent 4bf87bd91b
commit 95d1497169
36 changed files with 880 additions and 228 deletions
+11 -1
View File
@@ -6,6 +6,7 @@
#include "scene_data.glsl"
#include "mesh_pcs.glsl"
#include "lighting.glsl"
#include "shadows.glsl"
layout (location = 0) in vec3 inPos;
layout (location = 1) in vec2 inUV;
@@ -69,8 +70,17 @@ void main()
uint lightIndex = pcs.sceneData.tileLightIndices.data[tileOffset + 1 + i];
Light light = pcs.sceneData.lights.data[lightIndex];
float occlusion = 1.0;
if (light.castShadows != 0) {
occlusion = calculateDirectionalShadow(
fragPos, n,
pcs.sceneData.lightViewProj,
pcs.sceneData.shadowMapId,
pcs.sceneData.shadowNormalOffset);
}
fragColor += calculateLight(light, fragPos, n, v,
diffuseColor, roughness, metallic, f0);
diffuseColor, roughness, metallic, f0, occlusion);
}
// emissive