Implement Singlepass Terrain Render

This commit is contained in:
Lukas Aldershaab 2021-01-01 21:05:21 +01:00
parent 49a8c0ad36
commit 87dd7ffc4a
35 changed files with 1658 additions and 951 deletions

View file

@ -52,6 +52,7 @@
#include "T3D/physics/physicsBody.h"
#include "T3D/physics/physicsCollision.h"
#include "console/engineAPI.h"
#include "core/util/safeRelease.h"
#include "T3D/assets/TerrainMaterialAsset.h"
using namespace Torque;
@ -203,7 +204,11 @@ TerrainBlock::TerrainBlock()
mScreenError( 16 ),
mCastShadows( true ),
mZoningDirty( false ),
mUpdateBasetex ( true )
mUpdateBasetex ( true ),
mDetailTextureArray( NULL ),
mMacroTextureArray( NULL ),
mOrmTextureArray( NULL ),
mNormalTextureArray( NULL )
{
mTypeMask = TerrainObjectType | StaticObjectType | StaticShapeObjectType;
mNetFlags.set(Ghostable | ScopeAlways);
@ -231,6 +236,11 @@ TerrainBlock::~TerrainBlock()
editor->detachTerrain(this);
#endif
deleteZodiacPrimitiveBuffer();
SAFE_RELEASE(mDetailTextureArray);
SAFE_RELEASE(mMacroTextureArray);
SAFE_RELEASE(mNormalTextureArray);
SAFE_RELEASE(mOrmTextureArray);
}
void TerrainBlock::_onTextureEvent( GFXTexCallbackCode code )