Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 852 vs 853 for /trunk/Source Code/Environment/Terrain/Terrain.cpp

Diff revisions: vs.
  @@ -151,21 +151,22 @@
151 151 }
152 152
153 153 g_PlaneCommandIndex = drawCommandsInOut.size();
154 - //infinite plane
155 - VertexBuffer* const vb = _plane->getGeometryVB();
156 - cmd.cmd().firstIndex = 0;
157 - cmd.cmd().indexCount = vb->getIndexCount();
158 - cmd.LoD(0);
159 - cmd.sourceBuffer(vb);
160 - drawCommandsInOut.push_back(cmd);
161 -
162 - //BoundingBoxes
163 - GenericDrawCommand bbCommand;
164 - bbCommand.drawCount(0);
165 - for (U32 i = 0; i < chunkCount + 2; ++i) {
166 - drawCommandsInOut.push_back(bbCommand);
154 + if (renderStagePass._stage == RenderStage::DISPLAY) {
155 + //infinite plane
156 + VertexBuffer* const vb = _plane->getGeometryVB();
157 + cmd.cmd().firstIndex = 0;
158 + cmd.cmd().indexCount = vb->getIndexCount();
159 + cmd.LoD(0);
160 + cmd.sourceBuffer(vb);
161 + drawCommandsInOut.push_back(cmd);
162 +
163 + //BoundingBoxes
164 + GenericDrawCommand bbCommand;
165 + bbCommand.drawCount(0);
166 + for (U32 i = 0; i < chunkCount + 2; ++i) {
167 + drawCommandsInOut.push_back(bbCommand);
168 + }
167 169 }
168 -
169 170 Object3D::initialiseDrawCommands(sgn, renderStagePass, drawCommandsInOut);
170 171 }
171 172
  @@ -199,24 +200,26 @@
199 200 }
200 201 }
201 202
202 - // draw infinite plane
203 - GenericDrawCommand& planeCmd = drawCommandsInOut[g_PlaneCommandIndex];
204 - planeCmd.drawCount((renderStagePass._stage == RenderStage::DISPLAY ? 1 : 0));
205 -
206 - i = g_PlaneCommandIndex + 1;
207 -
208 - if (_drawBBoxes) {
209 - GenericDrawCommands commands;
210 - commands.reserve(chunkCount);
211 - _terrainQuadtree.drawBBox(_context, commands);
212 -
213 - for (const GenericDrawCommand& cmd : commands) {
214 - drawCommandsInOut[i++] = cmd;
215 - }
216 -
217 - } else {
218 - for (; i < chunkCount; ++i) {
219 - drawCommandsInOut[i].drawCount(0);
203 + if (renderStagePass._stage == RenderStage::DISPLAY) {
204 + // draw infinite plane
205 + GenericDrawCommand& planeCmd = drawCommandsInOut[g_PlaneCommandIndex];
206 + planeCmd.drawCount((renderStagePass._stage == RenderStage::DISPLAY ? 1 : 0));
207 +
208 + i = g_PlaneCommandIndex + 1;
209 +
210 + if (_drawBBoxes) {
211 + GenericDrawCommands commands;
212 + commands.reserve(chunkCount);
213 + _terrainQuadtree.drawBBox(_context, commands);
214 +
215 + for (const GenericDrawCommand& cmd : commands) {
216 + drawCommandsInOut[i++] = cmd;
217 + }
218 +
219 + } else {
220 + for (; i < chunkCount; ++i) {
221 + drawCommandsInOut[i].drawCount(0);
222 + }
220 223 }
221 224 }
222 225