fix for diffuse map mangling in several cases, filter imposters out of real time lighting (for now?) fix the blankskybox via a resave, and filter "badfilereference" and "failed" assets out of variable replacement for the project converter

This commit is contained in:
AzaezelX 2021-07-25 17:18:55 -05:00
parent 432d201569
commit 438e6cbb3c
10 changed files with 18 additions and 18 deletions

View file

@ -365,7 +365,7 @@ void MaterialList::mapMaterial( U32 i )
newMat->mAutoGenerated = true;
// Overwrite diffuseMap in new material
newMat->mDiffuseMapName[0] = texHandle->mTextureLookupName;
newMat->_setDiffuseMap(texHandle->mTextureLookupName,0);
// Set up some defaults for transparent textures
if (texHandle->mHasTransparency)

View file

@ -421,7 +421,7 @@ void ProcessedMaterial::_setStageData()
//If we start with a #, we're probably actually attempting to hit a named target and it may not get a hit on the first pass. So we'll
//pass on the error rather than spamming the console
if (!String(mMaterial->mDiffuseMapName[i]).startsWith("#"))
mMaterial->logError("Failed to load diffuse map %s for stage %i", _getTexturePath(mMaterial->mDiffuseMapName[i]).c_str(), i);
mMaterial->logError("Failed to load diffuse map %s for stage %i", mMaterial->mDiffuseMapName[i], i);
// Load a debug texture to make it clear to the user
// that the texture for this stage was missing.

View file

@ -2067,6 +2067,7 @@ RTLightingFeatGLSL::RTLightingFeatGLSL()
void RTLightingFeatGLSL::processVert( Vector<ShaderComponent*> &componentList,
const MaterialFeatureData &fd )
{
if (fd.features[MFT_ImposterVert]) return;
MultiLine *meta = new MultiLine;
ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>( componentList[C_CONNECTOR] );

View file

@ -2138,10 +2138,11 @@ RTLightingFeatHLSL::RTLightingFeatHLSL()
void RTLightingFeatHLSL::processVert( Vector<ShaderComponent*> &componentList,
const MaterialFeatureData &fd )
{
if (fd.features[MFT_ImposterVert]) return;
MultiLine *meta = new MultiLine;
ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>( componentList[C_CONNECTOR] );
getOutWorldToTangent(componentList, meta, fd);
// Special case for lighting imposters. We dont have a vert normal and may not
// have a normal map. Generate and pass the normal data the pixel shader needs.
@ -2206,6 +2207,7 @@ void RTLightingFeatHLSL::processVert( Vector<ShaderComponent*> &componentList,
}
addOutWsPosition( componentList, fd.features[MFT_UseInstancing], meta );
getOutWorldToTangent(componentList, meta, fd);
output = meta;
}
@ -3025,14 +3027,13 @@ void ReflectionProbeFeatHLSL::processVert(Vector<ShaderComponent*>& componentLis
output = meta;
// Also output the worldToTanget transform which
// we use to create the world space normal.
getOutWorldToTangent(componentList, meta, fd);
//getOutWorldToTangent(componentList, meta, fd);
}
void ReflectionProbeFeatHLSL::processPix(Vector<ShaderComponent*> &componentList,
const MaterialFeatureData &fd)
{
// Skip out on realtime lighting if we don't have a normal
// or we're doing some sort of baked lighting.
// Skip out on realtime lighting if we're doing some sort of baked lighting.
//
// TODO: We can totally detect for this in the material
// feature setup... we should move it out of here!

View file

@ -1419,7 +1419,6 @@ void TerrainBlock::unpackUpdate(NetConnection* con, BitStream *stream)
char buffer[256];
stream->readString(buffer);
bool validAsset = setTerrainAsset(StringTable->insert(buffer));
_updateBaseTexture(NONE);
}
if (baseTexSizeChanged && isProperlyAdded())
_updateBaseTexture(NONE);

View file

@ -168,7 +168,7 @@ TerrainMaterial* TerrainMaterial::findOrCreate( const char *nameOrPath )
{
mat = new TerrainMaterial();
mat->setInternalName( nameOrPath );
mat->mDiffuseMapName = nameOrPath;
mat->_setDiffuseMap(nameOrPath);
mat->registerObject();
Sim::getRootGroup()->addObject( mat );
return mat;
@ -183,11 +183,11 @@ TerrainMaterial* TerrainMaterial::findOrCreate( const char *nameOrPath )
// fallback here just in case it gets "lost".
mat = new TerrainMaterial();
mat->setInternalName( "warning_material" );
mat->mDiffuseMapName = GFXTextureManager::getWarningTexturePath();
mat->_setDiffuseMap(GFXTextureManager::getWarningTexturePath());
mat->mDiffuseSize = 500;
mat->mDiffuseMapName = GFXTextureManager::getWarningTexturePath();
mat->_setDetailMap(StringTable->EmptyString());
mat->mDetailSize = 5;
mat->mDiffuseMapName = GFXTextureManager::getWarningTexturePath();
mat->_setMacroMap(StringTable->EmptyString());
mat->mMacroSize = 200;
mat->registerObject();

View file

@ -218,8 +218,8 @@ void TSLastDetail::update( bool forceUpdate )
// Setup the material for this imposter.
mMaterial = MATMGR->allocateAndRegister( String::EmptyString );
mMaterial->mAutoGenerated = true;
mMaterial->mDiffuseMapName[0] = diffuseMapPath;
mMaterial->mNormalMapName[0] = _getNormalMapPath();
mMaterial->_setDiffuseMap(diffuseMapPath,0);
mMaterial->_setNormalMap(_getNormalMapPath(), 0);
mMaterial->mImposterLimits.set( (mNumPolarSteps * 2) + 1, mNumEquatorSteps, mPolarAngle, mIncludePoles );
mMaterial->mTranslucent = true;
mMaterial->mTranslucentBlendOp = Material::None;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Before After
Before After

View file

@ -805,7 +805,9 @@ T3Dpre4ProjectImporter::genProcessor("GroundCover", "material materialAsset shap
T3Dpre4ProjectImporter::genProcessor("GroundPlane", "material materialAsset");
T3Dpre4ProjectImporter::genProcessor("LevelInfo", "accuTexture accuTextureAsset");
T3Dpre4ProjectImporter::genProcessor("TSStatic", "shape shapeAsset shapeName shapeAsset");
T3Dpre4ProjectImporter::genProcessor("TSForestItemData", "shape shapeAsset shapeName shapeAsset");
T3Dpre4ProjectImporter::genProcessor("ForestItemData", "shape shapeAsset shapeName shapeAsset");
//T3Dpre4ProjectImporter::genProcessor("TerrainBlock", "terrainFile terrainFileAsset");
//==============================================================================
// Levels
//==============================================================================

View file

@ -465,14 +465,11 @@ function processLegacyField(%line, %originalFieldName, %newFieldName)
if(%assetId !$= "" && AssetDatabase.isDeclaredAsset(%assetId))
{
//if (%assetId.getStatusString() $= "Ok")
%outLine = strReplace(%outLine, %value, %assetId);
//else
// error("Asset assignment failure:", %assetId, getStatusString());
}
}
if(%outLine !$= %line)
if((%outLine !$= %line)&&(%assetId.getStatusString() !$= "BadFileReference")&&(%assetId.getStatusString() !$= "Failed"))
{
echo("Legacy Project Importer - processing of legacy line: " @ %line @ " has been updated to: " @ %outLine);
return %outLine;