mirror of
https://github.com/overte-org/overte.git
synced 2025-08-16 15:52:35 +02:00
fetch the cluster content through a function to be able to change the implementation
This commit is contained in:
parent
c622849481
commit
af48d4f0bd
2 changed files with 5 additions and 1 deletions
|
@ -73,4 +73,8 @@ ivec2 clusterGrid_getCluster(int index) {
|
|||
return ivec2(numLights, contentOffset);
|
||||
}
|
||||
|
||||
int clusterGrid_getClusterLightId(int index, ivec2 cluster) {
|
||||
return _clusterGridContent[cluster.y + index];
|
||||
}
|
||||
|
||||
<@endif@>
|
||||
|
|
|
@ -97,7 +97,7 @@ void main(void) {
|
|||
// int numLights = lightIndex[0];
|
||||
for (int i = 0; i < numLights; i++) {
|
||||
// Need the light now
|
||||
int theLightIndex = _clusterGridContent[lightClusterOffset + i];
|
||||
int theLightIndex = clusterGrid_getClusterLightId(i, cluster);
|
||||
Light light = getLight(theLightIndex);
|
||||
bool isSpot = light_isSpot(light);
|
||||
// Clip againgst the light volume and Make the Light vector going from fragment to light center in world space
|
||||
|
|
Loading…
Reference in a new issue