Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 827 vs 847 for /trunk/Source Code/Rendering/RenderPass/RenderPass.cpp

Diff revisions: vs.
  @@ -164,11 +164,13 @@
164 164 Attorney::SceneManagerRenderPass::generateShadowMaps(_parent.parent().sceneManager());
165 165 } break;
166 166 case RenderStage::REFLECTION: {
167 - /*params.pass = Config::MAX_REFLECTIVE_NODES_IN_VIEW;
167 + SceneManager& mgr = _parent.parent().sceneManager();
168 + RenderPassManager::PassParams params;
169 + params.pass = Config::MAX_REFLECTIVE_NODES_IN_VIEW;
170 + params.camera = Attorney::SceneManagerRenderPass::getActiveCamera(_parent.parent().sceneManager());
168 171
169 - Attorney::SceneRenderStateRenderPass::currentStagePass(renderState, Config::MAX_REFLECTIVE_NODES_IN_VIEW);
170 172 //Part 1 - update envirnoment maps:
171 - SceneEnvironmentProbePool* envProbPool = Attorney::SceneRenderPass::getEnvProbes(renderState.parentScene());
173 + /*SceneEnvironmentProbePool* envProbPool = Attorney::SceneRenderPass::getEnvProbes(renderState.parentScene());
172 174 const EnvironmentProbeList& probes = envProbPool->getNearestSorted();
173 175 for (EnvironmentProbe_ptr& probe : probes) {
174 176 probe->refresh();
  @@ -178,7 +180,7 @@
178 180 SceneGraphNode* nodePtr = node.second;
179 181 RenderingComponent* const rComp = nodePtr->get<RenderingComponent>();
180 182 Attorney::RenderingCompRenderPass::updateEnvProbeList(*rComp, probes);
181 - }
183 + }*/
182 184
183 185 //Part 2 - update classic reflectors (e.g. mirrors, water, etc)
184 186 //Get list of reflective nodes from the scene manager
  @@ -187,46 +189,47 @@
187 189 // While in budget, update reflections
188 190 ReflectionUtil::resetBudget();
189 191 for (const RenderPassCuller::VisibleNode& node : nodeCache) {
190 - SceneGraphNode* nodePtr = node.second;
192 + const SceneGraphNode* nodePtr = node.second;
191 193 RenderingComponent* const rComp = nodePtr->get<RenderingComponent>();
192 194 if (ReflectionUtil::isInBudget()) {
193 - Attorney::SceneRenderStateRenderPass::currentStagePass(renderState, ReflectionUtil::currentEntry());
194 -
195 - PhysicsComponent* const pComp = nodePtr->get<PhysicsComponent>();
196 - Attorney::RenderingCompRenderPass::updateReflection(*rComp,
197 - ReflectionUtil::currentEntry(),
198 - pComp->getPosition(),
199 - renderState);
200 - ReflectionUtil::updateBudget();
201 - }
202 - else {
195 + if (Attorney::RenderingCompRenderPass::updateReflection(*rComp,
196 + ReflectionUtil::currentEntry(),
197 + params.camera,
198 + renderState)) {
199 +
200 + ReflectionUtil::updateBudget();
201 + }
202 + } else {
203 203 Attorney::RenderingCompRenderPass::clearReflection(*rComp);
204 204 }
205 - }*/
205 + }
206 206 } break;
207 207 case RenderStage::REFRACTION: {
208 208 // Get list of refractive nodes from the scene manager
209 - /*const RenderPassCuller::VisibleNodeList& nodeCache = mgr.getSortedRefractiveNodes();
209 + SceneManager& mgr = _parent.parent().sceneManager();
210 + RenderPassManager::PassParams params;
211 + params.pass = Config::MAX_REFLECTIVE_NODES_IN_VIEW;
212 + params.camera = Attorney::SceneManagerRenderPass::getActiveCamera(_parent.parent().sceneManager());
210 213
214 + const RenderPassCuller::VisibleNodeList& nodeCache = mgr.getSortedRefractiveNodes();
211 215 // While in budget, update refractions
212 216 RefractionUtil::resetBudget();
213 217 for (const RenderPassCuller::VisibleNode& node : nodeCache) {
214 - SceneGraphNode* nodePtr = node.second;
218 + const SceneGraphNode* nodePtr = node.second;
215 219 RenderingComponent* const rComp = nodePtr->get<RenderingComponent>();
216 220 if (RefractionUtil::isInBudget()) {
217 - Attorney::SceneRenderStateRenderPass::currentStagePass(renderState, RefractionUtil::currentEntry());
218 -
219 - PhysicsComponent* const pComp = nodePtr->get<PhysicsComponent>();
220 - Attorney::RenderingCompRenderPass::updateRefraction(*rComp,
221 - RefractionUtil::currentEntry(),
222 - pComp->getPosition(),
223 - renderState);
224 - RefractionUtil::updateBudget();
221 + if (Attorney::RenderingCompRenderPass::updateRefraction(*rComp,
222 + RefractionUtil::currentEntry(),
223 + params.camera,
224 + renderState))
225 + {
226 + RefractionUtil::updateBudget();
227 + }
225 228 }
226 229 else {
227 230 Attorney::RenderingCompRenderPass::clearRefraction(*rComp);
228 231 }
229 - }*/
232 + }
230 233
231 234 } break;
232 235 };