Merge branch 'Preview4_0' of https://github.com/TorqueGameEngines/Torque3D into fix/terrainpainting

# Conflicts:
#	Engine/source/gui/worldEditor/terrainEditor.cpp
This commit is contained in:
AzaezelX 2021-01-27 23:38:14 -06:00
commit d4cd1edad7
374 changed files with 76201 additions and 53157 deletions

View file

@ -46,6 +46,10 @@
#include "platform/profiler.h"
#include "T3D/assets/assetImporter.h"
#ifdef TORQUE_TOOLS
#include "ts/tsLastDetail.h"
#endif
//-----------------------------------------------------------------------------
IMPLEMENT_CONOBJECT(ShapeAsset);
@ -505,6 +509,29 @@ ShapeAnimationAsset* ShapeAsset::getAnimation(S32 index)
return nullptr;
}
#ifdef TORQUE_TOOLS
const char* ShapeAsset::generateCachedPreviewImage(S32 resolution)
{
if (!mShape)
return "";
TSLastDetail* dt = new TSLastDetail(mShape,
mFilePath,
1,
0,
0,
false,
0,
resolution);
dt->update();
delete dt;
return mFilePath;
}
#endif
DefineEngineMethod(ShapeAsset, getMaterialCount, S32, (), ,
"Gets the number of materials for this shape asset.\n"
"@return Material count.\n")
@ -526,6 +553,21 @@ DefineEngineMethod(ShapeAsset, getAnimation, ShapeAnimationAsset*, (S32 index),
{
return object->getAnimation(index);
}
DefineEngineMethod(ShapeAsset, getShapeFile, const char*, (), ,
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->getShapeFilePath();
}
#ifdef TORQUE_TOOLS
DefineEngineMethod(ShapeAsset, generateCachedPreviewImage, const char*, (S32 resolution), (256), "")
{
return object->generateCachedPreviewImage(resolution);
}
#endif
//-----------------------------------------------------------------------------
// GuiInspectorTypeAssetId
//-----------------------------------------------------------------------------
@ -625,10 +667,3 @@ void GuiInspectorTypeShapeAssetId::consoleInit()
}
#endif
DefineEngineMethod(ShapeAsset, getShapeFile, const char*, (), ,
"Creates a new script asset using the targetFilePath.\n"
"@return The bool result of calling exec")
{
return object->getShapeFilePath();
}

View file

@ -165,6 +165,10 @@ public:
static StringTableEntry getNoShapeAssetId() { return StringTable->insert("Core_Rendering:noshape"); }
#ifdef TORQUE_TOOLS
const char* generateCachedPreviewImage(S32 resolution);
#endif
protected:
virtual void onAssetRefresh(void);

View file

@ -420,7 +420,10 @@ void NormalsOutFeatHLSL::processVert( Vector<ShaderComponent*> &componentList,
{
// Transform the normal to world space.
Var *objTrans = getObjTrans( componentList, fd.features[MFT_UseInstancing], meta );
meta->addStatement( new GenOp( " @ = mul( @, normalize( @ ) );\r\n", outNormal, objTrans, inNormal ) );
if (String::compare((const char*)objTrans->type, "float4x4") == 0)
meta->addStatement(new GenOp(" @ = mul( @, normalize( float4(@,0) ) ).xyz;\r\n", outNormal, objTrans, inNormal));
else
meta->addStatement(new GenOp(" @ = mul( @, normalize( @ ) );\r\n", outNormal, objTrans, inNormal));
}
else
{