Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 630 vs 631 for /trunk/assets/shaders/GLSL/lightCull.glsl

Diff revisions: vs.
  @@ -121,15 +121,18 @@
121 121 maxZ = uintBitsToFloat(ldsZMax);
122 122
123 123 // loop over the point lights and do a sphere vs. frustum intersection test
124 + uint numDirLights = dvd_lightCountPerType[0];
124 125 uint numPointLights = dvd_lightCountPerType[1];
126 + uint numSpotLights = dvd_lightCountPerType[2];
125 127
128 + uint lightIDXOffset = numDirLights;
126 129 for (uint i = 0; i < numPointLights; i += NUM_THREADS_PER_TILE)
127 130 {
128 131 uint il = localIdxFlattened + i;
129 132
130 133 if (il < numPointLights)
131 134 {
132 - vec4 center = dvd_PointLightSource[il]._positionWV;
135 + vec4 center = dvd_LightSource[il + lightIDXOffset]._positionWV;
133 136 float r = center.w;
134 137 // test if sphere is intersecting or inside frustum
135 138 if (center.z + minZ < r && center.z - maxZ < r)
  @@ -151,8 +154,8 @@
151 154 barrier();
152 155
153 156 // Spot lights.
157 + lightIDXOffset += numPointLights;
154 158 uint uNumPointLightsInThisTile = ldsLightIdxCounter;
155 - uint numSpotLights = dvd_lightCountPerType[2];
156 159
157 160 for (uint i = 0; i < numSpotLights; i += NUM_THREADS_PER_TILE)
158 161 {
  @@ -160,8 +163,8 @@
160 163
161 164 if (il < numSpotLights)
162 165 {
163 - vec4 center = dvd_SpotLightSource[il]._positionWV;
164 - vec3 direction = dvd_SpotLightSource[il]._directionWV.xyz;
166 + vec4 center = dvd_LightSource[il + lightIDXOffset]._positionWV;
167 + vec3 direction = dvd_LightSource[il + lightIDXOffset]._directionWV.xyz;
165 168 float r = center.w * 0.5;
166 169 center.xyz += direction * r;
167 170 // test if sphere is intersecting or inside frustum