Skip to content

Commit 91c2717

Browse files
Merge pull request #1169 from vsg-dev/lightDataSize
Added ability to specify the lightDataSize in the fragment shader via specialization consistent with id=3
2 parents cc13034 + 855626d commit 91c2717

File tree

3 files changed

+41486
-41433
lines changed

3 files changed

+41486
-41433
lines changed

src/vsg/state/ViewDependentState.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ void ViewDependentState::init(ResourceRequirements& requirements)
266266
maxShadowMaps = 0;
267267
}
268268

269-
uint32_t lightDataSize = 4 + maxNumberLights * 16 + maxShadowMaps * 16;
269+
// 1 vec3 is used for specifying the number of lights, lagest lightData entries are for spot light with 4 vec4s per light, and each shadowmap takes 8 vec4s.
270+
uint32_t lightDataSize = 1 + maxNumberLights * 4 + maxShadowMaps * 8;
270271

271272
#if 0
272273
if (active)

0 commit comments

Comments
 (0)