mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-27 10:33:50 +00:00
Adds test shapes of Kork and SpaceOrc
Sidestep of memleak from CSF at the moment Minor fixes and corrections with asset importing and loose files WIP of updated options menu
This commit is contained in:
parent
98c4606b3c
commit
ae857faae2
40 changed files with 765 additions and 182 deletions
|
|
@ -116,6 +116,7 @@ Material::Material()
|
|||
{
|
||||
mDiffuse[i].set( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
mDiffuseMapSRGB[i] = true;
|
||||
mDiffuseMapAsset[i] = StringTable->EmptyString();
|
||||
|
||||
mSmoothness[i] = 0.0f;
|
||||
mMetalness[i] = 0.0f;
|
||||
|
|
@ -172,8 +173,10 @@ Material::Material()
|
|||
// Deferred Shading
|
||||
mMatInfoFlags[i] = 0.0f;
|
||||
mRoughMapFilename[i].clear();
|
||||
mRoughMapAsset[i] = StringTable->EmptyString();
|
||||
mAOMapFilename[i].clear();
|
||||
mMetalMapFilename[i].clear();
|
||||
mMetalMapAsset[i] = StringTable->EmptyString();
|
||||
}
|
||||
|
||||
dMemset(mCellIndex, 0, sizeof(mCellIndex));
|
||||
|
|
@ -235,6 +238,9 @@ void Material::initPersistFields()
|
|||
addField("diffuseMap", TypeImageFilename, Offset(mDiffuseMapFilename, Material), MAX_STAGES,
|
||||
"The diffuse color texture map." );
|
||||
|
||||
addField("diffuseMapAsset", TypeImageAssetPtr, Offset(mDiffuseMapAsset, Material), MAX_STAGES,
|
||||
"The diffuse color texture map." );
|
||||
|
||||
addField("diffuseMapSRGB", TypeBool, Offset(mDiffuseMapSRGB, Material), MAX_STAGES,
|
||||
"Enable sRGB for the diffuse color texture map.");
|
||||
|
||||
|
|
@ -636,7 +642,7 @@ void Material::_mapMaterial()
|
|||
// If mapTo not defined in script, try to use the base texture name instead
|
||||
if( mMapTo.isEmpty() )
|
||||
{
|
||||
if ( mDiffuseMapFilename[0].isEmpty() )
|
||||
if ( mDiffuseMapFilename[0].isEmpty() && mDiffuseMapAsset->isNull())
|
||||
return;
|
||||
|
||||
else
|
||||
|
|
@ -652,6 +658,10 @@ void Material::_mapMaterial()
|
|||
// use everything after the last slash
|
||||
mMapTo = mDiffuseMapFilename[0].substr(slashPos+1, mDiffuseMapFilename[0].length() - slashPos - 1);
|
||||
}
|
||||
else if (!mDiffuseMapAsset->isNull())
|
||||
{
|
||||
mMapTo = mDiffuseMapAsset[0]->getImageFileName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,13 @@
|
|||
#include "shaderGen/customShaderFeature.h"
|
||||
#endif
|
||||
|
||||
#ifndef IMAGE_ASSET_H
|
||||
#include "T3D/assets/ImageAsset.h"
|
||||
#endif
|
||||
#ifndef _ASSET_PTR_H_
|
||||
#include "assets/assetPtr.h"
|
||||
#endif
|
||||
|
||||
class CubemapData;
|
||||
class SFXTrack;
|
||||
struct SceneData;
|
||||
|
|
@ -203,6 +210,8 @@ public:
|
|||
// Data
|
||||
//-----------------------------------------------------------------------
|
||||
FileName mDiffuseMapFilename[MAX_STAGES];
|
||||
StringTableEntry mDiffuseMapAssetId[MAX_STAGES];
|
||||
AssetPtr<ImageAsset> mDiffuseMapAsset[MAX_STAGES];
|
||||
bool mDiffuseMapSRGB[MAX_STAGES]; // SRGB diffuse
|
||||
bool mAccuEnabled[MAX_STAGES];
|
||||
F32 mAccuScale[MAX_STAGES];
|
||||
|
|
@ -211,24 +220,44 @@ public:
|
|||
F32 mAccuCoverage[MAX_STAGES];
|
||||
F32 mAccuSpecular[MAX_STAGES];
|
||||
FileName mOverlayMapFilename[MAX_STAGES];
|
||||
StringTableEntry mOverlayMapAssetId[MAX_STAGES];
|
||||
AssetPtr<ImageAsset> mOverlayMapAsset[MAX_STAGES];
|
||||
FileName mLightMapFilename[MAX_STAGES];
|
||||
StringTableEntry mLightMapAssetId[MAX_STAGES];
|
||||
AssetPtr<ImageAsset> mLightMapAsset[MAX_STAGES];
|
||||
FileName mToneMapFilename[MAX_STAGES];
|
||||
StringTableEntry mToneMapAssetId[MAX_STAGES];
|
||||
AssetPtr<ImageAsset> mToneMapAsset[MAX_STAGES];
|
||||
FileName mDetailMapFilename[MAX_STAGES];
|
||||
StringTableEntry mDetailMapAssetId[MAX_STAGES];
|
||||
AssetPtr<ImageAsset> mDetailMapAsset[MAX_STAGES];
|
||||
FileName mNormalMapFilename[MAX_STAGES];
|
||||
StringTableEntry mNormalMapAssetId[MAX_STAGES];
|
||||
AssetPtr<ImageAsset> mNormalMapAsset[MAX_STAGES];
|
||||
|
||||
bool mIsSRGb[MAX_STAGES];
|
||||
bool mInvertSmoothness[MAX_STAGES];
|
||||
FileName mSpecularMapFilename[MAX_STAGES];
|
||||
StringTableEntry mSpecularMapAssetId[MAX_STAGES];
|
||||
AssetPtr<ImageAsset> mSpecularMapAsset[MAX_STAGES];
|
||||
FileName mRoughMapFilename[MAX_STAGES];
|
||||
StringTableEntry mRoughMapAssetId[MAX_STAGES];
|
||||
AssetPtr<ImageAsset> mRoughMapAsset[MAX_STAGES];
|
||||
F32 mSmoothnessChan[MAX_STAGES];
|
||||
FileName mAOMapFilename[MAX_STAGES];
|
||||
StringTableEntry mAOMapAssetId[MAX_STAGES];
|
||||
AssetPtr<ImageAsset> mAOMapAsset[MAX_STAGES];
|
||||
F32 mAOChan[MAX_STAGES];
|
||||
FileName mMetalMapFilename[MAX_STAGES];
|
||||
StringTableEntry mMetalMapAssetId[MAX_STAGES];
|
||||
AssetPtr<ImageAsset> mMetalMapAsset[MAX_STAGES];
|
||||
F32 mMetalChan[MAX_STAGES];
|
||||
|
||||
/// A second normal map which repeats at the detail map
|
||||
/// scale and blended with the base normal map.
|
||||
FileName mDetailNormalMapFilename[MAX_STAGES];
|
||||
StringTableEntry mDetailNormalMapAssetId[MAX_STAGES];
|
||||
AssetPtr<ImageAsset> mDetailNormalMapAsset[MAX_STAGES];
|
||||
|
||||
/// The strength scalar for the detail normal map.
|
||||
F32 mDetailNormalMapStrength[MAX_STAGES];
|
||||
|
|
|
|||
|
|
@ -409,6 +409,16 @@ void ProcessedMaterial::_setStageData()
|
|||
mStages[i].setTex(MFT_DiffuseMap, _createTexture(GFXTextureManager::getMissingTexturePath().c_str(), &GFXStaticTextureSRGBProfile));
|
||||
}
|
||||
}
|
||||
else if (!mMaterial->mDiffuseMapAsset[i].isNull())
|
||||
{
|
||||
mStages[i].setTex(MFT_DiffuseMap, mMaterial->mDiffuseMapAsset[i]->getImage());
|
||||
if (!mStages[i].getTex(MFT_DiffuseMap))
|
||||
{
|
||||
// Load a debug texture to make it clear to the user
|
||||
// that the texture for this stage was missing.
|
||||
mStages[i].setTex(MFT_DiffuseMap, _createTexture(GFXTextureManager::getMissingTexturePath().c_str(), &GFXStaticTextureSRGBProfile));
|
||||
}
|
||||
}
|
||||
|
||||
// OverlayMap
|
||||
if (mMaterial->mOverlayMapFilename[i].isNotEmpty())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue