Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 194 vs 247 for /trunk/Source Code/Rendering/Lighting/ShadowMapping/ShadowMap.cpp

Diff revisions: vs.
  @@ -10,6 +10,7 @@
10 10 _init(false),
11 11 _isBound(false),
12 12 _light(light),
13 + _shadowMapType(type),
13 14 _par(ParamHandler::getInstance())
14 15 {
15 16 }
  @@ -32,19 +33,21 @@
32 33
33 34 ShadowMap* ShadowMapInfo::getOrCreateShadowMap(const SceneRenderState& renderState){
34 35 if(_shadowMap) return _shadowMap;
36 +
35 37 if(!_light->castsShadows()) return NULL;
38 +
36 39 switch(_light->getLightType()){
37 - case LIGHT_TYPE_POINT:
38 - _shadowMap = New CubeShadowMap(_light);
39 - break;
40 - case LIGHT_TYPE_DIRECTIONAL:
41 - _shadowMap = New PSShadowMaps(_light);
42 - break;
43 - case LIGHT_TYPE_SPOT:
44 - _shadowMap = New SingleShadowMap(_light);
45 - break;
46 - default:
47 - break;
40 + case LIGHT_TYPE_POINT:
41 + _shadowMap = New CubeShadowMap(_light);
42 + break;
43 + case LIGHT_TYPE_DIRECTIONAL:
44 + _shadowMap = New PSShadowMaps(_light);
45 + break;
46 + case LIGHT_TYPE_SPOT:
47 + _shadowMap = New SingleShadowMap(_light);
48 + break;
49 + default:
50 + break;
48 51 };
49 52 _shadowMap->resolution(_resolution, renderState);
50 53 return _shadowMap;
  @@ -60,9 +63,9 @@
60 63 if(getShadowMapType() == SHADOW_TYPE_PSSM){
61 64 _depthMap->Bind(offset, TextureDescriptor::Color0);
62 65 _depthMap->UpdateMipMaps(TextureDescriptor::Color0);
63 - }else
66 + }else{
64 67 _depthMap->Bind(offset, TextureDescriptor::Depth);
65 -
68 + }
66 69 }
67 70
68 71 return true;