feat: basic shadow map + renderdoc labels
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user