Adds isSRGB and invertSmoothness checkboxes to terrain material editor

Added ability for assimp loader to ignore cached DTS shapes on demand when building shape data
Added assimp importer options to asset import config settings set
Moved variableInspector field types folder from tools/assetBrowser/scripts to tools/guis
This commit is contained in:
Areloch 2019-11-11 01:40:55 -06:00
parent d8cc73f5a1
commit 796a95b8a5
14 changed files with 125 additions and 22 deletions

View file

@ -65,7 +65,9 @@ TerrainMaterial::TerrainMaterial()
mMacroSize( 200.0f ),
mMacroStrength( 0.7f ),
mMacroDistance( 500.0f ),
mParallaxScale( 0.0f )
mParallaxScale( 0.0f ),
mIsSRGB(false),
mInvertSmoothness(false)
{
}
@ -97,7 +99,10 @@ void TerrainMaterial::initPersistFields()
addField( "parallaxScale", TypeF32, Offset( mParallaxScale, TerrainMaterial ), "Used to scale the height from the normal map to give some self "
"occlusion effect (aka parallax) to the terrain material" );
addField("pbrConfigMap", TypeStringFilename, Offset(mCompositeMap, TerrainMaterial), "Composite map for the material");
addField("pbrConfigMap", TypeStringFilename, Offset(mCompositeMap, TerrainMaterial), "Composite map for the PBR Configuration of the material");
addField("isSRGB", TypeBool, Offset(mIsSRGB, TerrainMaterial), "Is the PBR Config map's image in sRGB format?");
addField("invertSmoothness", TypeBool, Offset(mInvertSmoothness, TerrainMaterial), "Should the smoothness channel of the PBR Config map be inverted?");
Parent::initPersistFields();
// Gotta call this at least once or it won't get created!

View file

@ -77,6 +77,9 @@ protected:
///
F32 mParallaxScale;
bool mIsSRGB;
bool mInvertSmoothness;
public:
TerrainMaterial();

View file

@ -799,7 +799,7 @@ TSShape* assimpLoadShape(const Torque::Path &path)
return tss;
}
DefineEngineFunction(GetShapeInfo, bool, (const char* shapePath, const char* ctrl), ,
DefineEngineFunction(GetShapeInfo, bool, (const char* shapePath, const char* ctrl, bool loadCachedDts), ("", "", true),
"(string shapePath, GuiTreeViewCtrl ctrl) Collect scene information from "
"a shape file and store it in a GuiTreeView control. This function is "
"used by the assimp import gui to show a preview of the scene contents "
@ -820,7 +820,7 @@ DefineEngineFunction(GetShapeInfo, bool, (const char* shapePath, const char* ctr
// Check if a cached DTS is available => no need to import the source file
// if we can load the DTS instead
Torque::Path path(shapePath);
if (AssimpShapeLoader::canLoadCachedDTS(path))
if (loadCachedDts && AssimpShapeLoader::canLoadCachedDTS(path))
return false;
AssimpShapeLoader loader;