Переглянути джерело

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

AzaezelX 4 роки тому
батько
коміт
438e6cbb3c

+ 1 - 1
Engine/source/materials/materialList.cpp

@@ -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)

+ 1 - 1
Engine/source/materials/processedMaterial.cpp

@@ -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.

+ 1 - 0
Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp

@@ -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] );

+ 5 - 4
Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp

@@ -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!

+ 0 - 1
Engine/source/terrain/terrData.cpp

@@ -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);

+ 4 - 4
Engine/source/terrain/terrMaterial.cpp

@@ -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();
       

+ 2 - 2
Engine/source/ts/tsLastDetail.cpp

@@ -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;

BIN
Templates/BaseGame/game/core/rendering/materials/Blank_sky/BlankSkybox.png


+ 3 - 1
Templates/BaseGame/game/tools/projectImporter/scripts/pre40/T3Dpre4ProjectImporter.tscript

@@ -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
 //==============================================================================

+ 1 - 4
Templates/BaseGame/game/tools/projectImporter/scripts/projectImporter.tscript

@@ -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;