Reworks the terrain loader code to work with the assets.

Fixes the terrain asset creation, makes the loading logic go through the asset auto-import behavior when a filename or assetid is bound that is not found.
Corrects terrain material binding to properly save and load
Makes the terrain asset inspector fields work as expected.
This commit is contained in:
Areloch 2020-06-25 23:33:01 -05:00
parent 3e1795ba1d
commit 4ce558f042
15 changed files with 500 additions and 283 deletions

View file

@ -61,10 +61,6 @@ class MaterialSoundProfile;
class MaterialPhysicsProfile;
class CustomShaderFeatureData;
#define DECLARE_TEXTUREARRAY(name,max) FileName m##name##Filename[max];\
StringTableEntry m##name##AssetId[max];\
AssetPtr<ImageAsset> m##name##Asset[max];
/// The basic material definition.
class Material : public BaseMaterialDefinition
{
@ -244,17 +240,6 @@ public:
F32 mAccuCoverage[MAX_STAGES];
F32 mAccuSpecular[MAX_STAGES];
//cogs specific
/// Damage blend maps (albedo)
DECLARE_TEXTUREARRAY(AlbedoDamageMap, MAX_STAGES);
bool mAlbedoDamageMapSRGB[MAX_STAGES];
/// Damage blend maps (normal)
DECLARE_TEXTUREARRAY(NormalDamageMap, MAX_STAGES);
/// Damage blend maps (Roughness, AO, Metalness)
DECLARE_TEXTUREARRAY(CompositeDamageMap, MAX_STAGES);
/// Damage blend minimum
F32 mMaterialDamageMin[MAX_STAGES];
/// This color is the diffuse color of the material
/// or if it has a texture it is multiplied against
/// the diffuse texture color.