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

Fixed an issue with generating multiple assets for shader variations
Pinging an item in the project library will now properly switch to the folder in which the pinged item is in

BearishSun 9 роки тому
батько
коміт
1a4843c1d4

+ 1 - 1
Source/BansheeEngine/Include/BsRendererMaterial.h

@@ -11,7 +11,7 @@
  *  @{
  */
 
-/** References the shader path in RendererMaterial implementation */
+/** References the shader path in RendererMaterial implementation. */
 #define RMAT_DEF(path)														\
 	public:																	\
 	static void _initMetaData()												\

+ 15 - 5
Source/BansheeEngine/Source/BsBuiltinResources.cpp

@@ -1178,12 +1178,22 @@ namespace BansheeEngine
 
 								shaderImportOptions->getDefines() = variation.getAll();
 
-								Path uniquePath = relativeAssetPath;
-								uniquePath.setFilename(relativeAssetPath.getFilename() + "_" + toString(variationIdx));
-								resourcesToSave.push_back(std::make_pair(relativeAssetPath, shaderImportOptions));
+								Path uniquePath;
+								if(variationIdx == 0)
+								{
+									uniquePath = relativeAssetPath;
+								}
+								else
+								{
+									uniquePath = relativePath;
+									uniquePath.setFilename(relativePath.getWFilename(false) + L"_" + toWString(variationIdx) +
+										relativePath.getWExtension() + L".asset");
+								}
+
+								resourcesToSave.push_back(std::make_pair(uniquePath, shaderImportOptions));
+
+								variationIdx++;
 							}
-
-							variationIdx++;
 						}
 					}
 					else

+ 8 - 0
Source/MBansheeEditor/Windows/Library/LibraryWindow.cs

@@ -397,6 +397,14 @@ namespace BansheeEditor
         /// <param name="path">Project library path to the element.</param>
         public void Ping(string path)
         {
+            if (!string.IsNullOrEmpty(path))
+            {
+                string parentDir = PathEx.GetParent(path);
+
+                if(!PathEx.Compare(parentDir, CurrentFolder))
+                    EnterDirectory(parentDir);
+            }
+
             content.MarkAsPinged(pingPath, false);
             pingPath = path;
             content.MarkAsPinged(pingPath, true);

+ 13 - 0
Source/MBansheeEngine/Utility/PathEx.cs

@@ -22,6 +22,19 @@ namespace BansheeEngine
         /// <returns>True if both paths point to the same place.</returns>
         public static bool Compare(string a, string b)
         {
+            if (string.IsNullOrEmpty(a))
+            {
+                if (string.IsNullOrEmpty(b))
+                    return true;
+
+                return false;
+            }
+            else
+            {
+                if (string.IsNullOrEmpty(b))
+                    return false;
+            }
+
             return Path.GetFullPath(a) == Path.GetFullPath(b);
         }
 

+ 1 - 1
Source/RenderBeast/Source/BsPostProcessing.cpp

@@ -10,7 +10,7 @@ namespace BansheeEngine
 {
 	PostProcessSettings::PostProcessSettings()
 		: histogramLog2Min(-8.0f), histogramLog2Max(4.0f), histogramPctLow(0.8f), histogramPctHigh(0.985f)
-		, minEyeAdaptation(0.5f), maxEyeAdaptation(2.0f), exposureScale(0.0f), eyeAdaptationSpeedUp(3.0f)
+		, minEyeAdaptation(0.3f), maxEyeAdaptation(2.0f), exposureScale(0.0f), eyeAdaptationSpeedUp(3.0f)
 		, eyeAdaptationSpeedDown(3.0f), filmicCurveShoulderStrength(0.22f), filmicCurveLinearStrength(0.3f)
 		, filmicCurveLinearAngle(0.1f), filmicCurveToeStrength(0.2f), filmicCurveToeNumerator(0.01f)
 		, filmicCurveToeDenominator(0.3f), filmicCurveLinearWhitePoint(11.2f), tonemapping(true), gamma(2.2f)