Przeglądaj źródła

Fix for fuzzy borders between textures

LukasPJ 11 lat temu
rodzic
commit
ad7b75de09
1 zmienionych plików z 4 dodań i 5 usunięć
  1. 4 5
      Engine/source/terrain/hlsl/terrFeatureHLSL.cpp

+ 4 - 5
Engine/source/terrain/hlsl/terrFeatureHLSL.cpp

@@ -533,8 +533,8 @@ void TerrainDetailMapFeatHLSL::processPix(   Vector<ShaderComponent*> &component
    Var *baseColor = (Var*)LangElement::find( "baseColor" );
    Var *baseColor = (Var*)LangElement::find( "baseColor" );
    Var *outColor = (Var*)LangElement::find( "col" );
    Var *outColor = (Var*)LangElement::find( "col" );
 
 
-   meta->addStatement( new GenOp( "      @ = lerp( @, @ + @, @ );\r\n",
-                                    outColor, outColor, baseColor, detailColor, detailBlend ) );
+   meta->addStatement( new GenOp( "      @ += @ * @;\r\n",
+                                    outColor, detailColor, detailBlend));
 
 
    meta->addStatement( new GenOp( "   }\r\n" ) );
    meta->addStatement( new GenOp( "   }\r\n" ) );
 
 
@@ -803,9 +803,8 @@ void TerrainMacroMapFeatHLSL::processPix(   Vector<ShaderComponent*> &componentL
    //Var *baseColor = (Var*)LangElement::find( "baseColor" );
    //Var *baseColor = (Var*)LangElement::find( "baseColor" );
    Var *outColor = (Var*)LangElement::find( "col" );
    Var *outColor = (Var*)LangElement::find( "col" );
 
 
-   meta->addStatement( new GenOp( "      @ = lerp( @, @ + @, @ );\r\n",
-                                    outColor, outColor, outColor, detailColor, detailBlend ) );
-   //outColor, outColor, baseColor, detailColor, detailBlend ) );
+   meta->addStatement(new GenOp("      @ += @ * @;\r\n",
+                                    outColor, detailColor, detailBlend));
 
 
    meta->addStatement( new GenOp( "   }\r\n" ) );
    meta->addStatement( new GenOp( "   }\r\n" ) );