Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 326 vs 328 for /trunk/Source Code/Environment/Vegetation/Vegetation.cpp

Diff revisions: vs.
  @@ -115,7 +115,7 @@
115 115 vegMaterial->setShaderProgram(_grassShaderName + ".PrePass", Z_PRE_PASS_STAGE, true);
116 116 vegMaterial->setShaderLoadThreaded(false);
117 117 vegMaterial->dumpToFile(false);
118 - setMaterial(vegMaterial);
118 + setMaterialTpl(vegMaterial);
119 119
120 120 Kernel* kernel = Application::getInstance().getKernel();
121 121 _generateVegetation.reset(kernel->AddTask(0, 1, DELEGATE_BIND(&Vegetation::generateGrass, this), DELEGATE_BIND(&Vegetation::uploadGrassData, this)));
  @@ -191,7 +191,7 @@
191 191 }
192 192 }
193 193
194 - Material* mat = getMaterial();
194 + Material* mat = getMaterialTpl();
195 195 for (U8 i = 0; i < 3; ++i){
196 196 ShaderProgram* const shaderProg = mat->getShaderInfo(i == 0 ? FINAL_STAGE : (i == 1 ? SHADOW_STAGE : Z_PRE_PASS_STAGE)).getProgram();
197 197 shaderProg->Uniform("positionOffsets", grassBlades);
  @@ -252,12 +252,12 @@
252 252 _windX = sceneState.getWindDirX();
253 253 _windZ = sceneState.getWindDirZ();
254 254 _windS = sceneState.getWindSpeed();
255 - Material* mat = getMaterial();
255 + Material* mat = sgn->getMaterialInstance();
256 256 for (U8 i = 0; i < 3; ++i){
257 257 RenderStage stage = (i == 0 ? FINAL_STAGE : (i == 1 ? SHADOW_STAGE : Z_PRE_PASS_STAGE));
258 258 mat->getShaderInfo(stage).getProgram()->Uniform("grassScale",/* _grassSize*/1.0f);
259 259 }
260 - _stateRefreshIntervalBuffer -= _stateRefreshInterval;
260 + _stateRefreshIntervalBuffer -= _stateRefreshInterval;
261 261 _cullShader->Uniform("dvd_visibilityDistance", sceneState.getGrassVisibility());
262 262 _staticDataUpdated = true;
263 263 }
  @@ -339,7 +339,7 @@
339 339 _renderDrawCommand.instanceCount(instanceCount);
340 340 _renderDrawCommand.LoD(1);
341 341 _renderDrawCommand.drawID(GFX_DEVICE.getDrawID(sgn->getGUID()));
342 - _renderDrawCommand.shaderProgram(getDrawShader(currentRenderStage));
342 + _renderDrawCommand.shaderProgram(sgn->getDrawShader(currentRenderStage));
343 343 buffer->getDrawAttribDescriptor(posLocation).offset(_instanceCountGrass * queryId);
344 344 buffer->getDrawAttribDescriptor(scaleLocation).offset(_instanceCountGrass * queryId);
345 345 buffer->getDrawAttribDescriptor(instLocation).offset(_instanceCountGrass * queryId);