Browse Source

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 years ago
parent
commit
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)														\
 #define RMAT_DEF(path)														\
 	public:																	\
 	public:																	\
 	static void _initMetaData()												\
 	static void _initMetaData()												\

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

@@ -1178,12 +1178,22 @@ namespace BansheeEngine
 
 
 								shaderImportOptions->getDefines() = variation.getAll();
 								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
 					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>
         /// <param name="path">Project library path to the element.</param>
         public void Ping(string path)
         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);
             content.MarkAsPinged(pingPath, false);
             pingPath = path;
             pingPath = path;
             content.MarkAsPinged(pingPath, true);
             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>
         /// <returns>True if both paths point to the same place.</returns>
         public static bool Compare(string a, string b)
         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);
             return Path.GetFullPath(a) == Path.GetFullPath(b);
         }
         }
 
 

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

@@ -10,7 +10,7 @@ namespace BansheeEngine
 {
 {
 	PostProcessSettings::PostProcessSettings()
 	PostProcessSettings::PostProcessSettings()
 		: histogramLog2Min(-8.0f), histogramLog2Max(4.0f), histogramPctLow(0.8f), histogramPctHigh(0.985f)
 		: 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)
 		, eyeAdaptationSpeedDown(3.0f), filmicCurveShoulderStrength(0.22f), filmicCurveLinearStrength(0.3f)
 		, filmicCurveLinearAngle(0.1f), filmicCurveToeStrength(0.2f), filmicCurveToeNumerator(0.01f)
 		, filmicCurveLinearAngle(0.1f), filmicCurveToeStrength(0.2f), filmicCurveToeNumerator(0.01f)
 		, filmicCurveToeDenominator(0.3f), filmicCurveLinearWhitePoint(11.2f), tonemapping(true), gamma(2.2f)
 		, filmicCurveToeDenominator(0.3f), filmicCurveLinearWhitePoint(11.2f), tonemapping(true), gamma(2.2f)