TGEA 1.7 BUG - detail texture, fog bug
by robo · in Torque Game Engine Advanced · 06/15/2008 (3:17 am) · 2 replies
When I removal detail texture, fog does not occur properly
like this

like this
new TerrainBlock(MyTerrain) {
canSaveDynamicFields = "1";
scale = "1 1 1";
terrainFile = "scriptsAndAssets/data/missions/simple.ter";
//omission ..
[b]// detailTexture = "scriptsAndAssets/data/terrains/details/detail1";[/b]
//omission..
};
About the author
Associate Tom Spilman
Sickhead Games
It was not setting the camera position shader constant if there was no detail map. Change the following about in the middle of TerrainRender::renderBlock():
if (!fixedfunction) // ADD THIS GFX->setVertexShaderConstF(20, &mCamPos.x, 1); // ADD THIS if (TerrainRender::mCurrentBlock->mDetailTextureHandle) { if (!fixedfunction) { GFX->setShader(sd->shader); Point4F detailConst( TerrainRender::mCurrentBlock->mDetailDistance / 2.0f, 1.f / (TerrainRender::mCurrentBlock->mDetailDistance / 2.0f), block->mDetailScale, 0); GFX->setVertexShaderConstF(50, &detailConst[0], 1); // REMOVE THIS: GFX->setVertexShaderConstF(20, &mCamPos.x, 1);