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/Source Code/Managers/LightManager.cpp

Diff revisions: vs.
  @@ -68,15 +68,13 @@
68 68
69 69 GFX_DEVICE.add2DRenderFunction(
70 70 DELEGATE_BIND(&LightManager::previewShadowMaps, this, nullptr), 1);
71 - // NORMAL holds general info about the currently active
72 - // lights: position, color, etc.
71 + // NORMAL holds general info about the currently active lights: position, color, etc.
73 72 _lightShaderBuffer[to_const_uint(ShaderBufferType::NORMAL)] = GFX_DEVICE.newSB("dvd_LightBlock",
74 73 1,
75 74 true,
76 75 false,
77 76 BufferUpdateFrequency::OCASSIONAL);
78 - // SHADOWS holds info about the currently active shadow
79 - // casting lights:
77 + // SHADOWS holds info about the currently active shadow casting lights:
80 78 // ViewProjection Matrices, View Space Position, etc
81 79 // Should be SSBO (not UBO) to use std430 alignment. Structures should not be padded
82 80 _lightShaderBuffer[to_const_uint(ShaderBufferType::SHADOW)] = GFX_DEVICE.newSB("dvd_ShadowBlock",
  @@ -362,33 +360,14 @@
362 360 offset = range;
363 361 }
364 362
365 - uploadLightData(LightType::COUNT, ShaderBufferLocation::LIGHT_NORMAL);
363 + uploadLightData(ShaderBufferLocation::LIGHT_NORMAL);
366 364
367 365 _lightShaderBuffer[to_const_uint(ShaderBufferType::SHADOW)]->updateData(0, lightShadowPropertiesCount, _lightShadowProperties.data());
368 366 _lightShaderBuffer[to_const_uint(ShaderBufferType::SHADOW)]->bind(ShaderBufferLocation::LIGHT_SHADOW);
369 367 }
370 368
371 - void LightManager::uploadLightData(LightType lightsByType, ShaderBufferLocation location) {
372 - if (lightsByType == LightType::COUNT) {
373 - _lightShaderBuffer[to_const_uint(ShaderBufferType::NORMAL)]->bind(location);
374 - return;
375 - }
376 -
377 - U32 offset = 0;
378 - switch(lightsByType) {
379 - case LightType::DIRECTIONAL:
380 - offset = 0;
381 - break;
382 - case LightType::POINT:
383 - offset = _activeLightCount[to_const_uint(LightType::DIRECTIONAL)];
384 - break;
385 - case LightType::SPOT:
386 - offset = _activeLightCount[to_const_uint(LightType::POINT)];
387 - break;
388 - };
389 -
390 - U32 range = _activeLightCount[to_uint(lightsByType)];
391 - _lightShaderBuffer[to_const_uint(ShaderBufferType::NORMAL)]->bindRange(location, offset, range);
369 + void LightManager::uploadLightData(ShaderBufferLocation location) {
370 + _lightShaderBuffer[to_const_uint(ShaderBufferType::NORMAL)]->bind(location);
392 371 }
393 372
394 373 void LightManager::drawLightImpostors() const {