Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 851 vs 852 for /trunk/Source Code/Environment/Sky/Sky.cpp

Diff revisions: vs.
  @@ -125,14 +125,14 @@
125 125 }
126 126
127 127 void Sky::initialiseDrawCommands(SceneGraphNode& sgn,
128 - RenderStage renderStage,
128 + const RenderStagePass& renderStagePass,
129 129 GenericDrawCommands& drawCommandsInOut) {
130 130 GenericDrawCommand cmd;
131 131 cmd.sourceBuffer(_sky->getGeometryVB());
132 132 cmd.cmd().indexCount = _sky->getGeometryVB()->getIndexCount();
133 133 drawCommandsInOut.push_back(cmd);
134 134
135 - SceneNode::initialiseDrawCommands(sgn, renderStage, drawCommandsInOut);
135 + SceneNode::initialiseDrawCommands(sgn, renderStagePass, drawCommandsInOut);
136 136 }
137 137
138 138 void Sky::updateDrawCommands(SceneGraphNode& sgn,
  @@ -141,11 +141,16 @@
141 141 GenericDrawCommands& drawCommandsInOut) {
142 142
143 143 GenericDrawCommand& cmd = drawCommandsInOut.front();
144 - cmd.stateHash(renderStagePass._stage == RenderStage::REFLECTION
145 - ? _skyboxRenderStateReflectedHash
146 - : renderStagePass._prePass ? _skyboxRenderStateHashPrePass
147 - : _skyboxRenderStateHash);
148 - cmd.shaderProgram(renderStagePass._prePass ? _skyShaderPrePass : _skyShader);
144 + if (renderStagePass._passType == RenderPassType::DEPTH_PASS) {
145 + cmd.stateHash(_skyboxRenderStateHashPrePass);
146 + cmd.shaderProgram(_skyShaderPrePass);
147 + } else {
148 + cmd.stateHash(renderStagePass._stage == RenderStage::REFLECTION
149 + ? _skyboxRenderStateReflectedHash
150 + : _skyboxRenderStateHash);
151 + cmd.shaderProgram(_skyShader);
152 + }
153 +
149 154 SceneNode::updateDrawCommands(sgn, renderStagePass, sceneRenderState, drawCommandsInOut);
150 155 }
151 156