Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 287 vs 296 for /trunk/Source Code/Rendering/DeferredShadingRenderer.cpp

Diff revisions: vs.
  @@ -15,7 +15,6 @@
15 15 #include "Managers/Headers/RenderPassManager.h"
16 16
17 17 DeferredShadingRenderer::DeferredShadingRenderer() : Renderer(RENDERER_DEFERRED_SHADING),
18 - _debugView(false),
19 18 _cachedLightCount(0)
20 19 {
21 20 _lightTexture = GFX_DEVICE.newPB();
  @@ -114,7 +113,7 @@
114 113 SAFE_DELETE(_lightTexture);
115 114 }
116 115
117 - void DeferredShadingRenderer::render(const DELEGATE_CBK& renderCallback, const SceneRenderState& sceneRenderState) {
116 + void DeferredShadingRenderer::processVisibleNodes(const vectorImpl<SceneGraphNode* >& visibleNodes, const GFXDevice::GPUBlock& gpuBlock) {
118 117 GFX_DEVICE.setRenderStage(DEFERRED_STAGE);
119 118
120 119 Light::LightMap& lights = LightManager::getInstance().getLights();
  @@ -139,6 +138,10 @@
139 138 }
140 139 }
141 140 _lightTexture->End();
141 + }
142 +
143 + void DeferredShadingRenderer::render(const DELEGATE_CBK& renderCallback, const SceneRenderState& sceneRenderState) {
144 +
142 145 firstPass(renderCallback, sceneRenderState);
143 146 secondPass(sceneRenderState);
144 147 }
  @@ -168,13 +171,13 @@
168 171 cmd.setShaderProgram(_previewDeferredShader);
169 172 if(_debugView){
170 173 _previewDeferredShader->bind();
171 - _previewDeferredShader->UniformTexture("tex",4);
174 + _previewDeferredShader->UniformTexture("texDiffuse0",4);
172 175 if(_renderQuads[1]->onDraw(nullptr, GFX_DEVICE.getRenderStage()))
173 176 GFX_DEVICE.submitRenderCommand(_renderQuads[1]->getGeometryVB(), cmd);
174 - _previewDeferredShader->UniformTexture("tex",1);
177 + _previewDeferredShader->UniformTexture("texDiffuse0",1);
175 178 if(_renderQuads[2]->onDraw(nullptr, GFX_DEVICE.getRenderStage()))
176 179 GFX_DEVICE.submitRenderCommand(_renderQuads[2]->getGeometryVB(), cmd);
177 - _previewDeferredShader->UniformTexture("tex",2);
180 + _previewDeferredShader->UniformTexture("texDiffuse0",2);
178 181 if(_renderQuads[3]->onDraw(nullptr, GFX_DEVICE.getRenderStage()))
179 182 GFX_DEVICE.submitRenderCommand(_renderQuads[3]->getGeometryVB(), cmd);
180 183 }
  @@ -220,8 +223,4 @@
220 223 _renderQuads[3]->setCorner(Quad3D::BOTTOM_RIGHT, vec3<F32>(width, height / 2, 0));
221 224 //Using a separate, smaller render quad for debug view because it's faster than resizing a quad back and forth -Ionut
222 225 _renderQuads[4]->setDimensions(vec4<F32>(0, 0, width / 2, height / 2));
223 - }
224 -
225 - void DeferredShadingRenderer::toggleDebugView(){
226 - _debugView = !_debugView;
227 226 }