Răsfoiți Sursa

Bugfix: Fixed an issue where out-of-bounds light data was being rendered by tiled deferred lighting shader

BearishSun 8 ani în urmă
părinte
comite
b88991e052

BIN
Data/Engine/Shaders/TiledDeferredLighting.bsl.asset


+ 2 - 2
Data/Raw/Engine/Shaders/TiledDeferredLighting.bsl

@@ -203,9 +203,9 @@ technique TiledDeferredLighting
 			// Find radial & spot lights overlapping the tile
 			for(uint type = 0; type < 2; type++)
 			{
-				uint lightsStart = threadIndex + gLightStrides[type];
+				uint lightsStart = gLightStrides[type];
 				uint lightsEnd = lightsStart + gLightCounts[type + 1];
-				for (uint i = lightsStart; i < lightsEnd && i < MAX_LIGHTS; i += TILE_SIZE)
+				for (uint i = threadIndex + lightsStart; i < lightsEnd && i < MAX_LIGHTS; i += TILE_SIZE)
 				{
 					float4 lightPosition = mul(gMatView, float4(gLights[i].position, 1.0f));
 					float lightRadius = gLights[i].attRadius;