trying to fix light culling still
This commit is contained in:
@@ -36,6 +36,15 @@ void LightCullingPass::beginFrame()
|
||||
uniformUpdate.data = (uint8*)&viewParams;
|
||||
viewParamsBuffer->updateContents(uniformUpdate);
|
||||
|
||||
LightEnv lightEnv = scene->getLightBuffer();
|
||||
for(uint32 i = 0; i < lightEnv.numPointLights; ++i)
|
||||
{
|
||||
lightEnv.pointLights[i].positionVS = lightEnv.pointLights[i].positionWS;
|
||||
}
|
||||
uniformUpdate.size = sizeof(PointLight) * MAX_POINT_LIGHTS;
|
||||
uniformUpdate.data = (uint8*)&lightEnv.pointLights;
|
||||
pointLightBuffer->updateContents(uniformUpdate);
|
||||
|
||||
BulkResourceData counterReset;
|
||||
uint32 reset = 0;
|
||||
counterReset.data = (uint8*)&reset;
|
||||
|
||||
@@ -19,14 +19,16 @@ Scene::Scene(Gfx::PGraphics graphics)
|
||||
lightEnv.directionalLights[0].color = Vector4(1, 1, 1, 1);
|
||||
lightEnv.directionalLights[0].direction = Vector4(1, 1, 0, 1);
|
||||
lightEnv.directionalLights[0].intensity = Vector4(1, 1, 1, 1);
|
||||
lightEnv.numDirectionalLights = 1;
|
||||
lightEnv.numDirectionalLights = 0;
|
||||
srand((unsigned int)time(NULL));
|
||||
for(uint32 i = 0; i < MAX_POINT_LIGHTS/2; ++i)
|
||||
for(uint32 i = 0; i < 1; ++i)
|
||||
{
|
||||
lightEnv.pointLights[i].colorRange = Vector4(frand(), frand(), frand(), frand() * 30);
|
||||
lightEnv.pointLights[i].positionWS = Vector4(frand() * 100-50, frand(), frand() * 100-50, 1);
|
||||
}
|
||||
lightEnv.numPointLights = MAX_POINT_LIGHTS/2;
|
||||
lightEnv.numPointLights = 1;
|
||||
lightEnv.pointLights[0].colorRange = Vector4(1, 0, 0, 100);
|
||||
lightEnv.pointLights[0].positionWS = Vector4(0, 10, 0, 1);
|
||||
}
|
||||
|
||||
Scene::~Scene()
|
||||
|
||||
Reference in New Issue
Block a user