Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 330 vs 331 for /trunk/Source Code/Rendering/Lighting/ShadowMapping/Headers/ShadowMap.h

Diff revisions: vs.
  @@ -41,46 +41,61 @@
41 41 class ShadowMapInfo;
42 42 class SceneRenderState;
43 43
44 - ///All the information needed for a single light's shadowmap
44 + /// All the information needed for a single light's shadowmap
45 45 class ShadowMap {
46 46 public:
47 47 ShadowMap(Light* light, Camera* shadowCamera, ShadowType type);
48 48 virtual ~ShadowMap();
49 - ///Render the scene and save the frame to the shadow map
50 - virtual void render(SceneRenderState& renderState, const DELEGATE_CBK<>& sceneRenderFunction) = 0;
49 +
50 + /// Render the scene and save the frame to the shadow map
51 + virtual void render(SceneRenderState& renderState,
52 + const DELEGATE_CBK<>& sceneRenderFunction) = 0;
51 53 ///Setup needed before rendering the light
52 54 void preRender();
53 55 ///Setup needed after rendering the light
54 56 virtual void postRender();
55 57 ///Get the current shadow mapping tehnique
56 - inline ShadowType getShadowMapType() const { return _shadowMapType; }
57 - inline Framebuffer* getDepthMap() { return _depthMap; }
58 - inline const vectorImpl<F32>& getShadowFloatValues() const { return _shadowFloatValues; }
59 -
60 - U16 resolution();
61 - virtual void resolution(U16 resolution, U8 resolutionFactor) {}
58 + inline ShadowType getShadowMapType() const {
59 + return _shadowMapType;
60 + }
61 +
62 + inline Framebuffer* getDepthMap() {
63 + return _depthMap;
64 + }
65 +
66 + inline const vectorImpl<F32>& getShadowFloatValues() const {
67 + return _shadowFloatValues;
68 + }
69 +
70 + U16 resolution();
71 + virtual void resolution(U16 resolution, U8 resolutionFactor) {
72 + }
62 73
63 74 virtual void init(ShadowMapInfo* const smi) = 0;
64 75 virtual bool Bind(U8 offset);
65 76 virtual void previewShadowMaps() = 0;
66 - virtual void togglePreviewShadowMaps(bool state) {}
67 - virtual void updateResolution(I32 newWidth, I32 newHeight) {}
77 +
78 + virtual void togglePreviewShadowMaps(bool state) {
79 + }
80 +
81 + virtual void updateResolution(I32 newWidth, I32 newHeight) {
82 + }
68 83
69 84 protected:
70 85 virtual bool BindInternal(U8 offset);
71 86
72 87 protected:
73 88 ShadowType _shadowMapType;
74 - ///The depth maps. Number depends on the current method
89 + /// The depth maps. Number depends on the current method
75 90 Framebuffer* _depthMap;
76 91 U16 _resolution;
77 - ///Internal pointer to the parent light
92 + /// Internal pointer to the parent light
78 93 Light* _light;
79 94 Camera* _shadowCamera;
80 95 ParamHandler& _par;
81 96 bool _init;
82 97 mat4<F32> _bias;
83 - // _shadowFloatValues are generic floating point values needed for shadow mapping such as farBounds, biases, etc.
98 + /// Generic floating point values needed for shadow mapping such as farBounds, biases, etc.
84 99 vectorImpl<F32> _shadowFloatValues;
85 100 };
86 101
  @@ -88,13 +103,27 @@
88 103 public:
89 104 ShadowMapInfo(Light* light);
90 105 virtual ~ShadowMapInfo();
91 - inline ShadowMap* getShadowMap() {return _shadowMap;}
106 +
107 + inline ShadowMap* getShadowMap() {
108 + return _shadowMap;
109 + }
110 +
92 111 ShadowMap* getOrCreateShadowMap(const SceneRenderState& sceneRenderState, Camera* shadowCamera);
93 - inline U16 resolution() const {return _resolution;}
94 - void resolution(U16 resolution);
95 112
96 - inline U8 numLayers() const {return _numLayers;}
97 - inline void numLayers(U8 layerCount) { _numLayers = std::min(std::abs((I32)layerCount), (I32)Config::Lighting::MAX_SPLITS_PER_LIGHT); }
113 + void resolution(U16 resolution);
114 +
115 + inline U16 resolution() const {
116 + return _resolution;
117 + }
118 +
119 + inline U8 numLayers() const {
120 + return _numLayers;
121 + }
122 +
123 + inline void numLayers(U8 layerCount) {
124 + _numLayers = std::min(std::abs((I32)layerCount),
125 + (I32)Config::Lighting::MAX_SPLITS_PER_LIGHT);
126 + }
98 127
99 128 private:
100 129 U8 _numLayers;