Răsfoiți Sursa

Moved unneeded modules to Templates/Modules
Added templated getObjectsByClass to Scene for easier engine-side polling of objects, including nested checks for subscenes
Proper init'ing of mGamemodeName in LevelAsset, as well as proper fieldType for mIsSubLevel
D3D11 added logic to handle scaling down of textures in cubemap arrays for lower texture resolution preferences
Added ability to collapse groups programmatically to GuiVariableInspector
Upped PSSM shadowmap max size to 4096
Caught GL deferred lighting/probes up to D3D11
Temporarily disabled forward lighting/probes on GL materials until conversion finished
Upped smMaxInstancingVerts to 2000 from 200 to support slightly more detailed meshes being instanced
Reordered project settings so they load ahead of core modules, so that core modules can actually use project settings
Established current preset file for PostFXManager to use for reverting
WIP logic for forcing probes to update as part of level lighting load step in loading process
Streamlined PostFXManager code, removing unnecessary/redundant files
Coverted HDR, Lightrays and SSAO and ExamplePostEffect to use new PostFX Manager/Editor paradigm
PostFX manager now enacts callbacks so that postFXs' can process their own settings as well as provide editor fields
Changed PostFX editor to work with new callbacks via using VariableInspector
Updated PostEffectAsset's template file so new PostFX's will now automatically register with the PostFXManager and have the needed new callbacks for integration
Made HDR on by default, removed enable field from editing
Made probe bake resolution a project setting
Updated many GL postFX shaders to have proper case for PostFx.glsl
Example module now loads ExampleGUI and ExamplePostEffect during init'ing
Removed unneeded autoload definitions from ExampleModule's module file
Fixed Graphics Adapter settings field to properly display as well as apply setting
Updated many referenced profiles in tools folder to use the Tools specific gui profiles to make theming more consistent
Fixed coloration of tools button bitmap to make theming more consistent
Updated a few theme settings for improved visibility with theme, particularly selected/highlighted text
Moved AssetBrowser field types to separated folder/files
Updated new module creation to properly utilize template file instead of overriding it with a programmatic script generation.
Removed unneded default autoload definitions from new modules
Added WIP for editing Module/Asset dependencies
Updated the PostEffectAsset to properly generate glsl and hlsl files from templates
Updated module editor window to display only necessary fields
Added WIP of TerrainAsset
Added shaderCache gitignore file so folder isn't lost

Areloch 6 ani în urmă
părinte
comite
e7bf49e801
100 a modificat fișierele cu 1218 adăugiri și 4645 ștergeri
  1. 7 1
      Engine/source/T3D/Scene.cpp
  2. 44 1
      Engine/source/T3D/Scene.h
  3. 2 1
      Engine/source/T3D/assets/LevelAsset.cpp
  4. 290 0
      Engine/source/T3D/assets/TerrainAsset.cpp
  5. 103 0
      Engine/source/T3D/assets/TerrainAsset.h
  6. 6 0
      Engine/source/gfx/gfxTextureManager.cpp
  7. 37 0
      Engine/source/gui/editor/inspector/variableInspector.cpp
  8. 3 1
      Engine/source/gui/editor/inspector/variableInspector.h
  9. 3 3
      Engine/source/lighting/shadowMap/lightShadowMap.cpp
  10. 143 150
      Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp
  11. 5 0
      Engine/source/shaderGen/GLSL/shaderFeatureGLSL.h
  12. 2 2
      Engine/source/ts/tsMesh.cpp
  13. 1 1
      Engine/source/ts/tsShapeInstance.cpp
  14. 3 3
      Templates/BaseGame/game/core/Core.cs
  15. 13 0
      Templates/BaseGame/game/core/clientServer/scripts/client/levelDownload.cs
  16. 1 1
      Templates/BaseGame/game/core/gui/scripts/canvas.cs
  17. 3 2
      Templates/BaseGame/game/core/postFX/Core_PostFX.cs
  18. 0 2755
      Templates/BaseGame/game/core/postFX/guis/postFxManager.gui
  19. 74 0
      Templates/BaseGame/game/core/postFX/scripts/hdr.cs
  20. 45 1
      Templates/BaseGame/game/core/postFX/scripts/lightRay.cs
  21. 63 3
      Templates/BaseGame/game/core/postFX/scripts/postFxManager.cs
  22. 0 446
      Templates/BaseGame/game/core/postFX/scripts/postFxManager.gui.cs
  23. 0 439
      Templates/BaseGame/game/core/postFX/scripts/postFxManager.gui.settings.cs
  24. 82 0
      Templates/BaseGame/game/core/postFX/scripts/ssao.cs
  25. 2 0
      Templates/BaseGame/game/core/rendering/Core_Rendering.cs
  26. 109 110
      Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl
  27. 19 17
      Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl
  28. 1 1
      Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/deferredShadingP.glsl
  29. 2 2
      Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/pointLightP.glsl
  30. 0 68
      Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/probeShadingP.glsl
  31. 31 41
      Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl
  32. 0 162
      Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeP.glsl
  33. 0 32
      Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeV.glsl
  34. 1 1
      Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl
  35. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/caustics/gl/causticsP.glsl
  36. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_CalcCoC_P.glsl
  37. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_CalcCoC_V.glsl
  38. 2 2
      Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Final_P.glsl
  39. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Final_V.glsl
  40. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Passthrough_V.glsl
  41. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/gl/edgeAAP.glsl
  42. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/gl/edgeAAV.glsl
  43. 2 2
      Templates/BaseGame/game/core/rendering/shaders/postFX/gl/chromaticLens.glsl
  44. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/gl/flashP.glsl
  45. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/gl/motionBlurP.glsl
  46. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/gl/underwaterFogP.glsl
  47. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/bloomGaussBlurHP.glsl
  48. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/bloomGaussBlurVP.glsl
  49. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/brightPassFilterP.glsl
  50. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/calculateAdaptedLumP.glsl
  51. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/finalPassCombineP.glsl
  52. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/luminanceVisP.glsl
  53. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/sampleLumInitialP.glsl
  54. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/sampleLumIterativeP.glsl
  55. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/lightRay/gl/lightRayOccludeP.glsl
  56. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/lightRay/gl/lightRayP.glsl
  57. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/gl/SSAO_P.glsl
  58. 1 1
      Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/gl/SSAO_PowerTable_V.glsl
  59. 4 3
      Templates/BaseGame/game/data/ExampleModule/ExampleModule.cs
  60. 0 10
      Templates/BaseGame/game/data/ExampleModule/ExampleModule.module
  61. 56 48
      Templates/BaseGame/game/data/ExampleModule/levels/ExampleLevel.mis
  62. 35 0
      Templates/BaseGame/game/data/ExampleModule/postFXs/ExamplePostEffect.cs
  63. 0 9
      Templates/BaseGame/game/data/Kork/Images/player_Albedo.asset.taml
  64. BIN
      Templates/BaseGame/game/data/Kork/Images/player_Albedo.png
  65. 0 19
      Templates/BaseGame/game/data/Kork/Kork.cs
  66. 0 25
      Templates/BaseGame/game/data/Kork/Kork.module
  67. 0 9
      Templates/BaseGame/game/data/Kork/Shapes/OrcMage.asset.taml
  68. 0 5
      Templates/BaseGame/game/data/Kork/Shapes/OrcMage.cs
  69. BIN
      Templates/BaseGame/game/data/Kork/Shapes/OrcMage.dts
  70. 0 9
      Templates/BaseGame/game/data/Kork/materials/player_mat.asset.taml
  71. 0 6
      Templates/BaseGame/game/data/Kork/materials/player_mat.cs
  72. 0 9
      Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_BaseColor.asset.taml
  73. BIN
      Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_BaseColor.png
  74. BIN
      Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_Metallic.png
  75. 0 9
      Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_Metallic.taml
  76. BIN
      Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_Roughness.png
  77. 0 9
      Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_Roughness.taml
  78. BIN
      Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_normal.png
  79. 0 9
      Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_normal.taml
  80. 0 9
      Templates/BaseGame/game/data/SpaceOrc/Shapes/SpaceOrcMage.asset.taml
  81. 0 5
      Templates/BaseGame/game/data/SpaceOrc/Shapes/SpaceOrcMage.cs
  82. BIN
      Templates/BaseGame/game/data/SpaceOrc/Shapes/SpaceOrcMage.dts
  83. 0 19
      Templates/BaseGame/game/data/SpaceOrc/SpaceOrc.cs
  84. 0 25
      Templates/BaseGame/game/data/SpaceOrc/SpaceOrc.module
  85. 0 9
      Templates/BaseGame/game/data/SpaceOrc/materials/Orc_Material.asset.taml
  86. 0 12
      Templates/BaseGame/game/data/SpaceOrc/materials/Orc_Material.cs
  87. BIN
      Templates/BaseGame/game/data/StaticShapeTest/Images/Grid_512_orange.png
  88. 0 9
      Templates/BaseGame/game/data/StaticShapeTest/Images/Grid_512_orange_ALBEDO.asset.taml
  89. 0 9
      Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cube.asset.taml
  90. 0 5
      Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cube.cs
  91. BIN
      Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cube.fbx
  92. 0 8
      Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cylinder.asset.taml
  93. 0 5
      Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cylinder.cs
  94. BIN
      Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cylinder.fbx
  95. 0 21
      Templates/BaseGame/game/data/StaticShapeTest/Shapes/materials.cs
  96. 0 19
      Templates/BaseGame/game/data/StaticShapeTest/StaticShapeTest.cs
  97. 0 25
      Templates/BaseGame/game/data/StaticShapeTest/StaticShapeTest.module
  98. 0 9
      Templates/BaseGame/game/data/StaticShapeTest/materials/Grid_512_orange.asset.taml
  99. 0 7
      Templates/BaseGame/game/data/StaticShapeTest/materials/Grid_512_orange.cs
  100. 2 0
      Templates/BaseGame/game/data/shaderCache/.gitignore

+ 7 - 1
Engine/source/T3D/Scene.cpp

@@ -81,6 +81,12 @@ void Scene::onRemove()
    }*/
 }
 
+void Scene::onPostAdd()
+{
+   if (isMethod("onPostAdd"))
+      Con::executef(this, "onPostAdd");
+}
+
 void Scene::addObject(SimObject* object)
 {
    //Child scene
@@ -175,7 +181,7 @@ void Scene::unpackUpdate(NetConnection *conn, BitStream *stream)
 }
 
 //
-Vector<SceneObject*> Scene::getObjectsByClass(String className)
+Vector<SceneObject*> Scene::getObjectsByClass(String className, bool checkSubscenes)
 {
    return Vector<SceneObject*>();
 }

+ 44 - 1
Engine/source/T3D/Scene.h

@@ -50,6 +50,7 @@ public:
 
    virtual bool onAdd();
    virtual void onRemove();
+   virtual void onPostAdd();
 
    virtual void interpolateTick(F32 delta);
    virtual void processTick();
@@ -67,7 +68,10 @@ public:
    void unpackUpdate(NetConnection *conn, BitStream *stream);
 
    //
-   Vector<SceneObject*> getObjectsByClass(String className);
+   Vector<SceneObject*> getObjectsByClass(String className, bool checkSubscenes);
+
+   template <class T>
+   Vector<T*> getObjectsByClass(bool checkSubscenes);
 
    static Scene *getRootScene() 
    { 
@@ -79,3 +83,42 @@ public:
 
    static Vector<Scene*> smSceneList;
 };
+
+
+template <class T>
+Vector<T*> Scene::getObjectsByClass(bool checkSubscenes)
+{
+   Vector<T*> foundObjects;
+
+   T* curObject;
+
+   //first, check ourself
+   for (U32 i = 0; i < mPermanentObjects.size(); i++)
+   {
+      curObject = dynamic_cast<T*>(mPermanentObjects[i]);
+      if (curObject)
+         foundObjects.push_back(curObject);
+   }
+
+   for (U32 i = 0; i < mDynamicObjects.size(); i++)
+   {
+      curObject = dynamic_cast<T*>(mDynamicObjects[i]);
+      if (curObject)
+         foundObjects.push_back(curObject);
+   }
+
+   if (checkSubscenes)
+   {
+      for (U32 i = 0; i < mSubScenes.size(); i++)
+      {
+         Vector<T*> appendList = mSubScenes[i]->getObjectsByClass<T>(true);
+
+         for (U32 a = 0; a < appendList.size(); a++)
+         {
+            foundObjects.push_back(appendList[a]);
+         }
+      }
+   }
+
+   return foundObjects;
+}

+ 2 - 1
Engine/source/T3D/assets/LevelAsset.cpp

@@ -88,6 +88,7 @@ LevelAsset::LevelAsset() : AssetBase(), mIsSubLevel(false)
    mLevelFile = StringTable->EmptyString();
    mPreviewImage = StringTable->EmptyString();
 
+   mGamemodeName = StringTable->EmptyString();
    mMainLevelAsset = StringTable->EmptyString();
 }
 
@@ -114,7 +115,7 @@ void LevelAsset::initPersistFields()
    addProtectedField("PreviewImage", TypeAssetLooseFilePath, Offset(mPreviewImage, LevelAsset),
       &setPreviewImageFile, &getPreviewImageFile, "Path to the image used for selection preview.");
 
-   addField("isSubScene", TypeString, Offset(mIsSubLevel, LevelAsset), "Is this a sublevel to another Scene");
+   addField("isSubScene", TypeBool, Offset(mIsSubLevel, LevelAsset), "Is this a sublevel to another Scene");
    addField("gameModeName", TypeString, Offset(mGamemodeName, LevelAsset), "Name of the Game Mode to be used with this level");
 }
 

+ 290 - 0
Engine/source/T3D/assets/TerrainAsset.cpp

@@ -0,0 +1,290 @@
+//-----------------------------------------------------------------------------
+// Copyright (c) 2013 GarageGames, LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+
+#ifndef TERRAINASSET_H
+#include "TerrainAsset.h"
+#endif
+
+#ifndef _ASSET_MANAGER_H_
+#include "assets/assetManager.h"
+#endif
+
+#ifndef _CONSOLETYPES_H_
+#include "console/consoleTypes.h"
+#endif
+
+#ifndef _TAML_
+#include "persistence/taml/taml.h"
+#endif
+
+#ifndef _ASSET_PTR_H_
+#include "assets/assetPtr.h"
+#endif
+
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_CONOBJECT(TerrainAsset);
+
+ConsoleType(TerrainAssetPtr, TypeTerrainAssetPtr, TerrainAsset, ASSET_ID_FIELD_PREFIX)
+
+//-----------------------------------------------------------------------------
+
+ConsoleGetType(TypeTerrainAssetPtr)
+{
+   // Fetch asset Id.
+   return (*((AssetPtr<TerrainAsset>*)dptr)).getAssetId();
+}
+
+//-----------------------------------------------------------------------------
+
+ConsoleSetType(TypeTerrainAssetPtr)
+{
+   // Was a single argument specified?
+   if (argc == 1)
+   {
+      // Yes, so fetch field value.
+      const char* pFieldValue = argv[0];
+
+      // Fetch asset pointer.
+      AssetPtr<TerrainAsset>* pAssetPtr = dynamic_cast<AssetPtr<TerrainAsset>*>((AssetPtrBase*)(dptr));
+
+      // Is the asset pointer the correct type?
+      if (pAssetPtr == NULL)
+      {
+         // No, so fail.
+         //Con::warnf("(TypeMaterialAssetPtr) - Failed to set asset Id '%d'.", pFieldValue);
+         return;
+      }
+
+      // Set asset.
+      pAssetPtr->setAssetId(pFieldValue);
+
+      return;
+   }
+
+   // Warn.
+   Con::warnf("(TypeTerrainAssetPtr) - Cannot set multiple args to a single asset.");
+}
+
+//-----------------------------------------------------------------------------
+
+TerrainAsset::TerrainAsset()
+{
+   mTerrainFile = StringTable->EmptyString();
+}
+
+//-----------------------------------------------------------------------------
+
+TerrainAsset::~TerrainAsset()
+{
+}
+
+//-----------------------------------------------------------------------------
+
+void TerrainAsset::initPersistFields()
+{
+   // Call parent.
+   Parent::initPersistFields();
+
+   //addField("shaderGraph", TypeRealString, Offset(mShaderGraphFile, TerrainAsset), "");
+   addProtectedField("terrainFile", TypeAssetLooseFilePath, Offset(mTerrainFile, TerrainAsset),
+      &setTerrainFile, &getTerrainFile, "Path to the file containing the terrain data.");
+}
+
+void TerrainAsset::initializeAsset()
+{
+   // Call parent.
+   Parent::initializeAsset();
+
+   if (!Platform::isFullPath(mTerrainFile))
+      mTerrainFile = getOwned() ? expandAssetFilePath(mTerrainFile) : mTerrainFile;
+
+   //if (Platform::isFile(mTerrainFile))
+   //   Con::executeFile(mScriptFile, false, false);
+}
+
+void TerrainAsset::onAssetRefresh()
+{
+   mTerrainFile = expandAssetFilePath(mTerrainFile);
+
+   //if (Platform::isFile(mScriptFile))
+   //   Con::executeFile(mScriptFile, false, false);
+}
+
+void TerrainAsset::setTerrainFile(const char* pScriptFile)
+{
+   // Sanity!
+   AssertFatal(pScriptFile != NULL, "Cannot use a NULL script file.");
+
+   // Fetch image file.
+   pScriptFile = StringTable->insert(pScriptFile);
+
+   // Update.
+   mTerrainFile = getOwned() ? expandAssetFilePath(pScriptFile) : pScriptFile;
+
+   // Refresh the asset.
+   refreshAsset();
+}
+
+//------------------------------------------------------------------------------
+
+void TerrainAsset::copyTo(SimObject* object)
+{
+   // Call to parent.
+   Parent::copyTo(object);
+}
+
+//-----------------------------------------------------------------------------
+// GuiInspectorTypeAssetId
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_CONOBJECT(GuiInspectorTypeTerrainAssetPtr);
+
+ConsoleDocClass(GuiInspectorTypeTerrainAssetPtr,
+   "@brief Inspector field type for Material Asset Objects\n\n"
+   "Editor use only.\n\n"
+   "@internal"
+);
+
+void GuiInspectorTypeTerrainAssetPtr::consoleInit()
+{
+   Parent::consoleInit();
+
+   ConsoleBaseType::getType(TypeTerrainAssetPtr)->setInspectorFieldType("GuiInspectorTypeTerrainAssetPtr");
+}
+
+GuiControl* GuiInspectorTypeTerrainAssetPtr::constructEditControl()
+{
+   // Create base filename edit controls
+   mUseHeightOverride = true;
+   mHeightOverride = 100;
+
+   mMatEdContainer = new GuiControl();
+   mMatEdContainer->registerObject();
+
+   addObject(mMatEdContainer);
+
+   // Create "Open in ShapeEditor" button
+   mMatPreviewButton = new GuiBitmapButtonCtrl();
+
+   const char* matAssetId = getData();
+
+   TerrainAsset* matAsset = AssetDatabase.acquireAsset< TerrainAsset>(matAssetId);
+
+   TerrainMaterial* materialDef = nullptr;
+
+   char bitmapName[512] = "tools/worldEditor/images/toolbar/shape-editor";
+
+   /*if (!Sim::findObject(matAsset->getMaterialDefinitionName(), materialDef))
+   {
+      Con::errorf("GuiInspectorTypeTerrainAssetPtr::constructEditControl() - unable to find material in asset");
+   }
+   else
+   {
+      mMatPreviewButton->setBitmap(materialDef->mDiffuseMapFilename[0]);
+   }*/
+
+   mMatPreviewButton->setPosition(0, 0);
+   mMatPreviewButton->setExtent(100,100);
+
+   // Change filespec
+   char szBuffer[512];
+   dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"TerrainAsset\", \"AssetBrowser.changeAsset\", %d, %s);",
+      mInspector->getComponentGroupTargetId(), mCaption);
+   mMatPreviewButton->setField("Command", szBuffer);
+
+   mMatPreviewButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile");
+   mMatPreviewButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile");
+   mMatPreviewButton->setDataField(StringTable->insert("hovertime"), NULL, "1000");
+
+   StringBuilder strbld;
+   /*strbld.append(matAsset->getMaterialDefinitionName());
+   strbld.append("\n");
+   strbld.append("Open this file in the Material Editor");*/
+
+   mMatPreviewButton->setDataField(StringTable->insert("tooltip"), NULL, strbld.data());
+
+   _registerEditControl(mMatPreviewButton);
+   //mMatPreviewButton->registerObject();
+   mMatEdContainer->addObject(mMatPreviewButton);
+
+   mMatAssetIdTxt = new GuiTextEditCtrl();
+   mMatAssetIdTxt->registerObject();
+   mMatAssetIdTxt->setActive(false);
+
+   mMatAssetIdTxt->setText(matAssetId);
+
+   mMatAssetIdTxt->setBounds(100, 0, 150, 18);
+   mMatEdContainer->addObject(mMatAssetIdTxt);
+
+   return mMatEdContainer;
+}
+
+bool GuiInspectorTypeTerrainAssetPtr::updateRects()
+{
+   S32 dividerPos, dividerMargin;
+   mInspector->getDivider(dividerPos, dividerMargin);
+   Point2I fieldExtent = getExtent();
+   Point2I fieldPos = getPosition();
+
+   mCaptionRect.set(0, 0, fieldExtent.x - dividerPos - dividerMargin, fieldExtent.y);
+   mEditCtrlRect.set(fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 34, fieldExtent.y);
+
+   bool resized = mEdit->resize(mEditCtrlRect.point, mEditCtrlRect.extent);
+
+   if (mMatEdContainer != nullptr)
+   {
+      mMatPreviewButton->resize(mEditCtrlRect.point, mEditCtrlRect.extent);
+   }
+
+   if (mMatPreviewButton != nullptr)
+   {
+      mMatPreviewButton->resize(Point2I::Zero, Point2I(100, 100));
+   }
+
+   if (mMatAssetIdTxt != nullptr)
+   {
+      mMatAssetIdTxt->resize(Point2I(100, 0), Point2I(mEditCtrlRect.extent.x - 100, 18));
+   }
+
+   return resized;
+}
+
+void GuiInspectorTypeTerrainAssetPtr::setMaterialAsset(String assetId)
+{
+   mTargetObject->setDataField(mCaption, "", assetId);
+
+   //force a refresh
+   SimObject* obj = mInspector->getInspectObject();
+   mInspector->inspectObject(obj);
+}
+
+DefineEngineMethod(GuiInspectorTypeTerrainAssetPtr, setMaterialAsset, void, (String assetId), (""),
+   "Gets a particular shape animation asset for this shape.\n"
+   "@param animation asset index.\n"
+   "@return Shape Animation Asset.\n")
+{
+   if (assetId == String::EmptyString)
+      return;
+
+   return object->setMaterialAsset(assetId);
+}

+ 103 - 0
Engine/source/T3D/assets/TerrainAsset.h

@@ -0,0 +1,103 @@
+//-----------------------------------------------------------------------------
+// Copyright (c) 2013 GarageGames, LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+#ifndef TERRAINASSET_H
+#define TERRAINASSET_H
+
+#ifndef _ASSET_BASE_H_
+#include "assets/assetBase.h"
+#endif
+
+#ifndef _ASSET_DEFINITION_H_
+#include "assets/assetDefinition.h"
+#endif
+
+#ifndef _STRINGUNIT_H_
+#include "string/stringUnit.h"
+#endif
+
+#ifndef _ASSET_FIELD_TYPES_H_
+#include "assets/assetFieldTypes.h"
+#endif
+
+#ifndef _GFXDEVICE_H_
+#include "gfx/gfxDevice.h"
+#endif
+
+#ifndef _GUI_INSPECTOR_TYPES_H_
+#include "gui/editor/guiInspectorTypes.h"
+#endif
+
+#include "terrain/terrData.h"
+
+//-----------------------------------------------------------------------------
+class TerrainAsset : public AssetBase
+{
+   typedef AssetBase Parent;
+
+   StringTableEntry        mTerrainFile;
+
+public:
+   TerrainAsset();
+   virtual ~TerrainAsset();
+
+   /// Engine.
+   static void initPersistFields();
+   virtual void copyTo(SimObject* object);
+
+   void                    setTerrainFile(const char* pTerrainFile);
+   inline StringTableEntry getTerrainFile(void) const { return mTerrainFile; };
+
+   /// Declare Console Object.
+   DECLARE_CONOBJECT(TerrainAsset);
+
+protected:
+   virtual void initializeAsset();
+   virtual void onAssetRefresh(void);
+
+   static bool setTerrainFile(void *obj, const char *index, const char *data) { static_cast<TerrainAsset*>(obj)->setTerrainFile(data); return false; }
+   static const char* getTerrainFile(void* obj, const char* data) { return static_cast<TerrainAsset*>(obj)->getTerrainFile(); }
+};
+
+DefineConsoleType(TypeTerrainAssetPtr, TerrainAsset)
+
+//-----------------------------------------------------------------------------
+// TypeAssetId GuiInspectorField Class
+//-----------------------------------------------------------------------------
+class GuiInspectorTypeTerrainAssetPtr : public GuiInspectorField
+{
+   typedef GuiInspectorField Parent;
+public:
+
+   GuiControl*       mMatEdContainer;
+   GuiBitmapButtonCtrl  *mMatPreviewButton;
+   GuiTextEditCtrl *mMatAssetIdTxt;
+
+   DECLARE_CONOBJECT(GuiInspectorTypeTerrainAssetPtr);
+   static void consoleInit();
+
+   virtual GuiControl* constructEditControl();
+   virtual bool updateRects();
+   void setMaterialAsset(String assetId);
+};
+
+#endif // _ASSET_BASE_H_
+

+ 6 - 0
Engine/source/gfx/gfxTextureManager.cpp

@@ -760,6 +760,12 @@ GFXTextureObject *GFXTextureManager::createTexture( U32 width, U32 height, GFXFo
    GFXFormat checkFmt = format;
    _validateTexParams( localWidth, localHeight, profile, numMips, checkFmt );
 
+   //check to see if we've handled the mips just now, and if not, then handle them here
+   if (numMips == numMipLevels && (localWidth != width || localHeight != height))
+   {
+      numMips = mFloor(mLog2(mMax(localWidth, localHeight))) + 1;
+   }
+
 //   AssertFatal( checkFmt == format, "Anonymous texture didn't get the format it wanted." );
 
    GFXTextureObject *outTex = NULL;

+ 37 - 0
Engine/source/gui/editor/inspector/variableInspector.cpp

@@ -116,6 +116,32 @@ void GuiVariableInspector::endGroup()
    mCurrentGroup = "";
 }
 
+void GuiVariableInspector::setGroupExpanded(const char* groupName, bool isExpanded)
+{
+   String name = groupName;
+   for (U32 g = 0; g < mGroups.size(); g++)
+   {
+      if (mGroups[g]->getGroupName() == name)
+      {
+         if (isExpanded)
+            mGroups[g]->expand();
+         else
+            mGroups[g]->collapse();
+      }
+   }
+}
+
+void GuiVariableInspector::setGroupsExpanded(bool isExpanded)
+{
+   for (U32 g = 0; g < mGroups.size(); g++)
+   {
+      if (isExpanded)
+         mGroups[g]->expand();
+      else
+         mGroups[g]->collapse();
+   }
+}
+
 void GuiVariableInspector::addField(const char* name, const char* label, const char* typeName, const char* description, 
    const char* defaultValue, const char* dataValues, const char* callbackName, SimObject* ownerObj)
 {
@@ -227,6 +253,17 @@ DefineEngineMethod(GuiVariableInspector, endGroup, void, (),, "endGroup()")
    object->endGroup();
 }
 
+DefineEngineMethod(GuiVariableInspector, setGroupExpanded, void, (const char* groupName, bool isExpanded), ("", false), "setGroupExpanded()")
+{
+   object->setGroupExpanded(groupName, isExpanded);
+}
+
+DefineEngineMethod(GuiVariableInspector, setGroupsExpanded, void, (bool isExpanded), (false), "setGroupsExpanded()")
+{
+   object->setGroupsExpanded(isExpanded);
+}
+
+
 DefineEngineMethod(GuiVariableInspector, addField, void, (const char* name, const char* label, const char* typeName, 
    const char* description, const char* defaultValue, const char* dataValues, SimObject* ownerObj),
    ("","","","","", "", nullAsType<SimObject*>()), "addField( fieldName/varName, fieldLabel, fieldTypeName, description, defaultValue, defaultValues, ownerObject )")

+ 3 - 1
Engine/source/gui/editor/inspector/variableInspector.h

@@ -51,6 +51,8 @@ public:
 
    void startGroup(const char* name);
    void endGroup();
+   void setGroupExpanded(const char* groupName, bool isExpanded);
+   void setGroupsExpanded(bool isExpanded);
 
    void addField(const char* name, const char* label, const char* typeName, const char* description, 
       const char* defaultValue, const char* dataValues, const char* callbackName, SimObject* ownerObj);
@@ -71,4 +73,4 @@ protected:
 
 };
 
-#endif // _GUI_VARIABLEINSPECTOR_H_
+#endif // _GUI_VARIABLEINSPECTOR_H_

+ 3 - 3
Engine/source/lighting/shadowMap/lightShadowMap.cpp

@@ -595,7 +595,7 @@ ShadowMapParams::ShadowMapParams( LightInfo *light )
    overDarkFactor.set(2000.0f, 1000.0f, 500.0f, 100.0f);
    numSplits = 4;
    logWeight = 0.91f;
-   texSize = 512;
+   texSize = 1024;
    shadowDistance = 400.0f;
    shadowSoftness = 0.15f;
    fadeStartDist = 0.0f;
@@ -655,9 +655,9 @@ void ShadowMapParams::_validate()
       // based on the split count to keep the total
       // shadow texture size within 4096.
       if ( numSplits == 2 || numSplits == 4 )
-         maxTexSize = 2048;
+         maxTexSize = 4096;
       if ( numSplits == 3 )
-         maxTexSize = 1024;
+         maxTexSize = 2048;
    }
    else
       numSplits = 1;

+ 143 - 150
Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp

@@ -827,6 +827,73 @@ Var* ShaderFeatureGLSL::addOutDetailTexCoord(   Vector<ShaderComponent*> &compon
 	return outTex;
 }
 
+Var* ShaderFeatureGLSL::getSurface(Vector<ShaderComponent*>& componentList, MultiLine* meta, const MaterialFeatureData& fd)
+{
+   ShaderConnector* connectComp = dynamic_cast<ShaderConnector*>(componentList[C_CONNECTOR]);
+
+   /*Var* diffuseColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
+
+   Var* matinfo = (Var*)LangElement::find("PBRConfig");
+   if (!matinfo)
+   {
+      Var* metalness = (Var*)LangElement::find("metalness");
+      if (!metalness)
+      {
+         metalness = new Var("metalness", "float");
+         metalness->uniform = true;
+         metalness->constSortPos = cspPotentialPrimitive;
+      }
+
+      Var* smoothness = (Var*)LangElement::find("smoothness");
+      if (!smoothness)
+      {
+         smoothness = new Var("smoothness", "float");
+         smoothness->uniform = true;
+         smoothness->constSortPos = cspPotentialPrimitive;
+      }
+
+      matinfo = new Var("PBRConfig", "vec4");
+      LangElement* colorDecl = new DecOp(matinfo);
+      meta->addStatement(new GenOp("   @ = vec4(0.0,1.0,@,@);\r\n", colorDecl, smoothness, metalness)); //reconstruct matinfo, no ao darkening
+   }
+
+   Var* wsNormal = (Var*)LangElement::find("wsNormal");
+   Var* normal = (Var*)LangElement::find("normal");
+   if (!normal)
+   {
+      normal = new Var("normal", "vec3");
+      meta->addStatement(new GenOp("  @;\r\n\n", new DecOp(normal)));
+      if (!fd.features[MFT_NormalMap])
+      {
+         Var* worldToTangent = getInWorldToTangent(componentList);
+         meta->addStatement(new GenOp("  @ = normalize(tMul(@,vec3(0,0,1.0f)));\r\n\n", normal, worldToTangent));
+      }
+      else
+      {
+         meta->addStatement(new GenOp("   @ = normalize( half3( @ ) );\r\n", normal, wsNormal));
+      }      
+   }
+
+   Var* wsEyePos = (Var*)LangElement::find("eyePosWorld");
+   Var* wsPosition = getInWsPosition(componentList);
+   Var* wsView = getWsView(wsPosition, meta);
+
+   Var* surface = (Var*)LangElement::find("surface");
+
+   if (!surface)
+   {
+      surface = new Var("surface", "Surface");
+      meta->addStatement(new GenOp("  @ = createForwardSurface(@,@,@,@,@,@);\r\n\n", new DecOp(surface), diffuseColor, normal, matinfo,
+         wsPosition, wsEyePos, wsView));
+   }*/
+
+   Var* surface = (Var*)LangElement::find("surface");
+   if (!surface)
+   {
+      surface = new Var("surface", "float");
+   }
+   return surface;
+}
 //****************************************************************************
 // Base Texture
 //****************************************************************************
@@ -2060,33 +2127,13 @@ void RTLightingFeatGLSL::processPix(   Vector<ShaderComponent*> &componentList,
    // TODO: We can totally detect for this in the material
    // feature setup... we should move it out of here!
    //
-   if ( fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit] )
+   //if ( fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit] )
       return;
   
    ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>( componentList[C_CONNECTOR] );
 
    MultiLine *meta = new MultiLine;
 
-   // Look for a wsNormal or grab it from the connector.
-   Var *wsNormal = (Var*)LangElement::find( "wsNormal" );
-   if ( !wsNormal )
-   {
-      wsNormal = connectComp->getElement( RT_TEXCOORD );
-      wsNormal->setName( "wsNormal" );
-      wsNormal->setStructName( "IN" );
-      wsNormal->setType( "vec3" );
-
-      // If we loaded the normal its our responsibility
-      // to normalize it... the interpolators won't.
-      //
-      // Note we cast to half here to get partial precision
-      // optimized code which is an acceptable loss of
-      // precision for normals and performs much better
-      // on older Geforce cards.
-      //
-      meta->addStatement( new GenOp( "   @ = normalize( half3( @ ) );\r\n", wsNormal, wsNormal ) );
-   }
-
 	// Now the wsPosition and wsView.
    Var *wsPosition = getInWsPosition( componentList );
    Var *wsView = getWsView( wsPosition, meta );
@@ -2106,12 +2153,13 @@ void RTLightingFeatGLSL::processPix(   Vector<ShaderComponent*> &componentList,
    // Get all the light constants.
    Var *inLightPos  = new Var( "inLightPos", "vec4" );
    inLightPos->uniform = true;
-   inLightPos->arraySize = 3;
+   inLightPos->arraySize = 4;
    inLightPos->constSortPos = cspPotentialPrimitive;
 
-   Var *inLightInvRadiusSq  = new Var( "inLightInvRadiusSq", "vec4" );
-   inLightInvRadiusSq->uniform = true;
-   inLightInvRadiusSq->constSortPos = cspPotentialPrimitive;
+   Var * inLightConfigData = new Var( "inLightConfigData", "vec4" );
+   inLightConfigData->uniform = true;
+   inLightConfigData->arraySize = 4;
+   inLightConfigData->constSortPos = cspPotentialPrimitive;
 
    Var *inLightColor  = new Var( "inLightColor", "vec4" );
    inLightColor->uniform = true;
@@ -2120,56 +2168,54 @@ void RTLightingFeatGLSL::processPix(   Vector<ShaderComponent*> &componentList,
 
    Var *inLightSpotDir  = new Var( "inLightSpotDir", "vec4" );
    inLightSpotDir->uniform = true;
-   inLightSpotDir->arraySize = 3;
+   inLightSpotDir->arraySize = 4;
    inLightSpotDir->constSortPos = cspPotentialPrimitive;
 
-   Var *inLightSpotAngle  = new Var( "inLightSpotAngle", "vec4" );
-   inLightSpotAngle->uniform = true;
-   inLightSpotAngle->constSortPos = cspPotentialPrimitive;
+   Var * lightSpotParams = new Var( "lightSpotParams", "vec4" );
+   lightSpotParams->uniform = true;
+   lightSpotParams->arraySize = 4;
+   lightSpotParams->constSortPos = cspPotentialPrimitive;
 
-   Var *lightSpotFalloff  = new Var( "inLightSpotFalloff", "vec4" );
-   lightSpotFalloff->uniform = true;
-   lightSpotFalloff->constSortPos = cspPotentialPrimitive;
+   Var* hasVectorLight = new Var("hasVectorLight", "int");
+   hasVectorLight->uniform = true;
+   hasVectorLight->constSortPos = cspPotentialPrimitive;
 
-   Var *smoothness = (Var*)LangElement::find("smoothness");
-   if (!fd.features[MFT_SpecularMap])
+   Var* vectorLightDirection = new Var("vectorLightDirection", "vec4");
+   vectorLightDirection->uniform = true;
+   vectorLightDirection->constSortPos = cspPotentialPrimitive;
+
+   Var* vectorLightColor = new Var("vectorLightColor", "vec4");
+   vectorLightColor->uniform = true;
+   vectorLightColor->constSortPos = cspPotentialPrimitive;
+
+   Var* vectorLightBrightness = new Var("vectorLightBrightness", "float");
+   vectorLightBrightness->uniform = true;
+   vectorLightBrightness->constSortPos = cspPotentialPrimitive;
+
+   Var* surface = getSurface(componentList, meta, fd);
+   if (!surface)
    {
-      if (!smoothness)
-      {
-         smoothness = new Var("smoothness", "float");
-         smoothness->uniform = true;
-         smoothness->constSortPos = cspPotentialPrimitive;
-      }
-   }
+      Con::errorf("ShaderGen::RTLightingFeatGLSL()  - failed to generate surface!");
+      return;
+   }   
+   Var *smoothness = (Var*)LangElement::find("smoothness");
 
    Var *metalness = (Var*)LangElement::find("metalness");
-   if (!fd.features[MFT_SpecularMap])
-   {
-      if (!metalness)
-      {
-         metalness = new Var("metalness", "float");
-         metalness->uniform = true;
-         metalness->constSortPos = cspPotentialPrimitive;
-      }
-   }
 
-   Var *albedo = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
+   Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
 
    Var *ambient  = new Var( "ambient", "vec4" );
    ambient->uniform = true;
    ambient->constSortPos = cspPass;
+   
+   Var* lighting = new Var("lighting", "vec4");
+   meta->addStatement(new GenOp("   @ = compute4Lights( @, @, @, @,\r\n"
+      "      @, @, @, @, @, @, @);\r\n",
+      new DecOp(lighting), surface, lightMask, inLightPos, inLightConfigData, inLightColor, inLightSpotDir, lightSpotParams,
+         hasVectorLight, vectorLightDirection, vectorLightColor, vectorLightBrightness));
+
+   meta->addStatement(new GenOp("   @.rgb += @.rgb;\r\n", curColor, lighting));
 
-   // Calculate the diffuse shading and specular powers.
-   meta->addStatement( new GenOp( "   compute4Lights( @, @, @, @,\r\n"
-                                  "      @, @, @, @, @, @, @, @, @,\r\n"
-                                  "      @, @ );\r\n", 
-      wsView, wsPosition, wsNormal, lightMask,
-      inLightPos, inLightInvRadiusSq, inLightColor, inLightSpotDir, inLightSpotAngle, lightSpotFalloff, smoothness, metalness, albedo,
-      rtShading, specular ) );
-
-   // Apply the lighting to the diffuse color.
-   LangElement *lighting = new GenOp( "vec4( @.rgb + @.rgb, 1 )", rtShading, ambient );
-   meta->addStatement( new GenOp( "   @;\r\n", assignColor( lighting, Material::Mul ) ) );
    output = meta;  
 }
 
@@ -2872,7 +2918,7 @@ void HardwareSkinningFeatureGLSL::processVert(Vector<ShaderComponent*> &componen
 }
 
 //****************************************************************************
-// ReflectionProbeFeatHLSL
+// ReflectionProbeFeatGLSL
 //****************************************************************************
 
 ReflectionProbeFeatGLSL::ReflectionProbeFeatGLSL()
@@ -2880,6 +2926,17 @@ ReflectionProbeFeatGLSL::ReflectionProbeFeatGLSL()
 {
    addDependency(&mDep);
 }
+
+void ReflectionProbeFeatGLSL::processVert(Vector<ShaderComponent*>& componentList,
+   const MaterialFeatureData& fd)
+{
+   //MultiLine* meta = new MultiLine;
+   //output = meta;
+   // Also output the worldToTanget transform which
+   // we use to create the world space normal.
+   //getOutWorldToTangent(componentList, meta, fd);
+}
+
 void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList,
    const MaterialFeatureData& fd)
 {
@@ -2889,7 +2946,7 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
    // TODO: We can totally detect for this in the material
    // feature setup... we should move it out of here!
    //
-   if (fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit])
+   //if (fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit])
       return;
 
    ShaderConnector * connectComp = dynamic_cast<ShaderConnector*>(componentList[C_CONNECTOR]);
@@ -2897,15 +2954,13 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
    MultiLine * meta = new MultiLine;
 
    // Now the wsPosition and wsView.
-   Var * wsPosition = getInWsPosition(componentList);
-   Var * wsView = getWsView(wsPosition, meta);
-
-   Var * albedo = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
-
+   Var *wsPosition = getInWsPosition(componentList);
+   Var *wsView = getWsView(wsPosition, meta);
+   
    //Reflection Probe WIP
    U32 MAX_FORWARD_PROBES = 4;
 
-   Var * numProbes = new Var("numProbes", "float");
+   Var * numProbes = new Var("numProbes", "int");
    numProbes->uniform = true;
    numProbes->constSortPos = cspPotentialPrimitive;
 
@@ -2913,9 +2968,9 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
    cubeMips->uniform = true;
    cubeMips->constSortPos = cspPotentialPrimitive;
 
-   Var * hasSkylight = new Var("hasSkylight", "float");
-   hasSkylight->uniform = true;
-   hasSkylight->constSortPos = cspPotentialPrimitive;
+   Var * skylightCubemapIdx = new Var("skylightCubemapIdx", "float");
+   skylightCubemapIdx->uniform = true;
+   skylightCubemapIdx->constSortPos = cspPotentialPrimitive;
 
    Var * inProbePosArray = new Var("inProbePosArray", "vec4");
    inProbePosArray->arraySize = MAX_FORWARD_PROBES;
@@ -2942,7 +2997,7 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
    probeConfigData->uniform = true;
    probeConfigData->constSortPos = cspPotentialPrimitive;
 
-   Var * worldToObjArray = new Var("worldToObjArray", "mat4x4");
+   Var * worldToObjArray = new Var("worldToObjArray", "mat4");
    worldToObjArray->arraySize = MAX_FORWARD_PROBES;
    worldToObjArray->uniform = true;
    worldToObjArray->constSortPos = cspPotentialPrimitive;
@@ -2965,87 +3020,29 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
    irradianceCubemapAR->sampler = true;
    irradianceCubemapAR->constNum = Var::getTexUnitNum();
 
-   Var * skylightSpecularMap = new Var("skylightSpecularMap", "samplerCube");
-   skylightSpecularMap->uniform = true;
-   skylightSpecularMap->sampler = true;
-   skylightSpecularMap->constNum = Var::getTexUnitNum();
-
-   Var * skylightIrradMap = new Var("skylightIrradMap", "samplerCube");
-   skylightIrradMap->uniform = true;
-   skylightIrradMap->sampler = true;
-   skylightIrradMap->constNum = Var::getTexUnitNum();
+   Var* surface = getSurface(componentList, meta, fd);
 
-
-   Var * inTex = getInTexCoord("texCoord", "vec2", componentList);
-   if (!inTex)
-      return;
-
-   Var * diffuseColor = (Var*)LangElement::find("diffuseColor");
-   if (!diffuseColor)
-   {
-      diffuseColor = new Var;
-      diffuseColor->setType("vec4");
-      diffuseColor->setName("diffuseColor");
-      LangElement* colorDecl = new DecOp(diffuseColor);
-      meta->addStatement(new GenOp("   @ = vec4(1.0,1.0,1.0,1.0);\r\n", colorDecl)); //default to flat white
-   }
-
-   Var* matinfo = (Var*)LangElement::find("PBRConfig");
-   if (!matinfo)
+   if (!surface)
    {
-      Var* metalness = (Var*)LangElement::find("metalness");
-      if (!metalness)
-      {
-         metalness = new Var("metalness", "float");
-         metalness->uniform = true;
-         metalness->constSortPos = cspPotentialPrimitive;
-      }
-
-      Var* smoothness = (Var*)LangElement::find("smoothness");
-      if (!smoothness)
-      {
-         smoothness = new Var("smoothness", "float");
-         smoothness->uniform = true;
-         smoothness->constSortPos = cspPotentialPrimitive;
-      }
-
-      matinfo = new Var("PBRConfig", "vec4");
-      LangElement* colorDecl = new DecOp(matinfo);
-      meta->addStatement(new GenOp("   @ = vec4(0.0,1.0,@,@);\r\n", colorDecl, smoothness, metalness)); //reconstruct matinfo, no ao darkening
+      Con::errorf("ShaderGen::ReflectionProbeFeatGLSL()  - failed to generate surface!");
+      return;
    }
 
-   Var* bumpNormal = (Var*)LangElement::find("bumpNormal");
-   if (!bumpNormal)
-   {
-      bumpNormal = new Var("bumpNormal", "vec4");
-      LangElement* colorDecl = new DecOp(bumpNormal);
-      meta->addStatement(new GenOp("   @ = vec4(1.0,0.0,0.0,0.0);\r\n", colorDecl)); //default to identity normal
-   }
+   Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
 
+   Var *matinfo = (Var*)LangElement::find("PBRConfig");
+   Var* metalness = (Var*)LangElement::find("metalness");
+   Var* smoothness = (Var*)LangElement::find("smoothness");
+   
    Var* wsEyePos = (Var*)LangElement::find("eyePosWorld");
 
-   Var* worldToCamera = (Var*)LangElement::find("worldToCamera");
-   if (!worldToCamera)
-   {
-      worldToCamera = new Var;
-      worldToCamera->setType("mat4x4");
-      worldToCamera->setName("worldToCamera");
-      worldToCamera->uniform = true;
-      worldToCamera->constSortPos = cspPass;
-   }
-
    //Reflection vec
-   Var* surface = new Var("surface", "Surface");
-   meta->addStatement(new GenOp("  @ = createForwardSurface(@,@,@,@,@,@,@,@);\r\n\n", new DecOp(surface), diffuseColor, bumpNormal, matinfo,
-      inTex, wsPosition, wsEyePos, wsView, worldToCamera));
-   String computeForwardProbes = String("   @.rgb += computeForwardProbes(@,@,@,@,@,@,@,@,@,\r\n\t\t");
+   String computeForwardProbes = String("   @.rgb = computeForwardProbes(@,@,@,@,@,@,@,@,@,\r\n\t\t");
    computeForwardProbes += String("@,@,\r\n\t\t");
-   computeForwardProbes += String("@, @, \r\n\t\t");
    computeForwardProbes += String("@,@).rgb; \r\n");
 
-   meta->addStatement(new GenOp(computeForwardProbes.c_str(), albedo, surface, cubeMips, numProbes, worldToObjArray, probeConfigData, inProbePosArray, refBoxMinArray, refBoxMaxArray, inRefPosArray,
-      hasSkylight, BRDFTexture,
-      skylightIrradMap, skylightSpecularMap,
+   meta->addStatement(new GenOp(computeForwardProbes.c_str(), curColor, surface, cubeMips, numProbes, worldToObjArray, probeConfigData, inProbePosArray, refBoxMinArray, refBoxMaxArray, inRefPosArray,
+      skylightCubemapIdx, BRDFTexture,
       irradianceCubemapAR, specularCubemapAR));
 
    output = meta;
@@ -3055,8 +3052,8 @@ ShaderFeature::Resources ReflectionProbeFeatGLSL::getResources(const MaterialFea
 {
    Resources res;
 
-   res.numTex = 5;
-   res.numTexReg = 5;
+   res.numTex = 3;
+   res.numTexReg = 3;
 
    return res;
 }
@@ -3075,9 +3072,5 @@ void ReflectionProbeFeatGLSL::setTexData(Material::StageData& stageDat,
       passData.mTexType[texIndex++] = Material::SGCube;
       passData.mSamplerNames[texIndex] = "irradianceCubemapAR";
       passData.mTexType[texIndex++] = Material::SGCube;
-      passData.mSamplerNames[texIndex] = "skylightSpecularMap";
-      passData.mTexType[texIndex++] = Material::SGCube;
-      passData.mSamplerNames[texIndex] = "skylightIrradMap";
-      passData.mTexType[texIndex++] = Material::SGCube;
    }
 }

+ 5 - 0
Engine/source/shaderGen/GLSL/shaderFeatureGLSL.h

@@ -134,6 +134,8 @@ public:
    Var* getInvWorldView( Vector<ShaderComponent*> &componentList,                                       
 								bool useInstancing,
 								MultiLine *meta );
+
+   Var* getSurface(Vector<ShaderComponent*>& componentList, MultiLine* meta, const MaterialFeatureData& fd);
 		
    // ShaderFeature
    Var* getVertTexCoord( const String &name );
@@ -678,6 +680,9 @@ protected:
 
 public:
    ReflectionProbeFeatGLSL();
+
+   virtual void processVert(Vector<ShaderComponent*>& componentList,
+      const MaterialFeatureData& fd);
    
    virtual void processPix(Vector<ShaderComponent*>& componentList,
       const MaterialFeatureData& fd);

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

@@ -86,7 +86,7 @@ bool TSMesh::smUseEncodedNormals = false;
 
 const F32 TSMesh::VISIBILITY_EPSILON = 0.0001f;
 
-S32 TSMesh::smMaxInstancingVerts = 200;
+S32 TSMesh::smMaxInstancingVerts = 2000;
 MatrixF TSMesh::smDummyNodeTransform(1);
 
 // quick function to force object to face camera -- currently throws out roll :(
@@ -3473,4 +3473,4 @@ void TSSkinMesh::printVerts()
          bw._indexes.x, bw._indexes.y, bw._indexes.z, bw._indexes.w,
          bw._weights.x, bw._weights.y, bw._weights.z, bw._weights.w);
    }
-}
+}

+ 1 - 1
Engine/source/ts/tsShapeInstance.cpp

@@ -73,7 +73,7 @@ MODULE_BEGIN( TSShapeInstance )
 
       Con::addVariable("$pref::TS::maxInstancingVerts", TypeS32, &TSMesh::smMaxInstancingVerts,
          "@brief Enables mesh instancing on non-skin meshes that have less that this count of verts.\n"
-         "The default value is 200.  Higher values can degrade performance.\n"
+         "The default value is 2000.  Higher values can degrade performance.\n"
          "@ingroup Rendering\n" );
    }
 

+ 3 - 3
Templates/BaseGame/game/core/Core.cs

@@ -16,6 +16,9 @@ function CoreModule::onCreate(%this)
    // to find exactly which subsystems should be readied before kicking things off. 
    // ----------------------------------------------------------------------------
    
+   new Settings(ProjectSettings) { file = "core/settings.xml"; };
+   ProjectSettings.read();
+   
    ModuleDatabase.LoadExplicit( "Core_Rendering" );
    ModuleDatabase.LoadExplicit( "Core_Utility" );
    ModuleDatabase.LoadExplicit( "Core_GUI" );
@@ -25,9 +28,6 @@ function CoreModule::onCreate(%this)
    ModuleDatabase.LoadExplicit( "Core_Components" );
    ModuleDatabase.LoadExplicit( "Core_GameObjects" );
    
-   new Settings(ProjectSettings) { file = "core/settings.xml"; };
-   ProjectSettings.read();
-   
    %prefPath = getPrefpath();
    if ( isFile( %prefPath @ "/clientPrefs.cs" ) )
       exec( %prefPath @ "/clientPrefs.cs" );

+ 13 - 0
Templates/BaseGame/game/core/clientServer/scripts/client/levelDownload.cs

@@ -54,6 +54,7 @@ function clientCmdMissionStartPhase1(%seq, %missionName)
    if ( isScriptFile( %path ) )
    {
       postFXManager::loadPresetHandler( %path ); 
+      $PostFXManager::currentPreset = %path;
    }
    else
    {
@@ -138,6 +139,18 @@ function sceneLightingComplete()
    echo("Mission lighting done");
    $lightingMission = false;
    
+   //Bake probes
+   %boxProbeIds = parseMissionGroupForIds("BoxEnvironmentProbe", "");
+   %sphereProbeIds = parseMissionGroupForIds("SphereEnvironmentProbe", "");
+   %skylightIds = parseMissionGroupForIds("Skylight", "");
+   
+   %probeIds = rtrim(ltrim(%boxProbeIds SPC %sphereProbeIds));
+   %probeIds = rtrim(ltrim(%probeIds SPC %skylightIds));
+   %probeCount = getWordCount(%probeIds);
+   
+   $pref::ReflectionProbes::CurrentLevelPath = filePath($Client::MissionFile) @ "/" @ fileBase($Client::MissionFile) @ "/probes/";
+   ProbeBin.processProbes();
+   
    onPhaseComplete("STARTING MISSION");
    
    // The is also the end of the mission load cycle.

+ 1 - 1
Templates/BaseGame/game/core/gui/scripts/canvas.cs

@@ -147,7 +147,7 @@ function configureCanvas()
       "--Refresh Rate : " @ %rate NL
       "--AA TypeXLevel : " @ %aa NL
       "--------------");
-
+      
    // Actually set the new video mode
    Canvas.setVideoMode(%resX, %resY, %fs, %bpp, %rate, %aa);
 

+ 3 - 2
Templates/BaseGame/game/core/postFX/Core_PostFX.cs

@@ -2,9 +2,10 @@
 function Core_PostFX::onCreate(%this)
 {
    //
+   exec("./scripts/postFxManager.cs");
    exec("./scripts/postFx.cs");
-   /*exec("./scripts/postFxManager.gui.cs");
-   exec("./scripts/postFxManager.gui.settings.cs");
+   
+   /*exec("./scripts/postFxManager.gui.settings.cs");
    exec("./scripts/postFxManager.persistance.cs");
    
    exec("./scripts/default.postfxpreset.cs");

+ 0 - 2755
Templates/BaseGame/game/core/postFX/guis/postFxManager.gui

@@ -1,2755 +0,0 @@
-//--- OBJECT WRITE BEGIN ---
-%guiContent = new GuiControl(PostFXManager) {
-   position = "0 0";
-   extent = "1024 768";
-   minExtent = "8 8";
-   horizSizing = "width";
-   vertSizing = "height";
-   profile = "GuiModelessDialogProfile";
-   visible = "1";
-   active = "1";
-   tooltipProfile = "GuiToolTipProfile";
-   hovertime = "1000";
-   isContainer = "1";
-   canSave = "1";
-   canSaveDynamicFields = "1";
-
-   new DbgFileView() {
-      position = "0 0";
-      extent = "8 2";
-      minExtent = "8 2";
-      horizSizing = "right";
-      vertSizing = "bottom";
-      profile = "GuiDefaultProfile";
-      visible = "1";
-      active = "1";
-      tooltipProfile = "GuiToolTipProfile";
-      hovertime = "1000";
-      isContainer = "1";
-      canSave = "1";
-      canSaveDynamicFields = "0";
-   };
-   new GuiWindowCtrl(ppOptionsWindow) {
-      text = "PostFX Manager";
-      resizeWidth = "0";
-      resizeHeight = "0";
-      canMove = "1";
-      canClose = "1";
-      canMinimize = "0";
-      canMaximize = "0";
-      canCollapse = "0";
-      closeCommand = "Canvas.popDialog(PostFXManager);";
-      edgeSnap = "0";
-      margin = "0 0 0 0";
-      padding = "0 0 0 0";
-      anchorTop = "1";
-      anchorBottom = "0";
-      anchorLeft = "1";
-      anchorRight = "0";
-      position = "306 216";
-      extent = "411 336";
-      minExtent = "8 8";
-      horizSizing = "center";
-      vertSizing = "center";
-      profile = "GuiWindowProfile";
-      visible = "1";
-      active = "1";
-      tooltipProfile = "GuiToolTipProfile";
-      hovertime = "1000";
-      isContainer = "1";
-      canSave = "1";
-      canSaveDynamicFields = "0";
-
-      new GuiBitmapBorderCtrl() {
-         position = "11 77";
-         extent = "390 216";
-         minExtent = "8 2";
-         horizSizing = "right";
-         vertSizing = "bottom";
-         profile = "GuiTabBorderProfile";
-         visible = "1";
-         active = "1";
-         tooltipProfile = "GuiToolTipProfile";
-         hovertime = "1000";
-         isContainer = "0";
-         canSave = "1";
-         canSaveDynamicFields = "0";
-      };
-      new GuiTabBookCtrl(ppOptionsTabBook) {
-         tabPosition = "Top";
-         tabMargin = "7";
-         minTabWidth = "32";
-         tabHeight = "20";
-         allowReorder = "0";
-         defaultPage = "-1";
-         selectedPage = "1";
-         frontTabPadding = "0";
-         margin = "0 0 0 0";
-         padding = "0 0 0 0";
-         anchorTop = "1";
-         anchorBottom = "0";
-         anchorLeft = "1";
-         anchorRight = "0";
-         position = "11 58";
-         extent = "394 233";
-         minExtent = "8 2";
-         horizSizing = "right";
-         vertSizing = "bottom";
-         profile = "GuiTabBookProfile";
-         visible = "1";
-         active = "1";
-         tooltipProfile = "GuiToolTipProfile";
-         hovertime = "1000";
-         isContainer = "1";
-         canSave = "1";
-         canSaveDynamicFields = "0";
-
-         new GuiTabPageCtrl(ppOptionsSSAOTab) {
-            fitBook = "0";
-            text = "SSAO";
-            maxLength = "1024";
-            docking = "Client";
-            margin = "0 0 0 0";
-            padding = "0 0 0 0";
-            anchorTop = "1";
-            anchorBottom = "1";
-            anchorLeft = "1";
-            anchorRight = "1";
-            position = "0 20";
-            extent = "394 213";
-            minExtent = "8 2";
-            horizSizing = "right";
-            vertSizing = "bottom";
-            profile = "GuiTabPageProfile";
-            visible = "0";
-            active = "1";
-            tooltipProfile = "GuiToolTipProfile";
-            tooltip = "Options for the Screen Space Ambient Occlusion postFX";
-            hovertime = "1000";
-            isContainer = "1";
-            canSave = "1";
-            canSaveDynamicFields = "0";
-
-            new GuiBitmapBorderCtrl() {
-               position = "12 30";
-               extent = "365 170";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiTabBorderProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "1";
-            };
-            new GuiTabBookCtrl(ppOptionsSSAOOptions) {
-               tabPosition = "Top";
-               tabMargin = "7";
-               minTabWidth = "64";
-               tabHeight = "20";
-               allowReorder = "0";
-               defaultPage = "-1";
-               selectedPage = "2";
-               frontTabPadding = "0";
-               margin = "0 0 0 0";
-               padding = "0 0 0 0";
-               anchorTop = "1";
-               anchorBottom = "0";
-               anchorLeft = "1";
-               anchorRight = "0";
-               position = "12 11";
-               extent = "362 185";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiTabBookProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "1";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-
-               new GuiTabPageCtrl(ppOptionsSSAOGeneralTab) {
-                  fitBook = "0";
-                  text = "General";
-                  maxLength = "1024";
-                  docking = "Client";
-                  margin = "0 0 0 0";
-                  padding = "0 0 0 0";
-                  anchorTop = "1";
-                  anchorBottom = "1";
-                  anchorLeft = "1";
-                  anchorRight = "1";
-                  position = "0 20";
-                  extent = "362 165";
-                  minExtent = "8 2";
-                  horizSizing = "right";
-                  vertSizing = "bottom";
-                  profile = "GuiTabPageProfile";
-                  visible = "0";
-                  active = "1";
-                  tooltipProfile = "GuiToolTipProfile";
-                  tooltip = "Contains general overall settings for the SSAO postFX";
-                  hovertime = "1000";
-                  isContainer = "1";
-                  canSave = "1";
-                  canSaveDynamicFields = "0";
-
-                  new GuiTextCtrl(ppOptionsSSAOOverallStrengthLabel) {
-                     text = "Overall Strength";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "31 57";
-                     extent = "77 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Controls the overall strength of the Ambient Occlusion effect.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsSSAOBlurDepthLabel) {
-                     text = "Blur (Softness)";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "38 85";
-                     extent = "73 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Controls the amount of softness in the SSAO, overall.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsSSAOBlurNormalLabel) {
-                     text = "Blur (Normal Maps)";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "19 112";
-                     extent = "92 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Controls the amount of softness in the SSAO, in the normal maps.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiPopUpMenuCtrl(ppOptionsSSAOQuality) {
-                     maxPopupHeight = "200";
-                     sbUsesNAColor = "0";
-                     reverseTextList = "0";
-                     bitmapBounds = "16 16";
-                     text = "Low";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "120 28";
-                     extent = "211 20";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiPopUpMenuProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsSSAOQualityLabel) {
-                     text = "Quality";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "76 29";
-                     extent = "32 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsSSAOOverallStrength) {
-                     range = "0 50";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "2";
-                     position = "120 56";
-                     extent = "211 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsSSAOBlurDepth) {
-                     range = "0 0.3";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0.001";
-                     position = "120 86";
-                     extent = "211 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsSSAOBlurNormal) {
-                     range = "0 1";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0.95";
-                     position = "119 113";
-                     extent = "212 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-               };
-               new GuiTabPageCtrl(ppOptionsSSAONearTab) {
-                  fitBook = "0";
-                  text = "Near";
-                  maxLength = "1024";
-                  docking = "Client";
-                  margin = "0 0 0 0";
-                  padding = "0 0 0 0";
-                  anchorTop = "1";
-                  anchorBottom = "1";
-                  anchorLeft = "1";
-                  anchorRight = "1";
-                  position = "0 20";
-                  extent = "362 165";
-                  minExtent = "8 2";
-                  horizSizing = "right";
-                  vertSizing = "bottom";
-                  profile = "GuiTabPageProfile";
-                  visible = "0";
-                  active = "1";
-                  tooltipProfile = "GuiToolTipProfile";
-                  tooltip = "Contains settings for the near range ambient occlusion aspect of the SSAO postFX";
-                  hovertime = "1000";
-                  isContainer = "1";
-                  canSave = "1";
-                  canSaveDynamicFields = "0";
-
-                  new GuiSliderCtrl(ppOptionsSSAONearRadius) {
-                     range = "0.001 5";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0.1";
-                     position = "122 17";
-                     extent = "221 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsSSAONearDepthMin) {
-                     range = "0 5";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0.1";
-                     position = "122 62";
-                     extent = "221 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsSSAONearStrength) {
-                     range = "0 20";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "6";
-                     position = "122 39";
-                     extent = "221 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsSSAONearRadiusLabel) {
-                     text = "Radius";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "80 16";
-                     extent = "34 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Controls the near/small radius SSAO reach.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsSSAONearStrengthLabel) {
-                     text = "Strength";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "73 38";
-                     extent = "41 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Controls the near/small radius SSAO strength.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsSSAONearDepthMinLabel) {
-                     text = "Depth Min";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "66 61";
-                     extent = "48 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Controls the near/small radius SSAO minimum depth value.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsSSAONearDepthMaxLabel) {
-                     text = "Depth Max";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "62 85";
-                     extent = "52 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Controls the near/small radius SSAO maximum depth value.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsSSAONearDepthMax) {
-                     range = "0 50";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "1";
-                     position = "122 86";
-                     extent = "221 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsSSAONearToleranceNormal) {
-                     range = "0 2";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0";
-                     position = "122 133";
-                     extent = "103 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsSSAONearTolerancePower) {
-                     range = "0 2";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "1";
-                     position = "246 133";
-                     extent = "97 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsSSAONearToleranceLabel2) {
-                     text = "Tolerance / Power";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "24 132";
-                     extent = "92 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsSSAONearToleranceLabel1) {
-                     text = "Normal Maps : ";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "19 113";
-                     extent = "71 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-               };
-               new GuiTabPageCtrl(ppOptionsSSAOFarTab) {
-                  fitBook = "0";
-                  text = "Far";
-                  maxLength = "1024";
-                  docking = "Client";
-                  margin = "0 0 0 0";
-                  padding = "0 0 0 0";
-                  anchorTop = "1";
-                  anchorBottom = "1";
-                  anchorLeft = "1";
-                  anchorRight = "1";
-                  position = "0 20";
-                  extent = "362 165";
-                  minExtent = "8 2";
-                  horizSizing = "right";
-                  vertSizing = "bottom";
-                  profile = "GuiTabPageProfile";
-                  visible = "1";
-                  active = "1";
-                  tooltipProfile = "GuiToolTipProfile";
-                  tooltip = "Contains settings for the far range ambient occlusion aspect of the SSAO postFX";
-                  hovertime = "1000";
-                  isContainer = "1";
-                  canSave = "1";
-                  canSaveDynamicFields = "0";
-
-                  new GuiTextCtrl(ppOptionsSSAOFarRadiusLabel) {
-                     text = "Radius";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "80 16";
-                     extent = "34 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Controls the far/large radius SSAO reach.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsSSAOFarRadius) {
-                     range = "0.001 5";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "1";
-                     position = "122 17";
-                     extent = "221 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsSSAOFarStrengthLabel) {
-                     text = "Strength";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "73 38";
-                     extent = "41 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Controls the far/large radius SSAO strength.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsSSAOFarStrength) {
-                     range = "0 20";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "10";
-                     position = "122 39";
-                     extent = "221 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsSSAOFarDepthMinLabel) {
-                     text = "Depth Min";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "66 61";
-                     extent = "48 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Controls the far/large radius SSAO minimum depth.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsSSAOFarDepthMin) {
-                     range = "0 5";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0.2";
-                     position = "122 62";
-                     extent = "221 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsSSAOFarDepthMaxLabel) {
-                     text = "Depth Max";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "62 85";
-                     extent = "52 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Controls the far/large radius SSAO maximum.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsSSAOFarDepthMax) {
-                     range = "0 5";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "2";
-                     position = "122 86";
-                     extent = "221 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsSSAOFarToleranceLabel1) {
-                     text = "Normal Maps :";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "6 113";
-                     extent = "72 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl() {
-                     text = "Tolerance / Power";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "24 132";
-                     extent = "90 18";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsSSAOFarToleranceNormal) {
-                     range = "0 2";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0";
-                     position = "122 133";
-                     extent = "100 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsSSAOFarTolerancePower) {
-                     range = "0 2";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "2";
-                     position = "239 133";
-                     extent = "104 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-               };
-            };
-            new GuiCheckBoxCtrl(ppOptionsEnableSSAO) {
-               useInactiveState = "0";
-               text = "Enable";
-               groupNum = "-1";
-               buttonType = "ToggleButton";
-               useMouseEvents = "0";
-               position = "329 7";
-               extent = "53 20";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiCheckBoxProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               tooltip = "Enable/Disable the SSAO postFX";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-         };
-         new GuiTabPageCtrl(ppOptionsHDRTab) {
-            fitBook = "0";
-            text = "HDR";
-            maxLength = "1024";
-            docking = "Client";
-            margin = "0 0 0 0";
-            padding = "0 0 0 0";
-            anchorTop = "1";
-            anchorBottom = "1";
-            anchorLeft = "1";
-            anchorRight = "1";
-            position = "0 20";
-            extent = "394 213";
-            minExtent = "8 2";
-            horizSizing = "right";
-            vertSizing = "bottom";
-            profile = "GuiTabPageProfile";
-            visible = "1";
-            active = "1";
-            tooltipProfile = "GuiToolTipProfile";
-            tooltip = "Options for the High Definition Range Lighting postFX";
-            hovertime = "1000";
-            isContainer = "1";
-            canSave = "1";
-            canSaveDynamicFields = "0";
-
-            new GuiBitmapBorderCtrl() {
-               position = "12 30";
-               extent = "363 172";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiTabBorderProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "1";
-            };
-            new GuiTabBookCtrl(ppOptionsHDROptions) {
-               tabPosition = "Top";
-               tabMargin = "7";
-               minTabWidth = "64";
-               tabHeight = "20";
-               allowReorder = "0";
-               defaultPage = "-1";
-               selectedPage = "0";
-               frontTabPadding = "0";
-               margin = "0 0 0 0";
-               padding = "0 0 0 0";
-               anchorTop = "1";
-               anchorBottom = "0";
-               anchorLeft = "1";
-               anchorRight = "0";
-               position = "12 11";
-               extent = "365 195";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiTabBookProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "1";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-
-               new GuiTabPageCtrl(ppOptionsHDRBrightnessTab) {
-                  fitBook = "0";
-                  text = "Brightness";
-                  maxLength = "1024";
-                  docking = "Client";
-                  margin = "0 0 0 0";
-                  padding = "0 0 0 0";
-                  anchorTop = "1";
-                  anchorBottom = "1";
-                  anchorLeft = "1";
-                  anchorRight = "1";
-                  position = "0 20";
-                  extent = "365 175";
-                  minExtent = "8 2";
-                  horizSizing = "right";
-                  vertSizing = "bottom";
-                  profile = "GuiTabPageProfile";
-                  visible = "1";
-                  active = "1";
-                  tooltipProfile = "GuiToolTipProfile";
-                  tooltip = "Contains settings related to the brightness of the HDR postFX";
-                  hovertime = "1000";
-                  isContainer = "1";
-                  canSave = "1";
-                  canSaveDynamicFields = "0";
-
-                  new GuiSliderCtrl(ppOptionsHDRMinLuminance) {
-                     range = "0 1";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0";
-                     position = "132 77";
-                     extent = "206 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Value : 0";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsHDRKeyValue) {
-                     range = "0 1";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0.0459184";
-                     position = "132 50";
-                     extent = "206 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Value : 0.0459184";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsHDRKeyValueLabel) {
-                     text = "Key Value";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "69 50";
-                     extent = "52 16";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "The tone mapping middle grey or exposure value used to adjust the overall \"balance\" of the image.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsHDRMinLuminanceLabel) {
-                     text = "Minimum Luminance";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "25 77";
-                     extent = "96 16";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "The minimum luminance value to allow when tone mapping the scene. This is particularly useful if your scene is very dark or has a black ambient color in places.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsHDRWhiteCutoffLabel) {
-                     text = "White Cutoff";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "56 104";
-                     extent = "65 16";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "The cutoff level for the white levels in the brightness.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsHDRWhiteCutoff) {
-                     range = "0 1";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0.52551";
-                     position = "132 104";
-                     extent = "206 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Value : 0.52551";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsHDRBrightnessAdaptRate) {
-                     range = "0.1 10";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "2";
-                     position = "132 132";
-                     extent = "205 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsHDRBrightnessAdaptRateLabel) {
-                     text = "Brightness Adapt Rate";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "12 132";
-                     extent = "109 16";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "The speed at which the view adjusts to the new lighting in the environment.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsHDRKeyValueLabel1) {
-                     text = "Tone Mapping Contrast";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "10 24";
-                     extent = "111 16";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Tone mapping contrast is the amount of scene to blend, with the tone mapped HDR scene. Lower values are recommended but higher values give a strong contrasted darker shadowed look.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsHDRToneMappingAmount) {
-                     range = "0 1";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0.265306";
-                     position = "132 24";
-                     extent = "206 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "value : 0.265306";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-               };
-               new GuiTabPageCtrl(ppOptionsHDRBloomTab) {
-                  fitBook = "0";
-                  text = "Bloom";
-                  maxLength = "1024";
-                  docking = "Client";
-                  margin = "0 0 0 0";
-                  padding = "0 0 0 0";
-                  anchorTop = "1";
-                  anchorBottom = "1";
-                  anchorLeft = "1";
-                  anchorRight = "1";
-                  position = "0 20";
-                  extent = "365 175";
-                  minExtent = "8 2";
-                  horizSizing = "right";
-                  vertSizing = "bottom";
-                  profile = "GuiTabPageProfile";
-                  visible = "0";
-                  active = "1";
-                  tooltipProfile = "GuiToolTipProfile";
-                  tooltip = "Contains settings related to the blooming aspect of the HDR postFX";
-                  hovertime = "1000";
-                  isContainer = "1";
-                  canSave = "1";
-                  canSaveDynamicFields = "0";
-
-                  new GuiSliderCtrl(ppOptionsHDRBloomBlurMultiplier) {
-                     range = "0 5";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0.502645";
-                     position = "132 70";
-                     extent = "199 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Value : 0.502645";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsHDRBloomBlurMean) {
-                     range = "0 1";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0.510526";
-                     position = "132 97";
-                     extent = "200 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Value : 0.510526";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsHDRBloomBlurStdDev) {
-                     range = "0 3";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "1.4127";
-                     position = "132 123";
-                     extent = "199 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Value : 1.4127";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsHDRBlurMultiplierLabel) {
-                     text = "Blur Multiplier";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "59 70";
-                     extent = "63 16";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "The amount of blur to apply to the bloomed areas in the HDR.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsHDRBlurMeanLabel) {
-                     text = "Blur \"mean\" value";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "38 97";
-                     extent = "84 16";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsHDRBlurStandardDevianceLabel) {
-                     text = "Blur \"Std Dev\" value";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "23 123";
-                     extent = "99 16";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsHDRBloomBrightPassThresholdLabel) {
-                     text = "Bright pass threshold";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "19 43";
-                     extent = "103 16";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "The bright pass threshold controls how bright the brightest areas of the scene are in the HDR.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsHDRBloomBlurBrightPassThreshold) {
-                     range = "0 5";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "1.60526";
-                     position = "132 43";
-                     extent = "200 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Value : 1.60526";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiCheckBoxCtrl(ppOptionsHDRBloom) {
-                     useInactiveState = "0";
-                     text = " Enable Bloom";
-                     groupNum = "-1";
-                     buttonType = "ToggleButton";
-                     useMouseEvents = "0";
-                     position = "250 9";
-                     extent = "85 24";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiCheckBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Enables or disables the bloom (glowing effect) of the HDR PostFX.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-               };
-               new GuiTabPageCtrl(ppOptionsHDRBloomEffectsTab) {
-                  fitBook = "0";
-                  text = "Effects";
-                  maxLength = "1024";
-                  docking = "Client";
-                  margin = "0 0 0 0";
-                  padding = "0 0 0 0";
-                  anchorTop = "1";
-                  anchorBottom = "1";
-                  anchorLeft = "1";
-                  anchorRight = "1";
-                  position = "0 20";
-                  extent = "365 175";
-                  minExtent = "8 2";
-                  horizSizing = "right";
-                  vertSizing = "bottom";
-                  profile = "GuiTabPageProfile";
-                  visible = "0";
-                  active = "1";
-                  tooltipProfile = "GuiToolTipProfile";
-                  tooltip = "Contains settings related to the effects the HDR postFX can offer";
-                  hovertime = "1000";
-                  isContainer = "1";
-                  canSave = "1";
-                  canSaveDynamicFields = "0";
-
-                  new GuiCheckBoxCtrl(ppOptionsHDREffectsBlueShift) {
-                     useInactiveState = "0";
-                     text = " Enable Color Shift";
-                     groupNum = "-1";
-                     buttonType = "ToggleButton";
-                     useMouseEvents = "0";
-                     position = "11 4";
-                     extent = "117 24";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiCheckBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Enables a scene tinting/Blue shift based on the color selected below.";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiColorPickerCtrl(ppOptionsHDREffectsBlueShiftColorBlend) {
-                     baseColor = "1 0 0.0235294 1";
-                     pickColor = "0 0 0 1";
-                     selectorGap = "1";
-                     displayMode = "BlendColor";
-                     actionOnMove = "1";
-                     showReticle = "1";
-                     position = "10 29";
-                     extent = "344 110";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiDefaultProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Select a color";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiColorPickerCtrl(ppOptionsHDREffectsBlueShiftColorBaseColor) {
-                     baseColor = "1 0 0.0235294 1";
-                     pickColor = "0 0 0 1";
-                     selectorGap = "1";
-                     displayMode = "HorizColor";
-                     actionOnMove = "1";
-                     showReticle = "1";
-                     position = "10 142";
-                     extent = "343 21";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiDefaultProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "Select a color";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-               };
-            };
-            new GuiCheckBoxCtrl(ppOptionsHDRToneMapping) {
-               useInactiveState = "0";
-               text = " Enable Tone Mapping";
-               groupNum = "-1";
-               buttonType = "ToggleButton";
-               useMouseEvents = "0";
-               position = "18 8";
-               extent = "120 24";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiCheckBoxProfile";
-               visible = "0";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               tooltip = "Enables or disabled tone mapping on the HDR. The tone mapping balanced the brightness levels during the HDR process. Recommended";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-            new GuiCheckBoxCtrl(ppOptionsEnableHDR) {
-               useInactiveState = "0";
-               text = "Enable";
-               groupNum = "-1";
-               buttonType = "ToggleButton";
-               useMouseEvents = "0";
-               position = "329 7";
-               extent = "53 20";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiCheckBoxProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               tooltip = "Enable/Disable the HDR postFX (takes some time to initialise, be patient)";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-            new GuiCheckBoxCtrl(ppOptionsEnableHDRDebug) {
-               useInactiveState = "0";
-               text = "Debug";
-               groupNum = "-1";
-               buttonType = "ToggleButton";
-               useMouseEvents = "0";
-               position = "262 7";
-               extent = "53 20";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiCheckBoxProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-         };
-         new GuiTabPageCtrl(ppOptionsLightRaysTab) {
-            fitBook = "0";
-            text = "Light Rays";
-            maxLength = "1024";
-            docking = "Client";
-            margin = "0 0 0 0";
-            padding = "0 0 0 0";
-            anchorTop = "1";
-            anchorBottom = "1";
-            anchorLeft = "1";
-            anchorRight = "1";
-            position = "0 20";
-            extent = "394 213";
-            minExtent = "8 2";
-            horizSizing = "right";
-            vertSizing = "bottom";
-            profile = "GuiTabPageProfile";
-            visible = "0";
-            active = "1";
-            tooltipProfile = "GuiToolTipProfile";
-            tooltip = "Options for the Light Rays postFX";
-            hovertime = "1000";
-            isContainer = "1";
-            canSave = "1";
-            canSaveDynamicFields = "0";
-
-           new GuiSliderCtrl(ppOptionsLightRaysBrightScalar) {
-               range = "0 5";
-               ticks = "1000";
-               snap = "0";
-               value = "0.75";
-               position = "96 46";
-               extent = "264 17";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiSliderBoxProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };			
-            new GuiTextCtrl(ppOptionsLightRaysBrightnessScalarLabel) {
-               text = "Brightness";
-               maxLength = "1024";
-               margin = "0 0 0 0";
-               padding = "0 0 0 0";
-               anchorTop = "1";
-               anchorBottom = "0";
-               anchorLeft = "1";
-               anchorRight = "0";
-               position = "26 48";
-               extent = "87 15";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiTextProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               tooltip = "Controls how bright the rays and the object casting them are in the scene.";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-			
-		    new GuiSliderCtrl(ppOptionsLightRaysSampleScalar) {
-               range = "20 512";
-               ticks = "512";
-               snap = "0";
-               value = "40";
-               position = "96 75";
-               extent = "264 17";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiSliderBoxProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-			
-			new GuiTextCtrl(ppOptionsLightRaysSampleScalarLabel) {
-               text = "Samples";
-               maxLength = "512";
-               margin = "0 0 0 0";
-               padding = "0 0 0 0";
-               anchorTop = "1";
-               anchorBottom = "0";
-               anchorLeft = "1";
-               anchorRight = "0";
-               position = "26 76";
-               extent = "87 15";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiTextProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               tooltip = "Controls the number of samples for the shader.";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-			
-			new GuiSliderCtrl(ppOptionsLightRaysDensityScalar) {
-               range = "0.01 1";
-               ticks = "1000";
-               snap = "0";
-               value = "0.94";
-               position = "96 105";
-               extent = "264 17";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiSliderBoxProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-			
-			new GuiTextCtrl(ppOptionsLightRaysDensityScalarLabel) {
-               text = "Density";
-               maxLength = "1000";
-               margin = "0 0 0 0";
-               padding = "0 0 0 0";
-               anchorTop = "1";
-               anchorBottom = "0";
-               anchorLeft = "1";
-               anchorRight = "0";
-               position = "26 106";
-               extent = "87 15";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiTextProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               tooltip = "Controls the density of the rays.";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-			
-			new GuiSliderCtrl(ppOptionsLightRaysWeightScalar) {
-               range = "0.1 10";
-               ticks = "1000";
-               snap = "0";
-               value = "5.65";
-               position = "96 135";
-               extent = "264 17";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiSliderBoxProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-			
-			new GuiTextCtrl(ppOptionsLightRaysWeightScalarLabel) {
-               text = "Weight";
-               maxLength = "1000";
-               margin = "0 0 0 0";
-               padding = "0 0 0 0";
-               anchorTop = "1";
-               anchorBottom = "0";
-               anchorLeft = "1";
-               anchorRight = "0";
-               position = "26 136";
-               extent = "87 15";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiTextProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               tooltip = "Controls the weight of the rays.";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-			
-			
-			new GuiSliderCtrl(ppOptionsLightRaysDecayScalar) {
-               range = "0.01 1";
-               ticks = "1000";
-               snap = "0";
-               value = "1.0";
-               position = "96 165";
-               extent = "264 17";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiSliderBoxProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-			
-			new GuiTextCtrl(ppOptionsLightRaysDecayScalarLabel) {
-               text = "Decay";
-               maxLength = "1000";
-               margin = "0 0 0 0";
-               padding = "0 0 0 0";
-               anchorTop = "1";
-               anchorBottom = "0";
-               anchorLeft = "1";
-               anchorRight = "0";
-               position = "26 166";
-               extent = "87 15";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiTextProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               tooltip = "Controls the decay of the rays.";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-            new GuiCheckBoxCtrl(ppOptionsEnableLightRays) {
-               useInactiveState = "0";
-               text = "Enable";
-               groupNum = "-1";
-               buttonType = "ToggleButton";
-               useMouseEvents = "0";
-               position = "329 7";
-               extent = "53 20";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiCheckBoxProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               tooltip = "Enable/Disable the light rays postFX";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-         };
-         new GuiTabPageCtrl(ppOptionsDOFTab) {
-            fitBook = "0";
-            text = "DOF";
-            maxLength = "1024";
-            docking = "Client";
-            margin = "0 0 0 0";
-            padding = "0 0 0 0";
-            anchorTop = "1";
-            anchorBottom = "1";
-            anchorLeft = "1";
-            anchorRight = "1";
-            position = "0 20";
-            extent = "394 213";
-            minExtent = "8 2";
-            horizSizing = "right";
-            vertSizing = "bottom";
-            profile = "GuiTabPageProfile";
-            visible = "0";
-            active = "1";
-            tooltipProfile = "GuiToolTipProfile";
-            tooltip = "Options for the Depth Of Field postFX";
-            hovertime = "1000";
-            isContainer = "1";
-            canSave = "1";
-            canSaveDynamicFields = "0";
-
-            new GuiBitmapBorderCtrl() {
-               position = "14 28";
-               extent = "362 170";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiTabBorderProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "1";
-            };
-            new GuiTabBookCtrl() {
-               tabPosition = "Top";
-               tabMargin = "7";
-               minTabWidth = "64";
-               tabHeight = "20";
-               allowReorder = "0";
-               defaultPage = "-1";
-               selectedPage = "1";
-               frontTabPadding = "0";
-               margin = "0 0 0 0";
-               padding = "0 0 0 0";
-               anchorTop = "1";
-               anchorBottom = "0";
-               anchorLeft = "1";
-               anchorRight = "0";
-               position = "14 9";
-               extent = "360 189";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiTabBookProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "1";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-
-               new GuiTabPageCtrl(ppOptionsDOFGeneralTab) {
-                  fitBook = "0";
-                  text = "General";
-                  maxLength = "1024";
-                  docking = "Client";
-                  margin = "0 0 0 0";
-                  padding = "0 0 0 0";
-                  anchorTop = "1";
-                  anchorBottom = "1";
-                  anchorLeft = "1";
-                  anchorRight = "1";
-                  position = "0 20";
-                  extent = "360 169";
-                  minExtent = "8 2";
-                  horizSizing = "right";
-                  vertSizing = "bottom";
-                  profile = "GuiTabPageProfile";
-                  visible = "0";
-                  active = "1";
-                  tooltipProfile = "GuiToolTipProfile";
-                  tooltip = "Contains general settings related to the DOF system";
-                  hovertime = "1000";
-                  isContainer = "1";
-                  canSave = "1";
-                  canSaveDynamicFields = "0";
-
-                  //new GuiCheckBoxCtrl(ppOptionsDOFEnableDOF) {
-                     //useInactiveState = "0";
-                     //text = "Enable DOF";
-                     //groupNum = "-1";
-                     //buttonType = "ToggleButton";
-                     //useMouseEvents = "0";
-                     //position = "31 43";
-                     //extent = "140 30";
-                     //minExtent = "8 2";
-                     //horizSizing = "right";
-                     //vertSizing = "bottom";
-                     //profile = "GuiCheckBoxProfile";
-                     //visible = "1";
-                     //active = "1";
-                     //tooltipProfile = "GuiToolTipProfile";
-                     //hovertime = "1000";
-                     //isContainer = "0";
-                     //canSave = "1";
-                     //canSaveDynamicFields = "0";
-                  //};
-                  new GuiCheckBoxCtrl(ppOptionsDOFEnableAutoFocus) {
-                     useInactiveState = "0";
-                     text = "Enable Auto Focus";
-                     groupNum = "-1";
-                     buttonType = "ToggleButton";
-                     useMouseEvents = "0";
-                     position = "31 8";
-                     extent = "140 30";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiCheckBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-               };
-               new GuiTabPageCtrl(ppOptionsDOFAutoFocusTab) {
-                  fitBook = "0";
-                  text = "Auto Focus";
-                  maxLength = "1024";
-                  docking = "Client";
-                  margin = "0 0 0 0";
-                  padding = "0 0 0 0";
-                  anchorTop = "1";
-                  anchorBottom = "1";
-                  anchorLeft = "1";
-                  anchorRight = "1";
-                  position = "0 20";
-                  extent = "360 169";
-                  minExtent = "8 2";
-                  horizSizing = "right";
-                  vertSizing = "bottom";
-                  profile = "GuiTabPageProfile";
-                  visible = "1";
-                  active = "1";
-                  tooltipProfile = "GuiToolTipProfile";
-                  tooltip = "Contains settings related to the fine control of the auto focus system";
-                  hovertime = "1000";
-                  isContainer = "1";
-                  canSave = "1";
-                  canSaveDynamicFields = "0";
-
-                  new GuiTextCtrl(ppOptionsDOFNearBlurMaxLabel) {
-                     text = "Near Blur Max";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "36 8";
-                     extent = "67 16";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "The max allowed value of near blur";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsDOFFarBlurMinSlider) {
-                     range = "0 1";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0";
-                     position = "120 8";
-                     extent = "224 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsDOFFarBlurMaxLabel) {
-                     text = "Far Blur Max";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "43 34";
-                     extent = "60 16";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "The max allowed value of far blur";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsDOFFarBlurMaxSlider) {
-                     range = "0 1";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0";
-                     position = "120 34";
-                     extent = "224 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsDOFFocusRangeMinLabel) {
-                     text = "Focus Range (Min)";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "13 61";
-                     extent = "90 16";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "The distance range around the focal distance that remains in focus (in meters, minimum distance in focus) focal distance it is\r\ndependant on the visible distance set in your level";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsDOFFocusRangeMinSlider) {
-                     range = "0.01 1e+003";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0.01";
-                     position = "120 61";
-                     extent = "224 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsDOFFocusRangeMaxLabel) {
-                     text = "Focus Range (Max)";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "9 88";
-                     extent = "95 16";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "The distance range around the focal distance that remains in focus (in meters, maximum distance in focus) focal distance it is\r\ndependant on the visible distance set in your level";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsDOFFocusRangeMaxSlider) {
-                     range = "0.01 1e+003";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0.01";
-                     position = "119 87";
-                     extent = "224 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsDOFBurCurveNearLabel) {
-                     text = "Blur Curve Near";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "27 114";
-                     extent = "77 16";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "A small number causes bluriness to increase gradually\r\nat distances closer than the focal distance. A large number causes bluriness to \r\nincrease quickly";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsDOFBlurCurveNearSlider) {
-                     range = "0 50";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0";
-                     position = "119 114";
-                     extent = "225 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiTextCtrl(ppOptionsDOFBlurCurveFarLabel) {
-                     text = "Blur Curve Far";
-                     maxLength = "1024";
-                     margin = "0 0 0 0";
-                     padding = "0 0 0 0";
-                     anchorTop = "1";
-                     anchorBottom = "0";
-                     anchorLeft = "1";
-                     anchorRight = "0";
-                     position = "33 139";
-                     extent = "70 16";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiTextProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     tooltip = "A small number causes bluriness to increase gradually\r\nat distances closer than the focal distance. A large number causes bluriness to \r\nincrease quickly";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-                  new GuiSliderCtrl(ppOptionsDOFBlurCurveFarSlider) {
-                     range = "0 50";
-                     ticks = "1000";
-                     snap = "0";
-                     value = "0";
-                     position = "119 141";
-                     extent = "224 17";
-                     minExtent = "8 2";
-                     horizSizing = "right";
-                     vertSizing = "bottom";
-                     profile = "GuiSliderBoxProfile";
-                     visible = "1";
-                     active = "1";
-                     tooltipProfile = "GuiToolTipProfile";
-                     hovertime = "1000";
-                     isContainer = "0";
-                     canSave = "1";
-                     canSaveDynamicFields = "0";
-                  };
-               };
-            };
-            new GuiCheckBoxCtrl(ppOptionsEnableDOF) {
-               useInactiveState = "0";
-               text = "Enable";
-               groupNum = "-1";
-               buttonType = "ToggleButton";
-               useMouseEvents = "0";
-               position = "329 7";
-               extent = "53 20";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiCheckBoxProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               tooltip = "Enable/Disable the Depth of field postFX";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-         };
-         new GuiTabPageCtrl(ppOptionsVignetteTab) {
-            fitBook = "0";
-            text = "Vignette";
-            maxLength = "1024";
-            docking = "Client";
-            margin = "0 0 0 0";
-            padding = "0 0 0 0";
-            anchorTop = "1";
-            anchorBottom = "1";
-            anchorLeft = "1";
-            anchorRight = "1";
-            position = "0 40";
-            extent = "394 193";
-            minExtent = "8 2";
-            horizSizing = "right";
-            vertSizing = "bottom";
-            profile = "GuiTabPageProfile";
-            visible = "1";
-            active = "1";
-            tooltipProfile = "GuiToolTipProfile";
-            tooltip = "Options for the Vignette postFX";
-            hovertime = "1000";
-            isContainer = "1";
-            canSave = "1";
-            canSaveDynamicFields = "0";
-            Enabled = "1";
-
-            new GuiCheckBoxCtrl(ppOptionsEnableVignette) {
-               text = "Enable";
-               groupNum = "-1";
-               buttonType = "ToggleButton";
-               useMouseEvents = "0";
-               position = "329 7";
-               extent = "53 20";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiCheckBoxProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               tooltip = "Enable/Disable the vignette postFX";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-            new GuiSliderCtrl(ppOptionsVignetteVMax) {
-               range = "0.001 5";
-               ticks = "1000";
-               snap = "0";
-               value = "0.6";
-               position = "96 46";
-               extent = "221 17";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiSliderBoxProfile";
-               visible = "1";
-               active = "1";
-               variable = "$VignettePostEffect::VMax";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-            new GuiTextCtrl(ppOptionsVignetteVMaxLabel) {
-               text = "Radius";
-               maxLength = "1024";
-               margin = "0 0 0 0";
-               padding = "0 0 0 0";
-               anchorTop = "1";
-               anchorBottom = "0";
-               anchorLeft = "1";
-               anchorRight = "0";
-               position = "26 48";
-               extent = "41 18";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiTextProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               tooltip = "Controls the maximum exposure of vignetting.";
-               hovertime = "1000";
-               isContainer = "0";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-         };
-         new GuiTabPageCtrl() {
-            fitBook = "0";
-            text = "Color Correction";
-            maxLength = "1024";
-            margin = "0 0 0 0";
-            padding = "0 0 0 0";
-            anchorTop = "1";
-            anchorBottom = "0";
-            anchorLeft = "1";
-            anchorRight = "0";
-            position = "8 27";
-            extent = "376 200";
-            minExtent = "8 2";
-            horizSizing = "right";
-            vertSizing = "bottom";
-            profile = "GuiTabPageProfile";
-            visible = "1";
-            active = "1";
-            tooltipProfile = "GuiToolTipProfile";
-            hovertime = "1000";
-            isContainer = "1";
-            internalName = "ColorCorrectionTab";
-            canSave = "1";
-            canSaveDynamicFields = "0";
-
-            new GuiTextCtrl() {
-               text = "Color Correction Ramp";
-               maxLength = "1024";
-               margin = "0 0 0 0";
-               padding = "0 0 0 0";
-               anchorTop = "1";
-               anchorBottom = "0";
-               anchorLeft = "1";
-               anchorRight = "0";
-               position = "6 7";
-               extent = "118 13";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiTextProfile";
-               visible = "1";
-               active = "1";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "1";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-            new GuiTextEditCtrl() {
-               historySize = "0";
-               tabComplete = "0";
-               sinkAllKeyEvents = "0";
-               password = "0";
-               passwordMask = "*";
-               text = "core/postFX/images/null_color_ramp.png";
-               maxLength = "1024";
-               margin = "0 0 0 0";
-               padding = "0 0 0 0";
-               anchorTop = "1";
-               anchorBottom = "0";
-               anchorLeft = "1";
-               anchorRight = "0";
-               position = "6 29";
-               extent = "365 18";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiTextEditProfile";
-               visible = "1";
-               active = "1";
-               altCommand = "ppColorCorrection_selectFileHandler( $thisControl.getText() );";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "1";
-               internalName = "ColorCorrectionFileName";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-            new GuiButtonCtrl() {
-               text = "Select...";
-               groupNum = "-1";
-               buttonType = "PushButton";
-               useMouseEvents = "0";
-               position = "252 54";
-               extent = "56 22";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiButtonProfile";
-               visible = "1";
-               active = "1";
-               command = "ppColorCorrection_selectFile();";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "0";
-               internalName = "ColorCorrectionButton";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-            new GuiButtonCtrl() {
-               text = "Reset";
-               groupNum = "-1";
-               buttonType = "PushButton";
-               useMouseEvents = "0";
-               position = "315 54";
-               extent = "56 22";
-               minExtent = "8 2";
-               horizSizing = "right";
-               vertSizing = "bottom";
-               profile = "GuiButtonProfile";
-               visible = "1";
-               active = "1";
-               command = "ppColorCorrection_selectFileHandler( \"\" );";
-               tooltipProfile = "GuiToolTipProfile";
-               hovertime = "1000";
-               isContainer = "0";
-               internalName = "ColorCorrectionReset";
-               canSave = "1";
-               canSaveDynamicFields = "0";
-            };
-         };
-      };
-      new GuiButtonCtrl(ppOptionsApply) {
-         text = "Apply";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-         position = "309 302";
-         extent = "93 23";
-         minExtent = "8 8";
-         horizSizing = "right";
-         vertSizing = "bottom";
-         profile = "GuiButtonProfile";
-         visible = "1";
-         active = "1";
-         command = "PostFXManager.settingsApplyAll(); Canvas.popDialog(PostFXManager);";
-         tooltipProfile = "GuiToolTipProfile";
-         tooltip = "Apply the settings and close this dialog";
-         hovertime = "1000";
-         isContainer = "0";
-         canSave = "1";
-         canSaveDynamicFields = "0";
-      };
-      new GuiButtonCtrl(ppOptionsSavePreset) {
-         text = "Save Preset...";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-         position = "111 302";
-         extent = "93 23";
-         minExtent = "8 8";
-         horizSizing = "right";
-         vertSizing = "bottom";
-         profile = "GuiButtonProfile";
-         visible = "1";
-         active = "1";
-         command = "PostFXManager.savePresetFile();";
-         tooltipProfile = "GuiToolTipProfile";
-         tooltip = "Save the preset to a file to disk for later use (use postfx::applyPreset)";
-         hovertime = "1000";
-         isContainer = "0";
-         canSave = "1";
-         canSaveDynamicFields = "0";
-      };
-      new GuiButtonCtrl(ppOptionsLoadPreset) {
-         text = "Load Preset...";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-         position = "12 302";
-         extent = "93 23";
-         minExtent = "8 8";
-         horizSizing = "right";
-         vertSizing = "bottom";
-         profile = "GuiButtonProfile";
-         visible = "1";
-         active = "1";
-         command = "PostFXManager.loadPresetFile();";
-         tooltipProfile = "GuiToolTipProfile";
-         tooltip = "Load a post FX preset file from disk";
-         hovertime = "1000";
-         isContainer = "0";
-         canSave = "1";
-         canSaveDynamicFields = "0";
-      };
-      new GuiCheckBoxCtrl(ppOptionsEnable) {
-         useInactiveState = "0";
-         text = "Enable PostFX System";
-         groupNum = "-1";
-         buttonType = "ToggleButton";
-         useMouseEvents = "0";
-         position = "13 24";
-         extent = "127 30";
-         minExtent = "8 2";
-         horizSizing = "right";
-         vertSizing = "bottom";
-         profile = "GuiCheckBoxProfile";
-         visible = "1";
-         active = "1";
-         tooltipProfile = "GuiToolTipProfile";
-         tooltip = "Enable or Disable the postFX system";
-         hovertime = "1000";
-         isContainer = "0";
-         canSave = "1";
-         canSaveDynamicFields = "0";
-      };
-      new GuiPopUpMenuCtrl(ppOptionsQuality) {
-         maxPopupHeight = "200";
-         sbUsesNAColor = "0";
-         reverseTextList = "0";
-         bitmapBounds = "16 16";
-         maxLength = "1024";
-         margin = "0 0 0 0";
-         padding = "0 0 0 0";
-         anchorTop = "1";
-         anchorBottom = "0";
-         anchorLeft = "1";
-         anchorRight = "0";
-         position = "278 30";
-         extent = "122 21";
-         minExtent = "8 2";
-         horizSizing = "right";
-         vertSizing = "bottom";
-         profile = "GuiPopUpMenuProfile";
-         visible = "1";
-         active = "1";
-         tooltipProfile = "GuiToolTipProfile";
-         tooltip = "Used to adjust the quality/performance settings of the PostFX system. Some PostFX may not adhere to the settings in this dialog.";
-         hovertime = "1000";
-         isContainer = "0";
-         canSave = "1";
-         canSaveDynamicFields = "0";
-      };
-      new GuiTextCtrl(ppOptionsQualityLabel) {
-         text = "Quality";
-         maxLength = "1024";
-         margin = "0 0 0 0";
-         padding = "0 0 0 0";
-         anchorTop = "1";
-         anchorBottom = "0";
-         anchorLeft = "1";
-         anchorRight = "0";
-         position = "238 32";
-         extent = "39 12";
-         minExtent = "8 2";
-         horizSizing = "right";
-         vertSizing = "bottom";
-         profile = "GuiTextProfile";
-         visible = "1";
-         active = "1";
-         tooltipProfile = "GuiToolTipProfile";
-         tooltip = "Used to adjust the quality/performance settings of the PostFX system. Some PostFX may not adhere to the settings in this dialog.";
-         hovertime = "1000";
-         isContainer = "0";
-         canSave = "1";
-         canSaveDynamicFields = "0";
-      };
-      new GuiButtonCtrl(ppOptionsOk1) {
-         text = "Revert";
-         groupNum = "-1";
-         buttonType = "PushButton";
-         useMouseEvents = "0";
-         position = "210 302";
-         extent = "93 23";
-         minExtent = "8 8";
-         horizSizing = "right";
-         vertSizing = "bottom";
-         profile = "GuiButtonProfile";
-         visible = "1";
-         active = "1";
-         command = "postProcessOptionsDlg.applySettings(); Canvas.popDialog(postProcessOptionsDlg);";
-         tooltipProfile = "GuiToolTipProfile";
-         tooltip = "Revert any changes made since opening the dialog";
-         hovertime = "1000";
-         isContainer = "0";
-         canSave = "1";
-         canSaveDynamicFields = "0";
-      };
-   };
-};
-//--- OBJECT WRITE END ---

+ 74 - 0
Templates/BaseGame/game/core/postFX/scripts/hdr.cs

@@ -323,6 +323,80 @@ function HDRPostFX::onDisabled( %this )
    resetLightManager();
 }
 
+function HDRPostFX::onAdd( %this )
+{
+   PostFXManager.registerPostEffect(%this);
+   
+   //HDR should really be on at all times
+   %this.enable();
+   
+   $HDRPostFX::enableToneMapping = 1;
+}
+
+//This is used to populate the PostFXEditor's settings so the post FX can be edited
+//This is automatically polled for any postFX that has been registered(in our onAdd) and the settings
+//are thus exposed for editing
+function HDRPostFX::populatePostFXSettings(%this)
+{
+   PostEffectEditorInspector.startGroup("HDR - General");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::keyValue", "Key Value", "float", "", $HDRPostFX::keyValue, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::minLuminace", "Minimum Luminance", "float", "", $HDRPostFX::minLuminace, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::whiteCutoff", "White Cutoff", "float", "", $HDRPostFX::whiteCutoff, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::adaptRate", "Brightness Adapt Rate", "float", "", $HDRPostFX::adaptRate, "");
+   PostEffectEditorInspector.endGroup();
+   
+   PostEffectEditorInspector.startGroup("HDR - Bloom");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::enableBloom", "Enable Bloom", "bool", "", $HDRPostFX::enableBloom, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::brightPassThreshold", "Bright Pass Threshold", "float", "", $HDRPostFX::brightPassThreshold, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::gaussMultiplier", "Blur Multiplier", "float", "", $HDRPostFX::gaussMultiplier, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::gaussMean", "Blur \"Mean\" Value", "float", "", $HDRPostFX::gaussMean, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::gaussStdDev", "Blur \"Std. Dev\" Value", "float", "", $HDRPostFX::gaussStdDev, "");
+   PostEffectEditorInspector.endGroup();
+   
+   PostEffectEditorInspector.startGroup("HDR - Effects");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::enableBlueShift", "Enable Blue Shift", "bool", "", $HDRPostFX::enableBlueShift, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::blueShiftColor", "Blue Shift Color", "colorF", "", $HDRPostFX::blueShiftColor, "");
+   PostEffectEditorInspector.endGroup();
+}
+
+//This function pair(applyFromPreset and settingsApply) are done the way they are, with the separated variables
+//so that we can effectively store the 'settings' away from the live variables that the postFX's actually utilize
+//when rendering. This allows us to modify things but still leave room for reverting or temporarily applying them
+function HDRPostFX::applyFromPreset(%this)
+{
+   //HDRPostFX Settings
+   $HDRPostFX::adaptRate               = $PostFXManager::Settings::HDR::adaptRate;
+   $HDRPostFX::blueShiftColor          = $PostFXManager::Settings::HDR::blueShiftColor;
+   $HDRPostFX::brightPassThreshold     = $PostFXManager::Settings::HDR::brightPassThreshold; 
+   $HDRPostFX::enableBloom             = $PostFXManager::Settings::HDR::enableBloom;
+   $HDRPostFX::enableBlueShift         = $PostFXManager::Settings::HDR::enableBlueShift;
+   $HDRPostFX::enableToneMapping       = $PostFXManager::Settings::HDR::enableToneMapping;
+   $HDRPostFX::gaussMean               = $PostFXManager::Settings::HDR::gaussMean;
+   $HDRPostFX::gaussMultiplier         = $PostFXManager::Settings::HDR::gaussMultiplier;
+   $HDRPostFX::gaussStdDev             = $PostFXManager::Settings::HDR::gaussStdDev;
+   $HDRPostFX::keyValue                = $PostFXManager::Settings::HDR::keyValue;
+   $HDRPostFX::minLuminace             = $PostFXManager::Settings::HDR::minLuminace;
+   $HDRPostFX::whiteCutoff             = $PostFXManager::Settings::HDR::whiteCutoff;
+   $HDRPostFX::colorCorrectionRamp     = $PostFXManager::Settings::ColorCorrectionRamp;
+}
+
+function HDRPostFX::settingsApply(%this)
+{
+   $PostFXManager::Settings::HDR::adaptRate                 = $HDRPostFX::adaptRate;
+   $PostFXManager::Settings::HDR::blueShiftColor            = $HDRPostFX::blueShiftColor;
+   $PostFXManager::Settings::HDR::brightPassThreshold       = $HDRPostFX::brightPassThreshold;
+   $PostFXManager::Settings::HDR::enableBloom               = $HDRPostFX::enableBloom;
+   $PostFXManager::Settings::HDR::enableBlueShift           = $HDRPostFX::enableBlueShift;
+   $PostFXManager::Settings::HDR::enableToneMapping         = $HDRPostFX::enableToneMapping;
+   $PostFXManager::Settings::HDR::gaussMean                 = $HDRPostFX::gaussMean;
+   $PostFXManager::Settings::HDR::gaussMultiplier           = $HDRPostFX::gaussMultiplier;
+   $PostFXManager::Settings::HDR::gaussStdDev               = $HDRPostFX::gaussStdDev;
+   $PostFXManager::Settings::HDR::keyValue                  = $HDRPostFX::keyValue;
+   $PostFXManager::Settings::HDR::minLuminace               = $HDRPostFX::minLuminace;
+   $PostFXManager::Settings::HDR::whiteCutoff               = $HDRPostFX::whiteCutoff;
+   $PostFXManager::Settings::ColorCorrectionRamp            = $HDRPostFX::colorCorrectionRamp;
+}
+
 singleton PostEffect( HDRPostFX )
 {
    isEnabled = false;

+ 45 - 1
Templates/BaseGame/game/core/postFX/scripts/lightRay.cs

@@ -29,6 +29,10 @@ $LightRayPostFX::decay = 1.0;
 $LightRayPostFX::exposure = 0.0005;
 $LightRayPostFX::resolutionScale = 1.0;
 
+function LightRayPostFX::onAdd( %this )
+{   
+   PostFXManager.registerPostEffect(%this);
+}
 
 singleton ShaderData( LightRayOccludeShader )
 {
@@ -67,7 +71,7 @@ singleton GFXStateBlockData( LightRayStateBlock : PFX_DefaultStateBlock )
 
 singleton PostEffect( LightRayPostFX )
 {
-   isEnabled = false;
+   //isEnabled = false;
    allowReflectPass = false;
         
    renderTime = "PFXBeforeBin";
@@ -108,3 +112,43 @@ function LightRayPostFX::setShaderConsts( %this )
    %pfx.setShaderConst( "$decay", $LightRayPostFX::decay );
    %pfx.setShaderConst( "$exposure", $LightRayPostFX::exposure );
 }
+
+function LightRayPostFX::populatePostFXSettings(%this)
+{
+   PostEffectEditorInspector.startGroup("Light Ray");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::EnableLightRays", "Enabled", "bool", "", $PostFXManager::PostFX::EnableLightRays, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::LightRays::brightScalar", "Brightness", "float", "", $LightRayPostFX::brightScalar, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::LightRays::numSamples", "Samples", "float", "", $LightRayPostFX::numSamples, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::LightRays::density", "Density", "float", "", $LightRayPostFX::density, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::LightRays::weight", "Weight", "float", "", $LightRayPostFX::weight, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::LightRays::decay", "Decay", "float", "", $LightRayPostFX::decay, "");
+   PostEffectEditorInspector.endGroup();
+}
+
+function LightRayPostFX::applyFromPreset(%this)
+{
+   //Light rays settings
+   $PostFXManager::PostFX::EnableLightRays = $PostFXManager::Settings::EnableLightRays;
+   $LightRayPostFX::brightScalar           = $PostFXManager::Settings::LightRays::brightScalar;
+   
+   $LightRayPostFX::numSamples            = $PostFXManager::Settings::LightRays::numSamples;
+   $LightRayPostFX::density               = $PostFXManager::Settings::LightRays::density;
+   $LightRayPostFX::weight                = $PostFXManager::Settings::LightRays::weight;
+   $LightRayPostFX::decay                 = $PostFXManager::Settings::LightRays::decay;
+   
+   if($PostFXManager::PostFX::EnableLightRays)
+      %this.enable();
+   else
+      %this.disable();
+}
+
+function LightRayPostFX::settingsApply(%this)
+{
+   $PostFXManager::Settings::EnableLightRays                = $PostFXManager::PostFX::EnableLightRays;
+   $PostFXManager::Settings::LightRays::brightScalar        = $LightRayPostFX::brightScalar;
+   
+   $PostFXManager::Settings::LightRays::numSamples          = $LightRayPostFX::numSamples;
+   $PostFXManager::Settings::LightRays::density             = $LightRayPostFX::density;
+   $PostFXManager::Settings::LightRays::weight              = $LightRayPostFX::weight;
+   $PostFXManager::Settings::LightRays::decay               = $LightRayPostFX::decay;
+}

+ 63 - 3
Templates/BaseGame/game/core/postFX/scripts/postFxManager.persistance.cs → Templates/BaseGame/game/core/postFX/scripts/postFxManager.cs

@@ -20,6 +20,24 @@
 // IN THE SOFTWARE.
 //-----------------------------------------------------------------------------
 
+$PostFXManager::vebose = true;
+function postVerbose(%string)
+{
+   if($PostFXManager::vebose == true)
+   {
+      echo(%string);
+   }
+}
+
+if(!isObject(PostFXManager))
+{
+   new ArrayObject(PostFXManager){};  
+}
+
+function PostFXManager::registerPostEffect(%this, %postEffect)
+{
+   PostFXManager.add(%postEffect);
+}
 
 // Used to name the saved files.
 $PostFXManager::fileExtension = ".postfxpreset.cs";
@@ -30,6 +48,10 @@ $PostFXManager::fileFilter = "Post Effect Presets|*.postfxpreset.cs";
 // Enable / disable PostFX when loading presets or just apply the settings?
 $PostFXManager::forceEnableFromPresets = true;
 
+$PostFXManager::defaultPreset  = "./default.postfxpreset.cs";
+
+$PostFXManager::currentPreset = "";
+
 //Load a preset file from the disk, and apply the settings to the
 //controls. If bApplySettings is true - the actual values in the engine
 //will be changed to reflect the settings from the file.
@@ -37,6 +59,7 @@ function PostFXManager::loadPresetFile()
 {
    //Show the dialog and set the flag
    getLoadFilename($PostFXManager::fileFilter, "PostFXManager::loadPresetHandler");
+   $PostFXManager::currentPreset = $Tools::FileDialogs::LastFilePath();
 }
 
 function PostFXManager::loadPresetHandler( %filename )
@@ -48,7 +71,16 @@ function PostFXManager::loadPresetHandler( %filename )
       postVerbose("% - PostFX Manager - Executing " @ %filename);
       exec(%filename);
 
-      PostFXManager.settingsApplyFromPreset();      
+      %count = PostFXManager.Count();
+      for(%i=0; %i < %count; %i++)
+      {
+         %postEffect = PostFXManager.getKey(%i);  
+         
+         if(isObject(%postEffect) && %postEffect.isMethod("applyFromPreset"))
+         {     
+            %postEffect.applyFromPreset();
+         }
+      }
    }
 }
 
@@ -69,11 +101,39 @@ function PostFXManager::savePresetHandler( %filename )
    if(strStr(%filename, ".") == -1)
       %filename = %filename @ $PostFXManager::fileExtension;
                
-   //Apply the current settings to the preset
-   PostFXManager.settingsApplyAll();
+   %count = PostFXManager.Count();
+   for(%i=0; %i < %count; %i++)
+   {
+      %postEffect = PostFXManager.getKey(%i);  
+      
+      if(isObject(%postEffect) && %postEffect.isMethod("settingsApply"))
+      {     
+         %postEffect.settingsApply();
+      }
+   }
    
    export("$PostFXManager::Settings::*", %filename, false);
 
    postVerbose("% - PostFX Manager - Save complete. Preset saved at : " @ %filename);
 }
 
+function PostFXManager::settingsApplyDefaultPreset(%this)
+{
+   PostFXManager::loadPresetHandler($PostFXManager::defaultPreset);
+   $PostFXManager::currentPreset = $PostFXManager::defaultPreset;
+}
+
+function PostFXManager::settingsEffectSetEnabled(%this, %postEffect, %bEnable)
+{
+   // Apply the change
+   if ( %bEnable == true )
+   {
+      %postEffect.enable();
+      postVerbose("% - PostFX Manager - " @ %postEffect.getName() @ " enabled");
+   }
+   else
+   {
+      %postEffect.disable();
+      postVerbose("% - PostFX Manager - " @ %postEffect.getName() @ " disabled");
+   }
+}

+ 0 - 446
Templates/BaseGame/game/core/postFX/scripts/postFxManager.gui.cs

@@ -1,446 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-$PostFXManager::vebose = true;
-function postVerbose(%string)
-{
-   if($PostFXManager::vebose == true)
-   {
-      echo(%string);
-   }
-}
-
-function PostFXManager::onDialogPush( %this )
-{
-   //Apply the settings to the controls
-   postVerbose("% - PostFX Manager - Loading GUI.");
-   
-   %this.settingsRefreshAll();
-}
-
-// :: Controls for the overall postFX manager dialog
-function ppOptionsEnable::onAction(%this)
-{
-   //Disable / Enable all PostFX
-
-   if(ppOptionsEnable.getValue())
-   {
-      %toEnable = true;
-   }   
-   else
-   {
-      %toEnable = false;
-   }
-   
-   PostFXManager.settingsSetEnabled(%toEnable);
-   
-}
-
-function PostFXManager::getEnableResultFromControl(%this, %control)
-{
-   %toEnable = -1;
-   %bTest = %control.getValue();
-   if(%bTest == 1)
-   {
-      %toEnable = true;
-   }
-   else
-   {
-      %toEnable = false;
-   }
-   
-   return %toEnable;
-}
-
-function ppOptionsEnableSSAO::onAction(%this)
-{
-   %toEnable = PostFXManager.getEnableResultFromControl(%this);
-   PostFXManager.settingsEffectSetEnabled("SSAO", %toEnable);
-}
-
-function ppOptionsEnableHDR::onAction(%this)
-{
-   %toEnable = PostFXManager.getEnableResultFromControl(%this);
-   PostFXManager.settingsEffectSetEnabled("HDR", %toEnable);
-}
-
-function ppOptionsEnableLightRays::onAction(%this)
-{
-   %toEnable = PostFXManager.getEnableResultFromControl(%this);
-   PostFXManager.settingsEffectSetEnabled("LightRays", %toEnable);
-}
-
-function ppOptionsEnableDOF::onAction(%this)
-{ 
-   %toEnable = PostFXManager.getEnableResultFromControl(%this);
-   PostFXManager.settingsEffectSetEnabled("DOF", %toEnable);
-}
-
-function ppOptionsEnableVignette::onAction(%this)
-{ 
-   %toEnable = PostFXManager.getEnableResultFromControl(%this);
-   PostFXManager.settingsEffectSetEnabled("Vignette", %toEnable);
-}
-
-function ppOptionsSavePreset::onClick(%this)
-{
-   //Stores the current settings into a preset file for loading and use later on 
-}
-
-function ppOptionsLoadPreset::onClick(%this)
-{
-   //Loads and applies the settings from a postfxpreset file
-}
-
-
-//Other controls, Quality dropdown
-function ppOptionsSSAOQuality::onSelect( %this, %id, %text )
-{
-   if(%id > -1 && %id < 3)
-   {
-      $SSAOPostFx::quality = %id;
-   }
-}
-
-//SSAO Slider controls
-//General Tab
-function ppOptionsSSAOOverallStrength::onMouseDragged(%this)
-{
-   $SSAOPostFx::overallStrength = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-function ppOptionsSSAOBlurDepth::onMouseDragged(%this)
-{
-   $SSAOPostFx::blurDepthTol = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-function ppOptionsSSAOBlurNormal::onMouseDragged(%this)
-{
-   $SSAOPostFx::blurNormalTol = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-//Near Tab
-function ppOptionsSSAONearRadius::onMouseDragged(%this)
-{
-   $SSAOPostFx::sRadius = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-function ppOptionsSSAONearStrength::onMouseDragged(%this)
-{
-   $SSAOPostFx::sStrength = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-function ppOptionsSSAONearDepthMin::onMouseDragged(%this)
-{
-   $SSAOPostFx::sDepthMin = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-function ppOptionsSSAONearDepthMax::onMouseDragged(%this)
-{
-   $SSAOPostFx::sDepthMax = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;   
-}
-
-function ppOptionsSSAONearToleranceNormal::onMouseDragged(%this)
-{
-   $SSAOPostFx::sNormalTol = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-function ppOptionsSSAONearTolerancePower::onMouseDragged(%this)
-{
-   $SSAOPostFx::sNormalPow = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-//Far Tab
-function ppOptionsSSAOFarRadius::onMouseDragged(%this)
-{
-   $SSAOPostFx::lRadius = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-function ppOptionsSSAOFarStrength::onMouseDragged(%this)
-{
-   $SSAOPostFx::lStrength = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-function ppOptionsSSAOFarDepthMin::onMouseDragged(%this)
-{
-   $SSAOPostFx::lDepthMin = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-function ppOptionsSSAOFarDepthMax::onMouseDragged(%this)
-{
-   $SSAOPostFx::lDepthMax = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-function ppOptionsSSAOFarToleranceNormal::onMouseDragged(%this)
-{
-   $SSAOPostFx::lNormalTol = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-function ppOptionsSSAOFarTolerancePower::onMouseDragged(%this)
-{
-   $SSAOPostFx::lNormalPow = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-//HDR Slider Controls
-//Brighness tab
-
-function ppOptionsHDRToneMappingAmount::onMouseDragged(%this)
-{
-
-   $HDRPostFX::enableToneMapping = %this.value;
-   %this.ToolTip = "value : " @ %this.value;
-}
-
-function ppOptionsHDRKeyValue::onMouseDragged(%this)
-{
-   $HDRPostFX::keyValue = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-function ppOptionsHDRMinLuminance::onMouseDragged(%this)
-{
-   $HDRPostFX::minLuminace = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-function ppOptionsHDRWhiteCutoff::onMouseDragged(%this)
-{
-   $HDRPostFX::whiteCutoff = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-function ppOptionsHDRBrightnessAdaptRate::onMouseDragged(%this)
-{
-   $HDRPostFX::adaptRate = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-//Blur tab
-function ppOptionsHDRBloomBlurBrightPassThreshold::onMouseDragged(%this)
-{
-   $HDRPostFX::brightPassThreshold = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-function ppOptionsHDRBloomBlurMultiplier::onMouseDragged(%this)
-{
-   $HDRPostFX::gaussMultiplier = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-function ppOptionsHDRBloomBlurMean::onMouseDragged(%this)
-{
-   $HDRPostFX::gaussMean = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-function ppOptionsHDRBloomBlurStdDev::onMouseDragged(%this)
-{
-   $HDRPostFX::gaussStdDev = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-function ppOptionsHDRBloom::onAction(%this)
-{
-   $HDRPostFX::enableBloom =  %this.getValue();
-}
-
-function ppOptionsHDRToneMapping::onAction(%this)
-{
-   //$HDRPostFX::enableToneMapping =  %this.getValue();
-}
-
-function ppOptionsHDREffectsBlueShift::onAction(%this)
-{
-   $HDRPostFX::enableBlueShift = %this.getValue();
-}
-
-
-//Controls for color range in blue Shift dialog
-
-function ppOptionsHDREffectsBlueShiftColorBlend::onAction(%this)
-{
-   $HDRPostFX::blueShiftColor = %this.PickColor;
-   %this.ToolTip = "Color Values : " @ %this.PickColor;
-}
-
-function ppOptionsHDREffectsBlueShiftColorBaseColor::onAction(%this)
-{
-	//This one feeds the one above
-   	ppOptionsHDREffectsBlueShiftColorBlend.baseColor = %this.PickColor;
-	%this.ToolTip = "Color Values : " @ %this.PickColor;
-}
-
-
-//Light rays Brightness Slider Controls
-function ppOptionsLightRaysBrightScalar::onMouseDragged(%this)
-{
-   $LightRayPostFX::brightScalar = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-//Light rays Number of Samples Slider Control
-function ppOptionsLightRaysSampleScalar::onMouseDragged(%this)
-{
-   $LightRayPostFX::numSamples = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-//Light rays Density Slider Control
-function ppOptionsLightRaysDensityScalar::onMouseDragged(%this)
-{
-   $LightRayPostFX::density = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-//Light rays Weight Slider Control
-function ppOptionsLightRaysWeightScalar::onMouseDragged(%this)
-{
-   $LightRayPostFX::weight = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-//Light rays Decay Slider Control
-function ppOptionsLightRaysDecayScalar::onMouseDragged(%this)
-{
-   $LightRayPostFX::decay = %this.value;
-   %this.ToolTip = "Value : " @ %this.value;
-}
-
-
-function ppOptionsUpdateDOFSettings()
-{
-   DOFPostEffect.setFocusParams( $DOFPostFx::BlurMin, $DOFPostFx::BlurMax, $DOFPostFx::FocusRangeMin, $DOFPostFx::FocusRangeMax, -($DOFPostFx::BlurCurveNear), $DOFPostFx::BlurCurveFar );
-   
-   DOFPostEffect.setAutoFocus( $DOFPostFx::EnableAutoFocus );
-   DOFPostEffect.setFocalDist(0);
-   
-   if($PostFXManager::PostFX::EnableDOF)
-   {
-      DOFPostEffect.enable();
-   }
-   else
-   {
-      DOFPostEffect.disable();
-   }
-}
-
-//DOF General Tab
-//DOF Toggles
-function ppOptionsDOFEnableDOF::onAction(%this)
-{
-   $PostFXManager::PostFX::EnableDOF = %this.getValue();
-   ppOptionsUpdateDOFSettings();
-}
-
-
-function ppOptionsDOFEnableAutoFocus::onAction(%this)
-{
-   $DOFPostFx::EnableAutoFocus = %this.getValue();
-   DOFPostEffect.setAutoFocus( %this.getValue() );
-}
-
-//DOF AutoFocus Slider controls
-function ppOptionsDOFFarBlurMinSlider::onMouseDragged(%this)
-{
-   $DOFPostFx::BlurMin = %this.value;
-   ppOptionsUpdateDOFSettings();
-}
-
-function ppOptionsDOFFarBlurMaxSlider::onMouseDragged(%this)
-{
-   $DOFPostFx::BlurMax = %this.value;
-   ppOptionsUpdateDOFSettings();
-}
-
-function ppOptionsDOFFocusRangeMinSlider::onMouseDragged(%this)
-{
-   $DOFPostFx::FocusRangeMin = %this.value;
-   ppOptionsUpdateDOFSettings();   
-}
-
-function ppOptionsDOFFocusRangeMaxSlider::onMouseDragged(%this)
-{
-   $DOFPostFx::FocusRangeMax = %this.value;
-   ppOptionsUpdateDOFSettings();   
-}
-
-function ppOptionsDOFBlurCurveNearSlider::onMouseDragged(%this)
-{
-   $DOFPostFx::BlurCurveNear = %this.value;
-   ppOptionsUpdateDOFSettings();
-}
-
-function ppOptionsDOFBlurCurveFarSlider::onMouseDragged(%this)
-{
-   $DOFPostFx::BlurCurveFar = %this.value;
-   ppOptionsUpdateDOFSettings();   
-}
-
-function ppOptionsEnableHDRDebug::onAction(%this)
-{
-   if ( %this.getValue() )
-      LuminanceVisPostFX.enable();
-   else
-      LuminanceVisPostFX.disable();   
-}
-
-function ppOptionsUpdateVignetteSettings()
-{  
-   if($PostFXManager::PostFX::EnableVignette)
-   {
-      VignettePostEffect.enable();
-   }
-   else
-   {
-      VignettePostEffect.disable();
-   }
-}
-
-function ppOptionsVignetteEnableVignette::onAction(%this)
-{
-   $PostFXManager::PostFX::EnableVignette = %this.getValue();
-   ppOptionsUpdateVignetteSettings();
-}
-
-function ppColorCorrection_selectFile()
-{
-   %filter = "Image Files (*.png, *.jpg, *.dds, *.bmp, *.gif, *.jng. *.tga)|*.png;*.jpg;*.dds;*.bmp;*.gif;*.jng;*.tga|All Files (*.*)|*.*|";   
-   getLoadFilename( %filter, "ppColorCorrection_selectFileHandler");
-}
-
-function ppColorCorrection_selectFileHandler( %filename )
-{
-   if ( %filename $= "" || !isFile( %filename ) )
-      %filename = "core/postFX/images/null_color_ramp.png";
-   else
-      %filename = makeRelativePath( %filename, getMainDotCsDir() );
-            
-   $HDRPostFX::colorCorrectionRamp = %filename;
-   PostFXManager-->ColorCorrectionFileName.Text = %filename; 
-}

+ 0 - 439
Templates/BaseGame/game/core/postFX/scripts/postFxManager.gui.settings.cs

@@ -1,439 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-$PostFXManager::defaultPreset  = "./default.postfxpreset.cs";
-
-function PostFXManager::settingsSetEnabled(%this, %bEnablePostFX)
-{
-   $PostFXManager::PostFX::Enabled = %bEnablePostFX;
-   
-   //if to enable the postFX, apply the ones that are enabled
-   if ( %bEnablePostFX )
-   {
-      //SSAO, HDR, LightRays, DOF
-      
-      if ( $PostFXManager::PostFX::EnableSSAO )      
-         SSAOPostFx.enable();      
-      else
-         SSAOPostFx.disable();
-      
-      if ( $PostFXManager::PostFX::EnableHDR )
-         HDRPostFX.enable();
-      else
-         HDRPostFX.disable();
-
-      if ( $PostFXManager::PostFX::EnableLightRays )
-         LightRayPostFX.enable();
-      else
-         LightRayPostFX.disable();
-      
-      if ( $PostFXManager::PostFX::EnableDOF )
-         DOFPostEffect.enable();
-      else
-         DOFPostEffect.disable();
-		 
-      if ( $PostFXManager::PostFX::EnableVignette )
-         VignettePostEffect.enable();
-      else
-         VignettePostEffect.disable();
-     
-      postVerbose("% - PostFX Manager - PostFX enabled");      
-   }
-   else
-   {
-      //Disable all postFX
-      
-      SSAOPostFx.disable();
-      HDRPostFX.disable();
-      LightRayPostFX.disable();
-      DOFPostEffect.disable();
-	  VignettePostEffect.disable();
-      
-      postVerbose("% - PostFX Manager - PostFX disabled");
-   }
-
-   VolFogGlowPostFx.disable();
-}
-
-function PostFXManager::settingsEffectSetEnabled(%this, %sName, %bEnable)
-{
-   %postEffect = 0;
-   
-   //Determine the postFX to enable, and apply the boolean
-   if(%sName $= "SSAO")
-   {
-      %postEffect = SSAOPostFx;
-      $PostFXManager::PostFX::EnableSSAO = %bEnable;
-      //$pref::PostFX::SSAO::Enabled = %bEnable;
-   }
-   else if(%sName $= "HDR")
-   {
-      %postEffect = HDRPostFX;
-      $PostFXManager::PostFX::EnableHDR = %bEnable;
-      //$pref::PostFX::HDR::Enabled = %bEnable;
-   }
-   else if(%sName $= "LightRays")
-   {
-      %postEffect = LightRayPostFX;
-      $PostFXManager::PostFX::EnableLightRays = %bEnable;
-      //$pref::PostFX::LightRays::Enabled = %bEnable;      
-   }
-   else if(%sName $= "DOF")
-   {
-      %postEffect = DOFPostEffect;
-      $PostFXManager::PostFX::EnableDOF = %bEnable;
-      //$pref::PostFX::DOF::Enabled = %bEnable;
-   }
-   else if(%sName $= "Vignette")
-   {
-      %postEffect = VignettePostEffect;
-      $PostFXManager::PostFX::EnableVignette = %bEnable;
-      //$pref::PostFX::Vignette::Enabled = %bEnable;
-   }
-   
-   // Apply the change
-   if ( %bEnable == true )
-   {
-      %postEffect.enable();
-      postVerbose("% - PostFX Manager - " @ %sName @ " enabled");
-   }
-   else
-   {
-      %postEffect.disable();
-      postVerbose("% - PostFX Manager - " @ %sName @ " disabled");
-   }
-}
-
-function PostFXManager::settingsRefreshSSAO(%this)
-{
-   //Apply the enabled flag 
-   ppOptionsEnableSSAO.setValue($PostFXManager::PostFX::EnableSSAO);   
-   
-   //Add the items we need to display
-   ppOptionsSSAOQuality.clear();
-   ppOptionsSSAOQuality.add("Low", 0);
-   ppOptionsSSAOQuality.add("Medium", 1);
-   ppOptionsSSAOQuality.add("High", 2);
-   
-   //Set the selected, after adding the items!
-   ppOptionsSSAOQuality.setSelected($SSAOPostFx::quality);
-   
-   //SSAO - Set the values of the sliders, General Tab
-   ppOptionsSSAOOverallStrength.setValue($SSAOPostFx::overallStrength);
-   ppOptionsSSAOBlurDepth.setValue($SSAOPostFx::blurDepthTol);
-   ppOptionsSSAOBlurNormal.setValue($SSAOPostFx::blurNormalTol);
-      
-   //SSAO - Set the values for the near tab
-   ppOptionsSSAONearDepthMax.setValue($SSAOPostFx::sDepthMax);
-   ppOptionsSSAONearDepthMin.setValue($SSAOPostFx::sDepthMin);
-   ppOptionsSSAONearRadius.setValue($SSAOPostFx::sRadius);
-   ppOptionsSSAONearStrength.setValue($SSAOPostFx::sStrength);
-   ppOptionsSSAONearToleranceNormal.setValue($SSAOPostFx::sNormalTol);
-   ppOptionsSSAONearTolerancePower.setValue($SSAOPostFx::sNormalPow);
-   
-   //SSAO - Set the values for the far tab
-   ppOptionsSSAOFarDepthMax.setValue($SSAOPostFx::lDepthMax);
-   ppOptionsSSAOFarDepthMin.setValue($SSAOPostFx::lDepthMin);
-   ppOptionsSSAOFarRadius.setValue($SSAOPostFx::lRadius);
-   ppOptionsSSAOFarStrength.setValue($SSAOPostFx::lStrength);
-   ppOptionsSSAOFarToleranceNormal.setValue($SSAOPostFx::lNormalTol);
-   ppOptionsSSAOFarTolerancePower.setValue($SSAOPostFx::lNormalPow);
-}
-
-function PostFXManager::settingsRefreshHDR(%this)
-{
-  //Apply the enabled flag 
-   ppOptionsEnableHDR.setValue($PostFXManager::PostFX::EnableHDR);   
-    
-   ppOptionsHDRBloom.setValue($HDRPostFX::enableBloom);
-   ppOptionsHDRBloomBlurBrightPassThreshold.setValue($HDRPostFX::brightPassThreshold);
-   ppOptionsHDRBloomBlurMean.setValue($HDRPostFX::gaussMean);
-   ppOptionsHDRBloomBlurMultiplier.setValue($HDRPostFX::gaussMultiplier);
-   ppOptionsHDRBloomBlurStdDev.setValue($HDRPostFX::gaussStdDev);
-   ppOptionsHDRBrightnessAdaptRate.setValue($HDRPostFX::adaptRate);
-   ppOptionsHDREffectsBlueShift.setValue($HDRPostFX::enableBlueShift);
-   ppOptionsHDREffectsBlueShiftColor.BaseColor = $HDRPostFX::blueShiftColor;
-   ppOptionsHDREffectsBlueShiftColor.PickColor = $HDRPostFX::blueShiftColor;
-   ppOptionsHDRKeyValue.setValue($HDRPostFX::keyValue);
-   ppOptionsHDRMinLuminance.setValue($HDRPostFX::minLuminace);
-   ppOptionsHDRToneMapping.setValue($HDRPostFX::enableToneMapping);
-   ppOptionsHDRToneMappingAmount.setValue($HDRPostFX::enableToneMapping);
-   ppOptionsHDRWhiteCutoff.setValue($HDRPostFX::whiteCutoff);
-   
-   %this-->ColorCorrectionFileName.Text = $HDRPostFX::colorCorrectionRamp;    
-}
-
-function PostFXManager::settingsRefreshLightrays(%this)
-{
-  //Apply the enabled flag 
-   ppOptionsEnableLightRays.setValue($PostFXManager::PostFX::EnableLightRays);   
-    
-   ppOptionsLightRaysBrightScalar.setValue($LightRayPostFX::brightScalar);
-   
-   ppOptionsLightRaysSampleScalar.setValue($LightRayPostFX::numSamples);
-   ppOptionsLightRaysDensityScalar.setValue($LightRayPostFX::density);
-   ppOptionsLightRaysWeightScalar.setValue($LightRayPostFX::weight);
-   ppOptionsLightRaysDecayScalar.setValue($LightRayPostFX::decay);
-}
-
-function PostFXManager::settingsRefreshDOF(%this)
-{
-  //Apply the enabled flag 
-   ppOptionsEnableDOF.setValue($PostFXManager::PostFX::EnableDOF);   
-
-
-   //ppOptionsDOFEnableDOF.setValue($PostFXManager::PostFX::EnableDOF);
-   ppOptionsDOFEnableAutoFocus.setValue($DOFPostFx::EnableAutoFocus);
-   
-   ppOptionsDOFFarBlurMinSlider.setValue($DOFPostFx::BlurMin);
-   ppOptionsDOFFarBlurMaxSlider.setValue($DOFPostFx::BlurMax);
-   
-   ppOptionsDOFFocusRangeMinSlider.setValue($DOFPostFx::FocusRangeMin);
-   ppOptionsDOFFocusRangeMaxSlider.setValue($DOFPostFx::FocusRangeMax);
-   
-   ppOptionsDOFBlurCurveNearSlider.setValue($DOFPostFx::BlurCurveNear);
-   ppOptionsDOFBlurCurveFarSlider.setValue($DOFPostFx::BlurCurveFar);
-
-}
-
-function PostFXManager::settingsRefreshVignette(%this)
-{
-  //Apply the enabled flag 
-   ppOptionsEnableVignette.setValue($PostFXManager::PostFX::EnableVignette);   
-
-}
-
-function PostFXManager::settingsRefreshAll(%this)
-{    
-   $PostFXManager::PostFX::Enabled           = $pref::enablePostEffects;
-   $PostFXManager::PostFX::EnableSSAO        = SSAOPostFx.isEnabled();
-   $PostFXManager::PostFX::EnableHDR         = HDRPostFX.isEnabled();
-   $PostFXManager::PostFX::EnableLightRays   = LightRayPostFX.isEnabled();
-   $PostFXManager::PostFX::EnableDOF         = DOFPostEffect.isEnabled();
-   $PostFXManager::PostFX::EnableVignette    = VignettePostEffect.isEnabled();
-   
-   //For all the postFX here, apply the active settings in the system
-   //to the gui controls.
-   
-   %this.settingsRefreshSSAO();
-   %this.settingsRefreshHDR();
-   %this.settingsRefreshLightrays();
-   %this.settingsRefreshDOF();
-   %this.settingsRefreshVignette();
-   
-   ppOptionsEnable.setValue($PostFXManager::PostFX::Enabled);
-
-   postVerbose("% - PostFX Manager - GUI values updated.");
-}
-
-function PostFXManager::settingsApplyFromPreset(%this)
-{
-   postVerbose("% - PostFX Manager - Applying from preset");
-
-   //SSAO Settings
-   $SSAOPostFx::blurDepthTol           = $PostFXManager::Settings::SSAO::blurDepthTol;
-   $SSAOPostFx::blurNormalTol          = $PostFXManager::Settings::SSAO::blurNormalTol;
-   $SSAOPostFx::lDepthMax              = $PostFXManager::Settings::SSAO::lDepthMax;
-   $SSAOPostFx::lDepthMin              = $PostFXManager::Settings::SSAO::lDepthMin;
-   $SSAOPostFx::lDepthPow              = $PostFXManager::Settings::SSAO::lDepthPow;
-   $SSAOPostFx::lNormalPow             = $PostFXManager::Settings::SSAO::lNormalPow;
-   $SSAOPostFx::lNormalTol             = $PostFXManager::Settings::SSAO::lNormalTol;
-   $SSAOPostFx::lRadius                = $PostFXManager::Settings::SSAO::lRadius;
-   $SSAOPostFx::lStrength              = $PostFXManager::Settings::SSAO::lStrength;
-   $SSAOPostFx::overallStrength        = $PostFXManager::Settings::SSAO::overallStrength;
-   $SSAOPostFx::quality                = $PostFXManager::Settings::SSAO::quality;
-   $SSAOPostFx::sDepthMax              = $PostFXManager::Settings::SSAO::sDepthMax;
-   $SSAOPostFx::sDepthMin              = $PostFXManager::Settings::SSAO::sDepthMin;
-   $SSAOPostFx::sDepthPow              = $PostFXManager::Settings::SSAO::sDepthPow;
-   $SSAOPostFx::sNormalPow             = $PostFXManager::Settings::SSAO::sNormalPow;
-   $SSAOPostFx::sNormalTol             = $PostFXManager::Settings::SSAO::sNormalTol;
-   $SSAOPostFx::sRadius                = $PostFXManager::Settings::SSAO::sRadius;
-   $SSAOPostFx::sStrength              = $PostFXManager::Settings::SSAO::sStrength;
-   
-   //HDR settings
-   $HDRPostFX::adaptRate               = $PostFXManager::Settings::HDR::adaptRate;
-   $HDRPostFX::blueShiftColor          = $PostFXManager::Settings::HDR::blueShiftColor;
-   $HDRPostFX::brightPassThreshold     = $PostFXManager::Settings::HDR::brightPassThreshold; 
-   $HDRPostFX::enableBloom             = $PostFXManager::Settings::HDR::enableBloom;
-   $HDRPostFX::enableBlueShift         = $PostFXManager::Settings::HDR::enableBlueShift;
-   $HDRPostFX::enableToneMapping       = $PostFXManager::Settings::HDR::enableToneMapping;
-   $HDRPostFX::gaussMean               = $PostFXManager::Settings::HDR::gaussMean;
-   $HDRPostFX::gaussMultiplier         = $PostFXManager::Settings::HDR::gaussMultiplier;
-   $HDRPostFX::gaussStdDev             = $PostFXManager::Settings::HDR::gaussStdDev;
-   $HDRPostFX::keyValue                = $PostFXManager::Settings::HDR::keyValue;
-   $HDRPostFX::minLuminace             = $PostFXManager::Settings::HDR::minLuminace;
-   $HDRPostFX::whiteCutoff             = $PostFXManager::Settings::HDR::whiteCutoff;
-   $HDRPostFX::colorCorrectionRamp     = $PostFXManager::Settings::ColorCorrectionRamp;
-   
-   //Light rays settings
-   $LightRayPostFX::brightScalar       = $PostFXManager::Settings::LightRays::brightScalar;
-   
-   $LightRayPostFX::numSamples         = $PostFXManager::Settings::LightRays::numSamples;
-   $LightRayPostFX::density            = $PostFXManager::Settings::LightRays::density;
-   $LightRayPostFX::weight             = $PostFXManager::Settings::LightRays::weight;
-   $LightRayPostFX::decay              = $PostFXManager::Settings::LightRays::decay;
-   
-   //DOF settings   
-   $DOFPostFx::EnableAutoFocus         = $PostFXManager::Settings::DOF::EnableAutoFocus;
-   $DOFPostFx::BlurMin                 = $PostFXManager::Settings::DOF::BlurMin;
-   $DOFPostFx::BlurMax                 = $PostFXManager::Settings::DOF::BlurMax;
-   $DOFPostFx::FocusRangeMin           = $PostFXManager::Settings::DOF::FocusRangeMin;
-   $DOFPostFx::FocusRangeMax           = $PostFXManager::Settings::DOF::FocusRangeMax;
-   $DOFPostFx::BlurCurveNear           = $PostFXManager::Settings::DOF::BlurCurveNear;
-   $DOFPostFx::BlurCurveFar            = $PostFXManager::Settings::DOF::BlurCurveFar;
-
-   //Vignette settings   
-   $VignettePostEffect::VMax           = $PostFXManager::Settings::Vignette::VMax;
-   $VignettePostEffect::VMin           = $PostFXManager::Settings::Vignette::VMin;
-  
-   if ( $PostFXManager::forceEnableFromPresets )
-   {
-      $PostFXManager::PostFX::Enabled           = $PostFXManager::Settings::EnablePostFX;
-      $PostFXManager::PostFX::EnableDOF         = $pref::PostFX::EnableDOF ? $PostFXManager::Settings::EnableDOF : false;
-      $PostFXManager::PostFX::EnableVignette    = $pref::PostFX::EnableVignette ? $PostFXManager::Settings::EnableVignette : false;
-      $PostFXManager::PostFX::EnableLightRays   = $pref::PostFX::EnableLightRays ? $PostFXManager::Settings::EnableLightRays : false;
-      $PostFXManager::PostFX::EnableHDR         = $pref::PostFX::EnableHDR ? $PostFXManager::Settings::EnableHDR : false;
-      $PostFXManager::PostFX::EnableSSAO        = $pref::PostFX::EnabledSSAO ? $PostFXManager::Settings::EnableSSAO : false;
-
-      %this.settingsSetEnabled( true );
-   }
-   
-   //make sure we apply the correct settings to the DOF
-   ppOptionsUpdateDOFSettings();
-   
-   // Update the actual GUI controls if its awake ( otherwise it will when opened ).
-   if ( PostFXManager.isAwake() )
-      %this.settingsRefreshAll();      
-}
-
-function PostFXManager::settingsApplySSAO(%this)
-{   
-   $PostFXManager::Settings::SSAO::blurDepthTol             = $SSAOPostFx::blurDepthTol;
-   $PostFXManager::Settings::SSAO::blurNormalTol            = $SSAOPostFx::blurNormalTol;
-   $PostFXManager::Settings::SSAO::lDepthMax                = $SSAOPostFx::lDepthMax;
-   $PostFXManager::Settings::SSAO::lDepthMin                = $SSAOPostFx::lDepthMin;
-   $PostFXManager::Settings::SSAO::lDepthPow                = $SSAOPostFx::lDepthPow;
-   $PostFXManager::Settings::SSAO::lNormalPow               = $SSAOPostFx::lNormalPow;
-   $PostFXManager::Settings::SSAO::lNormalTol               = $SSAOPostFx::lNormalTol;
-   $PostFXManager::Settings::SSAO::lRadius                  = $SSAOPostFx::lRadius;
-   $PostFXManager::Settings::SSAO::lStrength                = $SSAOPostFx::lStrength;
-   $PostFXManager::Settings::SSAO::overallStrength          = $SSAOPostFx::overallStrength;
-   $PostFXManager::Settings::SSAO::quality                  = $SSAOPostFx::quality;
-   $PostFXManager::Settings::SSAO::sDepthMax                = $SSAOPostFx::sDepthMax;
-   $PostFXManager::Settings::SSAO::sDepthMin                = $SSAOPostFx::sDepthMin;
-   $PostFXManager::Settings::SSAO::sDepthPow                = $SSAOPostFx::sDepthPow;
-   $PostFXManager::Settings::SSAO::sNormalPow               = $SSAOPostFx::sNormalPow;
-   $PostFXManager::Settings::SSAO::sNormalTol               = $SSAOPostFx::sNormalTol;
-   $PostFXManager::Settings::SSAO::sRadius                  = $SSAOPostFx::sRadius;
-   $PostFXManager::Settings::SSAO::sStrength                = $SSAOPostFx::sStrength;
-
-   postVerbose("% - PostFX Manager - Settings Saved - SSAO");    
-   
-}
-
-function PostFXManager::settingsApplyHDR(%this)
-{   
-   $PostFXManager::Settings::HDR::adaptRate                 = $HDRPostFX::adaptRate;
-   $PostFXManager::Settings::HDR::blueShiftColor            = $HDRPostFX::blueShiftColor;
-   $PostFXManager::Settings::HDR::brightPassThreshold       = $HDRPostFX::brightPassThreshold;
-   $PostFXManager::Settings::HDR::enableBloom               = $HDRPostFX::enableBloom;
-   $PostFXManager::Settings::HDR::enableBlueShift           = $HDRPostFX::enableBlueShift;
-   $PostFXManager::Settings::HDR::enableToneMapping         = $HDRPostFX::enableToneMapping;
-   $PostFXManager::Settings::HDR::gaussMean                 = $HDRPostFX::gaussMean;
-   $PostFXManager::Settings::HDR::gaussMultiplier           = $HDRPostFX::gaussMultiplier;
-   $PostFXManager::Settings::HDR::gaussStdDev               = $HDRPostFX::gaussStdDev;
-   $PostFXManager::Settings::HDR::keyValue                  = $HDRPostFX::keyValue;
-   $PostFXManager::Settings::HDR::minLuminace               = $HDRPostFX::minLuminace;
-   $PostFXManager::Settings::HDR::whiteCutoff               = $HDRPostFX::whiteCutoff;
-   $PostFXManager::Settings::ColorCorrectionRamp            = $HDRPostFX::colorCorrectionRamp;
-   
-   postVerbose("% - PostFX Manager - Settings Saved - HDR");      
-}
-
-function PostFXManager::settingsApplyLightRays(%this)
-{   
-   $PostFXManager::Settings::LightRays::brightScalar        = $LightRayPostFX::brightScalar;
-   
-   $PostFXManager::Settings::LightRays::numSamples          = $LightRayPostFX::numSamples;
-   $PostFXManager::Settings::LightRays::density             = $LightRayPostFX::density;
-   $PostFXManager::Settings::LightRays::weight              = $LightRayPostFX::weight;
-   $PostFXManager::Settings::LightRays::decay               = $LightRayPostFX::decay;
-   
-   postVerbose("% - PostFX Manager - Settings Saved - Light Rays");   
-   
-}
-
-function PostFXManager::settingsApplyDOF(%this)
-{
-   $PostFXManager::Settings::DOF::EnableAutoFocus           = $DOFPostFx::EnableAutoFocus;   
-   $PostFXManager::Settings::DOF::BlurMin                   = $DOFPostFx::BlurMin;
-   $PostFXManager::Settings::DOF::BlurMax                   = $DOFPostFx::BlurMax;
-   $PostFXManager::Settings::DOF::FocusRangeMin             = $DOFPostFx::FocusRangeMin;
-   $PostFXManager::Settings::DOF::FocusRangeMax             = $DOFPostFx::FocusRangeMax;
-   $PostFXManager::Settings::DOF::BlurCurveNear             = $DOFPostFx::BlurCurveNear;
-   $PostFXManager::Settings::DOF::BlurCurveFar              = $DOFPostFx::BlurCurveFar;
-   
-   postVerbose("% - PostFX Manager - Settings Saved - DOF");   
-   
-}
-
-function PostFXManager::settingsApplyVignette(%this)
-{
-   $PostFXManager::Settings::Vignette::VMax                 = $VignettePostEffect::VMax;
-   $PostFXManager::Settings::Vignette::VMin                 = $VignettePostEffect::VMin;
-
-   postVerbose("% - PostFX Manager - Settings Saved - Vignette");   
-   
-}
-
-function PostFXManager::settingsApplyAll(%this, %sFrom)
-{
-   // Apply settings which control if effects are on/off altogether.
-   $PostFXManager::Settings::EnablePostFX        = $PostFXManager::PostFX::Enabled;  
-   $PostFXManager::Settings::EnableDOF           = $PostFXManager::PostFX::EnableDOF;
-   $PostFXManager::Settings::EnableVignette      = $PostFXManager::PostFX::EnableVignette;
-   $PostFXManager::Settings::EnableLightRays     = $PostFXManager::PostFX::EnableLightRays;
-   $PostFXManager::Settings::EnableHDR           = $PostFXManager::PostFX::EnableHDR;
-   $PostFXManager::Settings::EnableSSAO          = $PostFXManager::PostFX::EnableSSAO;
-      
-   // Apply settings should save the values in the system to the 
-   // the preset structure ($PostFXManager::Settings::*)
-
-   // SSAO Settings
-   %this.settingsApplySSAO();
-   // HDR settings
-   %this.settingsApplyHDR();
-   // Light rays settings
-   %this.settingsApplyLightRays();
-   // DOF
-   %this.settingsApplyDOF();
-   // Vignette
-   %this.settingsApplyVignette();
-   
-   postVerbose("% - PostFX Manager - All Settings applied to $PostFXManager::Settings");
-}
-
-function PostFXManager::settingsApplyDefaultPreset(%this)
-{
-   PostFXManager::loadPresetHandler($PostFXManager::defaultPreset);
-}
-

+ 82 - 0
Templates/BaseGame/game/core/postFX/scripts/ssao.cs

@@ -61,6 +61,8 @@ function SSAOPostFx::onAdd( %this )
 {  
    %this.wasVis = "Uninitialized";
    %this.quality = "Uninitialized";
+   
+   PostFXManager.registerPostEffect(%this);
 }
 
 function SSAOPostFx::preProcess( %this )
@@ -128,7 +130,87 @@ function SSAOPostFx::onDisabled( %this )
   $AL::UseSSAOMask = false;
 }
 
+function SSAOPostFx::populatePostFXSettings(%this)
+{
+   PostEffectEditorInspector.startGroup("SSAO - General");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::EnabledSSAO", "Enabled", "bool", "Low,Medium,High", $PostFXManager::PostFX::EnableSSAO, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::quality", "Quality", "list", "Low,Medium,High", $SSAOPostFx::quality, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::overallStrength", "Overall Strength", "float", "", $SSAOPostFx::overallStrength, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::blurDepthTol", "Blur (Softness)", "float", "", $SSAOPostFx::blurDepthTol, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::blurNormalTol", "Blur (Normal Maps)", "float", "", $SSAOPostFx::blurNormalTol, "");
+   PostEffectEditorInspector.endGroup();
+   
+   PostEffectEditorInspector.startGroup("SSAO - Near");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::sRadius", "Radius", "list", "Low,Medium,High", $SSAOPostFx::sRadius, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::sStrength", "Strength", "float", "", $SSAOPostFx::sStrength, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::sDepthMin", "Depth Min", "float", "", $SSAOPostFx::sDepthMin, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::sDepthMax", "Depth Max", "float", "", $SSAOPostFx::sDepthMax, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::sNormalTol", "Normal Map Tolerance", "float", "", $SSAOPostFx::sNormalTol, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::sNormalPow", "Normal Map Power", "float", "", $SSAOPostFx::sNormalPow, "");
+   PostEffectEditorInspector.endGroup();
+   
+   PostEffectEditorInspector.startGroup("SSAO - Far");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::lRadius", "Radius", "list", "Low,Medium,High", $SSAOPostFx::lRadius, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::lStrength", "Strength", "float", "", $SSAOPostFx::lStrength, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::lDepthMin", "Depth Min", "float", "", $SSAOPostFx::lDepthMin, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::lDepthMax", "Depth Max", "float", "", $SSAOPostFx::lDepthMax, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::lNormalTol", "Normal Map Tolerance", "float", "", $SSAOPostFx::lNormalTol, "");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::SSAO::lNormalPow", "Normal Map Power", "float", "", $SSAOPostFx::lNormalPow, "");
+   PostEffectEditorInspector.endGroup();
+}
+
+function SSAOPostFx::applyFromPreset(%this)
+{
+   //SSAO Settings
+   $PostFXManager::PostFX::EnableSSAO  = $PostFXManager::Settings::EnabledSSAO;
+   $SSAOPostFx::blurDepthTol           = $PostFXManager::Settings::SSAO::blurDepthTol;
+   $SSAOPostFx::blurNormalTol          = $PostFXManager::Settings::SSAO::blurNormalTol;
+   $SSAOPostFx::lDepthMax              = $PostFXManager::Settings::SSAO::lDepthMax;
+   $SSAOPostFx::lDepthMin              = $PostFXManager::Settings::SSAO::lDepthMin;
+   $SSAOPostFx::lDepthPow              = $PostFXManager::Settings::SSAO::lDepthPow;
+   $SSAOPostFx::lNormalPow             = $PostFXManager::Settings::SSAO::lNormalPow;
+   $SSAOPostFx::lNormalTol             = $PostFXManager::Settings::SSAO::lNormalTol;
+   $SSAOPostFx::lRadius                = $PostFXManager::Settings::SSAO::lRadius;
+   $SSAOPostFx::lStrength              = $PostFXManager::Settings::SSAO::lStrength;
+   $SSAOPostFx::overallStrength        = $PostFXManager::Settings::SSAO::overallStrength;
+   $SSAOPostFx::quality                = $PostFXManager::Settings::SSAO::quality;
+   $SSAOPostFx::sDepthMax              = $PostFXManager::Settings::SSAO::sDepthMax;
+   $SSAOPostFx::sDepthMin              = $PostFXManager::Settings::SSAO::sDepthMin;
+   $SSAOPostFx::sDepthPow              = $PostFXManager::Settings::SSAO::sDepthPow;
+   $SSAOPostFx::sNormalPow             = $PostFXManager::Settings::SSAO::sNormalPow;
+   $SSAOPostFx::sNormalTol             = $PostFXManager::Settings::SSAO::sNormalTol;
+   $SSAOPostFx::sRadius                = $PostFXManager::Settings::SSAO::sRadius;
+   $SSAOPostFx::sStrength              = $PostFXManager::Settings::SSAO::sStrength;  
+   
+   if($PostFXManager::PostFX::EnableSSAO)
+      %this.enable();
+   else
+      %this.disable();
+}
 
+function SSAOPostFx::settingsApply(%this)
+{
+   $PostFXManager::Settings::EnabledSSAO                   = $PostFXManager::PostFX::EnableSSAO ;
+   
+   $PostFXManager::Settings::SSAO::blurDepthTol             = $SSAOPostFx::blurDepthTol;
+   $PostFXManager::Settings::SSAO::blurNormalTol            = $SSAOPostFx::blurNormalTol;
+   $PostFXManager::Settings::SSAO::lDepthMax                = $SSAOPostFx::lDepthMax;
+   $PostFXManager::Settings::SSAO::lDepthMin                = $SSAOPostFx::lDepthMin;
+   $PostFXManager::Settings::SSAO::lDepthPow                = $SSAOPostFx::lDepthPow;
+   $PostFXManager::Settings::SSAO::lNormalPow               = $SSAOPostFx::lNormalPow;
+   $PostFXManager::Settings::SSAO::lNormalTol               = $SSAOPostFx::lNormalTol;
+   $PostFXManager::Settings::SSAO::lRadius                  = $SSAOPostFx::lRadius;
+   $PostFXManager::Settings::SSAO::lStrength                = $SSAOPostFx::lStrength;
+   $PostFXManager::Settings::SSAO::overallStrength          = $SSAOPostFx::overallStrength;
+   $PostFXManager::Settings::SSAO::quality                  = $SSAOPostFx::quality;
+   $PostFXManager::Settings::SSAO::sDepthMax                = $SSAOPostFx::sDepthMax;
+   $PostFXManager::Settings::SSAO::sDepthMin                = $SSAOPostFx::sDepthMin;
+   $PostFXManager::Settings::SSAO::sDepthPow                = $SSAOPostFx::sDepthPow;
+   $PostFXManager::Settings::SSAO::sNormalPow               = $SSAOPostFx::sNormalPow;
+   $PostFXManager::Settings::SSAO::sNormalTol               = $SSAOPostFx::sNormalTol;
+   $PostFXManager::Settings::SSAO::sRadius                  = $SSAOPostFx::sRadius;
+   $PostFXManager::Settings::SSAO::sStrength                = $SSAOPostFx::sStrength;
+}
 //-----------------------------------------------------------------------------
 // GFXStateBlockData / ShaderData
 //-----------------------------------------------------------------------------

+ 2 - 0
Templates/BaseGame/game/core/rendering/Core_Rendering.cs

@@ -9,6 +9,8 @@ function Core_Rendering::onCreate(%this)
    $Core::DefaultPrefilterCubemap = "core/rendering/images/default_prefilter.dds";
    $Core::BRDFTexture = "core/rendering/images/brdfTexture.dds";
    
+   $pref::ReflectionProbes::BakeResolution = ProjectSettings.value("Rendering/ProbeCaptureResolution", "64");
+   
    exec("./scripts/renderManager.cs");
    exec("./scripts/gfxData/clouds.cs");
    exec("./scripts/gfxData/commonMaterialData.cs");

+ 109 - 110
Templates/BaseGame/game/core/rendering/shaders/gl/lighting.glsl

@@ -47,6 +47,8 @@ uniform vec4 albedo;
 #define MAX_PROBES 50
 #define MAX_FORWARD_PROBES 4
 
+#define MAX_FORWARD_LIGHT 4
+
 vec3 getDistanceVectorToPlane( vec3 origin, vec3 direction, vec4 plane )
 {
    float denum = dot( plane.xyz, direction.xyz );
@@ -64,32 +66,6 @@ vec3 getDistanceVectorToPlane( float negFarPlaneDotEye, vec3 direction, vec4 pla
    return direction.xyz * t;
 }
 
-void compute4Lights( vec3 wsView, 
-                     vec3 wsPosition, 
-                     vec3 wsNormal,
-                     vec4 shadowMask,
-
-                     #ifdef TORQUE_SHADERGEN
-                     
-                        vec4 inLightPos[3],
-                        vec4 inLightInvRadiusSq,
-                        vec4 inLightColor[4],
-                        vec4 inLightSpotDir[3],
-                        vec4 inLightSpotAngle,
-                        vec4 inLightSpotFalloff,
-                        float smoothness,
-                        float metalness,
-                        vec4 albedo,
-
-                     #endif // TORQUE_SHADERGEN
-                     
-                     out vec4 outDiffuse,
-                     out vec4 outSpecular )
-{
-   outDiffuse = vec4(0,0,0,0);
-   outSpecular = vec4(0,0,0,0);
-}
-
 struct Surface
 {
 	vec3 P;				// world space position
@@ -123,43 +99,43 @@ void updateSurface(inout Surface surface)
 
 Surface createSurface(vec4 normDepth, sampler2D colorBuffer, sampler2D matInfoBuffer, in vec2 uv, in vec3 wsEyePos, in vec3 wsEyeRay, in mat4 invView)
 {
-	Surface surface;// = Surface();
-
-	vec4 gbuffer1 = texture(colorBuffer, uv);
-	vec4 gbuffer2 = texture(matInfoBuffer, uv);
-	surface.depth = normDepth.a;
-	surface.P = wsEyePos + wsEyeRay * surface.depth;
-	surface.N = tMul(invView, vec4(normDepth.xyz,0)).xyz;
-	surface.V = normalize(wsEyePos - surface.P);
-	surface.baseColor = gbuffer1;
-	const float minRoughness=1e-4;
-	surface.roughness = clamp(1.0 - gbuffer2.b, minRoughness, 1.0); //t3d uses smoothness, so we convert to roughness.
-	surface.roughness_brdf = surface.roughness * surface.roughness;
-	surface.metalness = gbuffer2.a;
-	surface.ao = gbuffer2.g;
-	surface.matFlag = gbuffer2.r;
-    updateSurface(surface);
-	return surface;
+   Surface surface;// = Surface();
+
+   vec4 gbuffer1 = texture(colorBuffer, uv);
+   vec4 gbuffer2 = texture(matInfoBuffer, uv);
+   surface.depth = normDepth.a;
+   surface.P = wsEyePos + wsEyeRay * surface.depth;
+   surface.N = tMul(invView, vec4(normDepth.xyz,0)).xyz;
+   surface.V = normalize(wsEyePos - surface.P);
+   surface.baseColor = gbuffer1;
+   const float minRoughness=1e-4;
+   surface.roughness = clamp(1.0 - gbuffer2.b, minRoughness, 1.0); //t3d uses smoothness, so we convert to roughness.
+   surface.roughness_brdf = surface.roughness * surface.roughness;
+   surface.metalness = gbuffer2.a;
+   surface.ao = gbuffer2.g;
+   surface.matFlag = gbuffer2.r;
+      updateSurface(surface);
+   return surface;
 }
 
-Surface createForwardSurface(vec4 baseColor, vec4 normal, vec4 pbrProperties, in vec2 uv, in vec3 wsPosition, in vec3 wsEyePos, in vec3 wsEyeRay, in mat4x4 invView)
+Surface createForwardSurface(vec4 baseColor, vec3 normal, vec4 pbrProperties, in vec3 wsPosition, in vec3 wsEyePos, in vec3 wsEyeRay)
 {
-	Surface surface;// = Surface();
-
-  surface.depth = 0;
-	surface.P = wsPosition;
-	surface.N = tMul(invView, vec4(normal.xyz,0)).xyz;
-	surface.V = normalize(wsEyePos - surface.P);
-	surface.baseColor = baseColor;
-  const float minRoughness=1e-4;
-	surface.roughness = clamp(1.0 - pbrProperties.b, minRoughness, 1.0); //t3d uses smoothness, so we convert to roughness.
-	surface.roughness_brdf = surface.roughness * surface.roughness;
-	surface.metalness = pbrProperties.a;
-  surface.ao = pbrProperties.g;
-  surface.matFlag = pbrProperties.r;
-
-    updateSurface(surface);
-	return surface;
+   Surface surface;// = Surface();
+
+   surface.depth = 0;
+   surface.P = wsPosition;
+   surface.N = normal;
+   surface.V = normalize(wsEyePos - surface.P);
+   surface.baseColor = baseColor;
+   const float minRoughness=1e-4;
+   surface.roughness = clamp(1.0 - pbrProperties.b, minRoughness, 1.0); //t3d uses smoothness, so we convert to roughness.
+   surface.roughness_brdf = surface.roughness * surface.roughness;
+   surface.metalness = pbrProperties.a;
+   surface.ao = pbrProperties.g;
+   surface.matFlag = pbrProperties.r;
+
+   updateSurface(surface);
+   return surface;
 }
 
 struct SurfaceToLight
@@ -237,7 +213,7 @@ vec3 getDirectionalLight(in Surface surface, in SurfaceToLight surfaceToLight, v
    vec3 diffuse = BRDF_GetDiffuse(surface,surfaceToLight) * factor;
    vec3 spec = BRDF_GetSpecular(surface,surfaceToLight) * factor;
 
-   vec3 final = max(vec3(0.0f), diffuse + spec * surface.ao);
+   vec3 final = max(vec3(0.0f), diffuse + spec);
    return final;
 }
 
@@ -249,45 +225,71 @@ vec3 getPunctualLight(in Surface surface, in SurfaceToLight surfaceToLight, vec3
    vec3 diffuse = BRDF_GetDiffuse(surface,surfaceToLight) * factor;
    vec3 spec = BRDF_GetSpecular(surface,surfaceToLight) * factor;
 
-   vec3 final = max(vec3(0.0f), diffuse + spec * surface.ao * surface.F);
+   vec3 final = max(vec3(0.0f), diffuse + spec * surface.F);
    return final;
 }
 
-float G1V(float dotNV, float k)
+vec4 compute4Lights( Surface surface,
+                     vec4 shadowMask,
+                     vec4 inLightPos[4],
+                     vec4 inLightConfigData[4],
+                     vec4 inLightColor[4],
+                     vec4 inLightSpotDir[4],
+                     vec4 lightSpotParams[4],
+                     int hasVectorLight,
+                     vec4 vectorLightDirection,
+                     vec4 vectorLightingColor,
+                     float  vectorLightBrightness )
 {
-	return 1.0f/(dotNV*(1.0f-k)+k);
-}
+   vec3 finalLighting = vec3(0.0f);
 
-vec3 directSpecular(vec3 N, vec3 V, vec3 L, float roughness, float F0)
-{
-	float alpha = roughness*roughness;
-
-	//TODO don't need to calculate all this again timmy!!!!!!
-    vec3 H = normalize(V + L);
-    float dotNL = clamp(dot(N,L), 0.0, 1.0);
-    float dotNV = clamp(dot(N,V), 0.0, 1.0);
-    float dotNH = clamp(dot(N,H), 0.0, 1.0);
-	float dotHV = clamp(dot(H,V), 0.0, 1.0);
-	float dotLH = clamp(dot(L,H), 0.0, 1.0);
-
-	float F, D, vis;
-
-	// D
-	float alphaSqr = alpha*alpha;
-	float pi = 3.14159f;
-	float denom = dotNH * dotNH *(alphaSqr-1.0) + 1.0f;
-	D = alphaSqr/(pi * denom * denom);
-
-	// F
-	float dotLH5 = pow(1.0f-dotLH,5);
-	F = F0 + (1.0-F0)*(dotLH5);
-
-	// V
-	float k = alpha/2.0f;
-	vis = G1V(dotNL,k)*G1V(dotNV,k);
-
-	float specular = dotNL * D * F * vis;
-	return vec3(specular,specular,specular);
+   int i;
+   for(i = 0; i < MAX_FORWARD_LIGHT; i++)
+   {
+      vec3 L = inLightPos[i].xyz - surface.P;
+      float dist = length(L);
+      float lightRange = inLightConfigData[i].z;
+      SurfaceToLight surfaceToLight = createSurfaceToLight(surface, L);
+      float shadowed = 1.0;
+
+      vec3 lightCol = inLightColor[i].rgb;
+
+      float lightBrightness = inLightConfigData[i].y;
+      float lightInvSqrRange= inLightConfigData[i].a;
+
+      vec3 lighting = vec3(0.0f);
+
+      if(dist < lightRange)
+      { 
+         if(inLightConfigData[i].x == 0) //point
+         {
+            //get punctual light contribution   
+            lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed);
+         }
+         else //spot
+         {
+               
+            //get Punctual light contribution   
+            lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed);
+            //get spot angle attenuation
+            lighting *= getSpotAngleAtt(-surfaceToLight.L, inLightSpotDir[i].xyz, lightSpotParams[i].xy );
+         }
+      }
+      finalLighting += lighting;
+   }
+
+   //Vector light
+   if(hasVectorLight == 1)
+   {
+      SurfaceToLight surfaceToVecLight = createSurfaceToLight(surface, -vectorLightDirection.xyz);
+
+      vec3 vecLighting = getDirectionalLight(surface, surfaceToVecLight, vectorLightingColor.rgb, vectorLightBrightness, 1);
+      finalLighting += vecLighting;
+   }
+
+   finalLighting *= shadowMask.rgb;
+
+   return vec4(finalLighting,1);
 }
 
 //Probe IBL stuff
@@ -316,12 +318,12 @@ float defineBoxSpaceInfluence(vec3 wsPosition, mat4 worldToObj, float attenuatio
 // Box Projected IBL Lighting
 // Based on: http://www.gamedev.net/topic/568829-box-projected-cubemap-environment-mapping/
 // and https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/
-vec3 boxProject(vec3 wsPosition, vec3 wsReflectVec, mat4 worldToObj, vec3 bbMin, vec3 bbMax, vec3 refPosition)
+vec3 boxProject(vec3 wsPosition, vec3 wsReflectVec, mat4 worldToObj, vec3 refBoxMin, vec3 refBoxMax, vec3 refPosition)
 {
    vec3 RayLS = tMul(worldToObj, vec4(wsReflectVec, 0.0)).xyz;
    vec3 PositionLS = tMul(worldToObj, vec4(wsPosition, 1.0)).xyz;
 
-   vec3 unit = bbMax.xyz - bbMin.xyz;
+   vec3 unit = refBoxMax.xyz - refBoxMin.xyz;
    vec3 plane1vec = (unit / 2 - PositionLS) / RayLS;
    vec3 plane2vec = (-unit / 2 - PositionLS) / RayLS;
    vec3 furthestPlane = max(plane1vec, plane2vec);
@@ -333,12 +335,12 @@ vec3 boxProject(vec3 wsPosition, vec3 wsReflectVec, mat4 worldToObj, vec3 bbMin,
 
 vec4 computeForwardProbes(Surface surface,
     float cubeMips, float numProbes, mat4x4 worldToObjArray[MAX_FORWARD_PROBES], vec4 probeConfigData[MAX_FORWARD_PROBES], 
-    vec4 inProbePosArray[MAX_FORWARD_PROBES], vec4 bbMinArray[MAX_FORWARD_PROBES], vec4 bbMaxArray[MAX_FORWARD_PROBES], vec4 inRefPosArray[MAX_FORWARD_PROBES],
-    float hasSkylight, sampler2D BRDFTexture, 
-	samplerCube skylightIrradMap, samplerCube skylightSpecularMap,
+    vec4 inProbePosArray[MAX_FORWARD_PROBES], vec4 refBoxMinArray[MAX_FORWARD_PROBES], vec4 refBoxMaxArray[MAX_FORWARD_PROBES], vec4 inRefPosArray[MAX_FORWARD_PROBES],
+    float skylightCubemapIdx, sampler2D BRDFTexture, 
 	samplerCubeArray irradianceCubemapAR, samplerCubeArray specularCubemapAR)
 {
-  int i = 0;
+   int i = 0;
+   float alpha = 1;
    float blendFactor[MAX_FORWARD_PROBES];
    float blendSum = 0;
    float blendFacSum = 0;
@@ -399,15 +401,13 @@ vec4 computeForwardProbes(Surface surface,
    // Radiance (Specular)
    float lod = surface.roughness*cubeMips;
 
-//1
-   float alpha = 1.0f;
    for (i = 0; i < numProbes; ++i)
    {
       float contrib = contribution[i];
-      if (contrib != 0)
+      if (contrib > 0.0f)
       {
          int cubemapIdx = int(probeConfigData[i].a);
-         vec3 dir = boxProject(surface.P, surface.R, worldToObjArray[i], bbMinArray[i].xyz, bbMaxArray[i].xyz, inRefPosArray[i].xyz);
+         vec3 dir = boxProject(surface.P, surface.R, worldToObjArray[i], refBoxMinArray[i].xyz, refBoxMaxArray[i].xyz, inRefPosArray[i].xyz);
 
          irradiance += textureLod(irradianceCubemapAR, vec4(dir, cubemapIdx), 0).xyz * contrib;
          specular += textureLod(specularCubemapAR, vec4(dir, cubemapIdx), lod).xyz * contrib;
@@ -415,10 +415,10 @@ vec4 computeForwardProbes(Surface surface,
       }
    }
 
-   if (hasSkylight == 1 && alpha > 0.001)
+   if(skylightCubemapIdx != -1 && alpha >= 0.001)
    {
-      irradiance += textureLod(skylightIrradMap, surface.R, 0).xyz * alpha;
-      specular += textureLod(skylightSpecularMap, surface.R, lod).xyz * alpha;
+      irradiance = mix(irradiance,textureLod(irradianceCubemapAR, vec4(surface.R, skylightCubemapIdx), 0).xyz, alpha);
+      specular = mix(specular,textureLod(specularCubemapAR, vec4(surface.R, skylightCubemapIdx), lod).xyz, alpha);
    }
 
    vec3 F = FresnelSchlickRoughness(surface.NdotV, surface.f0, surface.roughness);
@@ -429,13 +429,12 @@ vec4 computeForwardProbes(Surface surface,
 
    //apply brdf
    //Do it once to save on texture samples
-   vec2 brdf = textureLod(BRDFTexture, vec2(surface.roughness, surface.NdotV),0).xy;
+   vec2 brdf = textureLod(BRDFTexture, vec2(surface.roughness, 1.0-surface.NdotV),0).xy;
    specular *= brdf.x * F + brdf.y;
 
    //final diffuse color
    vec3 diffuse = kD * irradiance * surface.baseColor.rgb;
    vec4 finalColor = vec4(diffuse + specular * surface.ao, 1.0);
 
-   finalColor = vec4(irradiance.rgb,1);
    return finalColor;
 }

+ 19 - 17
Templates/BaseGame/game/core/rendering/shaders/lighting.hlsl

@@ -99,6 +99,8 @@ struct Surface
 	}
 };
 
+
+
 inline Surface createSurface(float4 gbuffer0, TORQUE_SAMPLER2D(gbufferTex1), TORQUE_SAMPLER2D(gbufferTex2), in float2 uv, in float3 wsEyePos, in float3 wsEyeRay, in float4x4 invView)
 {
 	Surface surface = (Surface)0;
@@ -124,28 +126,28 @@ inline Surface createSurface(float4 gbuffer0, TORQUE_SAMPLER2D(gbufferTex1), TOR
 
 inline Surface createForwardSurface(float4 baseColor, float3 normal, float4 pbrProperties, in float3 wsPosition, in float3 wsEyePos, in float3 wsEyeRay)
 {
-	Surface surface = (Surface)0;
+   Surface surface = (Surface)0;
 
-  surface.depth = 0;
-	surface.P = wsPosition;
-	surface.N = normal;
-	surface.V = normalize(wsEyePos - surface.P);
-	surface.baseColor = baseColor;
-  const float minRoughness=1e-4;
-	surface.roughness = clamp(1.0 - pbrProperties.b, minRoughness, 1.0); //t3d uses smoothness, so we convert to roughness.
-	surface.roughness_brdf = surface.roughness * surface.roughness;
-	surface.metalness = pbrProperties.a;
-  surface.ao = pbrProperties.g;
-  surface.matFlag = pbrProperties.r;
-
-	surface.Update();
-	return surface;
+   surface.depth = 0;
+   surface.P = wsPosition;
+   surface.N = normal;
+   surface.V = normalize(wsEyePos - surface.P);
+   surface.baseColor = baseColor;
+   const float minRoughness=1e-4;
+   surface.roughness = clamp(1.0 - pbrProperties.b, minRoughness, 1.0); //t3d uses smoothness, so we convert to roughness.
+   surface.roughness_brdf = surface.roughness * surface.roughness;
+   surface.metalness = pbrProperties.a;
+   surface.ao = pbrProperties.g;
+   surface.matFlag = pbrProperties.r;
+
+   surface.Update();
+   return surface;
 }
 
 struct SurfaceToLight
 {
 	float3 L;				// surface to light vector
-   float3 Lu;				// un-normalized surface to light vector
+    float3 Lu;				// un-normalized surface to light vector
 	float3 H;				// half-vector between view vector and light vector
 	float NdotL;			// cos(angle between N and L)
 	float HdotV;			// cos(angle between H and V) = HdotL = cos(angle between H and L)
@@ -155,7 +157,7 @@ struct SurfaceToLight
 inline SurfaceToLight createSurfaceToLight(in Surface surface, in float3 L)
 {
 	SurfaceToLight surfaceToLight = (SurfaceToLight)0;
-   surfaceToLight.Lu = L;
+    surfaceToLight.Lu = L;
 	surfaceToLight.L = normalize(L);
 	surfaceToLight.H = normalize(surface.V + surfaceToLight.L);
 	surfaceToLight.NdotL = saturate(dot(surfaceToLight.L, surface.N));

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/deferredShadingP.glsl

@@ -22,7 +22,7 @@
 
 #include "../../../gl/hlslCompat.glsl"
 #include "shadergen:/autogenConditioners.h"
-#include "../../../postFx/gl/postFX.glsl"
+#include "../../../postFx/gl/postFx.glsl"
 #include "../../../gl/torque.glsl"
 
 uniform sampler2D colorBufferTex;

+ 2 - 2
Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/pointLightP.glsl

@@ -175,7 +175,7 @@ void main()
       #ifdef SHADOW_CUBE
               
          // TODO: We need to fix shadow cube to handle soft shadows!
-         float occ = texture( shadowMap, ttMul( worldToLightProj, -surfaceToLight.L ) ).r;
+         float occ = texture( shadowMap, tMul( worldToLightProj, -surfaceToLight.L ) ).r;
          float shadowed = saturate( exp( lightParams.y * ( occ - distToLight ) ) );
          
       #else
@@ -192,7 +192,7 @@ void main()
    #ifdef USE_COOKIE_TEX
 
       // Lookup the cookie sample.
-      vec4 cookie = texture(cookieMap, ttMul(worldToLightProj, -surfaceToLight.L));
+      vec4 cookie = texture(cookieMap, tMul(worldToLightProj, -surfaceToLight.L));
       // Multiply the light with the cookie tex.
       lightCol *= cookie.rgb;
       // Use a maximum channel luminance to attenuate 

+ 0 - 68
Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/probeShadingP.glsl

@@ -1,68 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-
-#include "../../../gl/hlslCompat.glsl"
-#include "shadergen:/autogenConditioners.h"
-#include "../../../postFx/gl/postFX.glsl"
-#include "../../../gl/torque.glsl"
-
-uniform sampler2D colorBufferTex;
-uniform sampler2D diffuseLightingBuffer;
-uniform sampler2D matInfoTex;
-uniform sampler2D specularLightingBuffer;
-uniform sampler2D deferredTex;
-
-uniform float radius;
-uniform vec2 targetSize;
-uniform int captureRez;
-
-out vec4 OUT_col;
-
-void main()
-{
-   float depth = deferredUncondition( deferredTex, uv0 ).w;
-   if (depth>0.9999)
-   {
-      discard;
-      return;
-   }
-   vec3 colorBuffer = texture( colorBufferTex, uv0 ).rgb; //albedo
-   vec4 matInfo = texture(matInfoTex, uv0); //flags|smoothness|ao|metallic
-
-   bool emissive = getFlag(matInfo.r, 0);
-   if (emissive)
-   {
-     OUT_col = vec4(colorBuffer, 1.0);
-     return;
-   }
-	  
-   vec4 diffuseLighting = texture( diffuseLightingBuffer, uv0 ); //shadowmap*specular
-   colorBuffer *= diffuseLighting.rgb;
-   vec2 relUV = uv0*targetSize/captureRez;
-   
-   //we use a 1k depth range in the capture frustum. 
-   //reduce that a bit to get something resembling depth fidelity out of 8 bits
-   depth*=2000/radius;
-   
-   float rLen = length(vec3(relUV,depth)-vec3(0.5,0.5,0));
-   OUT_col = hdrEncode( vec4(colorBuffer,rLen));
-}

+ 31 - 41
Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeArrayP.glsl

@@ -27,15 +27,15 @@ uniform samplerCubeArray irradianceCubemapAR;
 uniform vec4    inProbePosArray[MAX_PROBES];
 uniform vec4    inRefPosArray[MAX_PROBES];
 uniform mat4    worldToObjArray[MAX_PROBES];
-uniform vec4    bbMinArray[MAX_PROBES];
-uniform vec4    bbMaxArray[MAX_PROBES];
+uniform vec4    refBoxMinArray[MAX_PROBES];
+uniform vec4    refBoxMaxArray[MAX_PROBES];
 uniform vec4    probeConfigData[MAX_PROBES];   //r,g,b/mode,radius,atten
 
 #if DEBUGVIZ_CONTRIB
 uniform vec4    probeContribColors[MAX_PROBES];
 #endif
 
-uniform float skylightCubemapIdx;
+uniform int skylightCubemapIdx;
 
 out vec4 OUT_col;
 
@@ -55,7 +55,6 @@ void main()
 
    float alpha = 1;
 
-#ifdef SKYLIGHT_ONLY
 #if SKYLIGHT_ONLY == 0
    int i = 0;
    float blendFactor[MAX_PROBES];
@@ -66,8 +65,8 @@ void main()
    //Set up our struct data
    float contribution[MAX_PROBES];
 
-   //if (alpha > 0)
-   //{
+   if (alpha > 0)
+   {
       //Process prooooobes
       for (i = 0; i < numProbes; ++i)
       {
@@ -85,8 +84,6 @@ void main()
             if (contribution[i]>0.0)
                probehits++;
          }
-         else
-            continue;
 
          contribution[i] = max(contribution[i],0);
 
@@ -99,32 +96,29 @@ void main()
 	   // Weight1 = normalized inverted NDF, so we have 1 at center, 0 at boundary
 	   // and respect constraint A.
       
-      if (probehits>1.0)
-	{
-            for (i = 0; i < numProbes; i++)
-            {
-                  blendFactor[i] = ((contribution[i] / blendSum)) / probehits;
-                  blendFactor[i] *= ((contribution[i]) / invBlendSum);
-                  blendFactor[i] = saturate(blendFactor[i]);
-                  blendFacSum += blendFactor[i];
-            }
-
-      // Normalize blendVal
-	    if (blendFacSum == 0.0f) // Possible with custom weight
-	    {
-	          blendFacSum = 1.0f;
-	    }
-
-            float invBlendSumWeighted = 1.0f / blendFacSum;
-            for (i = 0; i < numProbes; ++i)
-            {
-                  blendFactor[i] *= invBlendSumWeighted;
-                  contribution[i] *= blendFactor[i];
-                  alpha -= contribution[i];
-            }
+      if (probehits > 1.0)
+	   {
+         for (i = 0; i < numProbes; i++)
+         {
+               blendFactor[i] = ((contribution[i] / blendSum)) / probehits;
+               blendFactor[i] *= ((contribution[i]) / invBlendSum);
+               blendFactor[i] = saturate(blendFactor[i]);
+               blendFacSum += blendFactor[i];
+         }
+
+         // Normalize blendVal
+         if (blendFacSum == 0.0f) // Possible with custom weight
+         {
+               blendFacSum = 1.0f;
+         }
+
+         float invBlendSumWeighted = 1.0f / blendFacSum;
+         for (i = 0; i < numProbes; ++i)
+         {
+               blendFactor[i] *= invBlendSumWeighted;
+               contribution[i] *= blendFactor[i];
+         }
       }
-      else
-         alpha -= blendSum;
       
 #if DEBUGVIZ_ATTENUATION == 1
       float contribAlpha = 1;
@@ -148,14 +142,13 @@ void main()
 
       //Skylight coloration for anything not covered by probes above
       if(skylightCubemapIdx != -1)
-      	finalContribColor += vec3(0.3, 0.3, 0.3) * contribAlpha;
+      	finalContribColor += vec3(0, 1, 0) * contribAlpha;
 
       OUT_col = vec4(finalContribColor, 1);
       return;
 #endif
-   //}
+   }
 #endif
-#endif //SKYLIGHT_ONLY
 
    vec3 irradiance = vec3(0, 0, 0);
    vec3 specular = vec3(0, 0, 0);
@@ -167,16 +160,14 @@ void main()
    float lod = 0;
 #endif
 
-#ifdef SKYLIGHT_ONLY
 #if SKYLIGHT_ONLY == 0
-   alpha = 1;
    for (i = 0; i < numProbes; ++i)
    {
       float contrib = contribution[i];
-      if (contrib != 0)
+      if (contrib > 0.0f)
       {
          float cubemapIdx = probeConfigData[i].a;
-         vec3 dir = boxProject(surface.P, surface.R, worldToObjArray[i], bbMinArray[i].xyz, bbMaxArray[i].xyz, inRefPosArray[i].xyz);
+         vec3 dir = boxProject(surface.P, surface.R, worldToObjArray[i], refBoxMinArray[i].xyz, refBoxMaxArray[i].xyz, inRefPosArray[i].xyz);
 
          irradiance += textureLod(irradianceCubemapAR, vec4(dir, cubemapIdx), 0).xyz * contrib;
          specular += textureLod(specularCubemapAR, vec4(dir, cubemapIdx), lod).xyz * contrib;
@@ -184,7 +175,6 @@ void main()
       }
    }
 #endif
-#endif //SKYLIGHT_ONLY
 
    if (skylightCubemapIdx != -1 && alpha > 0.001)
    {

+ 0 - 162
Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeP.glsl

@@ -1,162 +0,0 @@
-//-----------------------------------------------------------------------------
-// Copyright (c) 2012 GarageGames, LLC
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-//-----------------------------------------------------------------------------
-#include "../../../gl/hlslCompat.glsl"
-#include "shadergen:/autogenConditioners.h"
-#include "farFrustumQuad.glsl"
-#include "../../../gl/torque.glsl"
-#include "../../../gl/lighting.glsl"
-#line 27
-
-in vec4 pos;
-in vec4 wsEyeDir;
-in vec4 ssPos;
-in vec4 vsEyeDir;
-
-uniform sampler2D deferredBuffer;
-uniform sampler2D colorBuffer;
-uniform sampler2D matInfoBuffer;
-uniform samplerCube cubeMap;
-uniform samplerCube irradianceCubemap;
-uniform sampler2D BRDFTexture;
-uniform float cubeMips;
-
-uniform vec4 rtParams0;
-
-uniform vec3 probeWSPos;
-uniform vec3 probeLSPos;
-uniform vec4 vsFarPlane;
-
-uniform float radius;
-uniform vec2 attenuation;
-
-uniform mat4 worldToObj;
-uniform mat4 cameraToWorld;
-
-uniform vec3 eyePosWorld;
-uniform vec3 bbMin;
-uniform vec3 bbMax;
-
-uniform float useSphereMode;
-
-// Box Projected IBL Lighting
-// Based on: http://www.gamedev.net/topic/568829-box-projected-cubemap-environment-mapping/
-// and https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/
-vec3 boxProject(vec3 wsPosition, vec3 reflectDir, vec3 boxWSPos, vec3 boxMin, vec3 boxMax)
-{ 
-    vec3 nrdir = reflectDir;
-	vec3 offset = wsPosition;
-    vec3 plane1vec = (boxMax - offset) / nrdir;
-    vec3 plane2vec = (boxMin - offset) / nrdir;
-	
-	vec3 furthestPlane = max(plane1vec, plane2vec);
-	float dist = min(min(furthestPlane.x, furthestPlane.y), furthestPlane.z);
-    vec3 posonbox = offset + nrdir * dist;
-
-    return posonbox - boxWSPos;
-}
-
-vec3 iblBoxSpecular(vec3 normal, vec3 wsPos, float roughness, vec3 surfToEye,
-                    sampler2D brdfTexture, 
-                    samplerCube radianceCube,
-                    vec3 boxPos,
-                    vec3 boxMin,
-                    vec3 boxMax)
-{
-    float ndotv = clamp(dot(normal, surfToEye), 0.0, 1.0);
-
-    // BRDF
-    vec2 brdf = textureLod(brdfTexture, vec2(roughness, ndotv),0).xy;
-
-    // Radiance (Specular)
-	float maxmip = pow(cubeMips+1,2);
-    float lod = roughness*maxmip;
-    vec3 r = reflect(surfToEye, normal);
-    vec3 cubeR = normalize(r);
-    cubeR = boxProject(wsPos, cubeR, boxPos, boxMin, boxMax);
-	
-    vec3 radiance = textureLod(radianceCube, cubeR, lod).xyz * (brdf.x + brdf.y);
-    
-    return radiance;
-}
-
-float defineBoxSpaceInfluence(vec3 surfPosWS, vec3 probePos, float radius, float atten)
-{
-    vec3 surfPosLS = tMul( worldToObj, vec4(surfPosWS,1.0)).xyz;
-
-    vec3 boxMinLS = probePos-(vec3(1,1,1)*radius);
-    vec3 boxMaxLS = probePos+(vec3(1,1,1)*radius);
-
-    float boxOuterRange = length(boxMaxLS - boxMinLS);
-    float boxInnerRange = boxOuterRange / atten;
-
-    vec3 localDir = vec3(abs(surfPosLS.x), abs(surfPosLS.y), abs(surfPosLS.z));
-    localDir = (localDir - boxInnerRange) / (boxOuterRange - boxInnerRange);
-
-    return max(localDir.x, max(localDir.y, localDir.z)) * -1;
-}
-out vec4 OUT_col;
-
-void main()
-{   
-
-    // Compute scene UV
-    vec2 uvScene = getUVFromSSPos( ssPos.xyz/ssPos.w, rtParams0 );
-
-   //eye ray WS/LS
-   vec3 vsEyeRay = getDistanceVectorToPlane( -vsFarPlane.w, vsEyeDir.xyz, vsFarPlane );
-   vec3 wsEyeRay = tMul(cameraToWorld, vec4(vsEyeRay, 0)).xyz;
-   
-   //unpack normal and linear depth 
-   vec4 normDepth = deferredUncondition(deferredBuffer, uvScene);
-   
-   //create surface
-   Surface surface = createSurface( normDepth, colorBuffer, matInfoBuffer,
-                                    uvScene, eyePosWorld, wsEyeRay, cameraToWorld);		  
-    float blendVal = 1.0;
-	if(useSphereMode>0)
-    {
-		vec3 L = probeWSPos - surface.P;
-		blendVal = 1.0-length(L)/radius;
-		clip(blendVal);		
-    }
-    else
-    {
-        float tempAttenVal = 3.5;
-		blendVal = defineBoxSpaceInfluence(surface.P, probeWSPos, radius, tempAttenVal);
-		clip(blendVal);
-		float compression = 0.05;
-		blendVal=(1.0-compression)+blendVal*compression;
-	}
-	//render into the bound space defined above
-	vec3 surfToEye = normalize(surface.P - eyePosWorld);
-	vec3 irradiance = textureLod(irradianceCubemap, surface.N,0).xyz;
-	vec3 specular = iblBoxSpecular(surface.N, surface.P, surface.roughness, surfToEye, BRDFTexture, cubeMap, probeWSPos, bbMin, bbMax);
-   vec3 F = FresnelSchlickRoughness(surface.NdotV, surface.f0, surface.roughness);
-   specular *= F;
-   //energy conservation
-	vec3 kD = vec3(1.0) - F;
-	kD *= 1.0 - surface.metalness;
-   //final diffuse color
-   vec3 diffuse = kD * irradiance * surface.baseColor.rgb;
-   
-   OUT_col = vec4(diffuse + specular * surface.ao, blendVal);
-}

+ 0 - 32
Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/gl/reflectionProbeV.glsl

@@ -1,32 +0,0 @@
-#include "shadergen:/autogenConditioners.h"
-#include "../../torque.hlsl"
-
-// This is the shader input
-struct Vert
-{
-   float4 position : POSITION;
-   float2 uv0      : TEXCOORD0;
-   float3 wsEyeRay : TEXCOORD1;
-};
-
-// This is the shader output data.
-struct Conn
-{
-   float4 position : POSITION;
-   float2 uv0      : TEXCOORD0;
-   float3 wsEyeRay : TEXCOORD1;
-};
-
-// Render Target Paramaters
-float4 rtParams0;
-
-Conn main(Vert IN,
-          uniform float4x4 modelView : register(C0))	         
-{
-   Conn OUT;   
-   OUT.position = IN.position;
-   OUT.uv0 = viewportCoordToRenderTarget( IN.uv0, rtParams0 );
-   OUT.wsEyeRay = IN.wsEyeRay;
-   return OUT;
-}
-

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/lighting/advanced/reflectionProbeArrayP.hlsl

@@ -93,7 +93,7 @@ float4 main(PFXVertToPix IN) : SV_TARGET
 	   // and respect constraint A.
       
       if (probehits > 1.0)
-	  {
+	   {
          for (i = 0; i < numProbes; i++)
          {
                blendFactor[i] = ((contribution[i] / blendSum)) / probehits;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/caustics/gl/causticsP.glsl

@@ -21,7 +21,7 @@
 //-----------------------------------------------------------------------------
 
 #include "../../../gl/hlslCompat.glsl"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 #include "shadergen:/autogenConditioners.h"
 
 uniform vec3    eyePosWorld;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_CalcCoC_P.glsl

@@ -21,7 +21,7 @@
 //-----------------------------------------------------------------------------
 
 #include "../../../gl/hlslCompat.glsl"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 // These are set by the game engine.  
 uniform sampler2D shrunkSampler;  // Output of DofDownsample()  

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_CalcCoC_V.glsl

@@ -22,7 +22,7 @@
 
 #include "../../../gl/hlslCompat.glsl"
 #include "../../../gl/torque.glsl"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 uniform vec4 rtParams0;
 uniform vec4 rtParams1;

+ 2 - 2
Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Final_P.glsl

@@ -22,7 +22,7 @@
 
 #include "../../../gl/hlslCompat.glsl"
 #include "shadergen:/autogenConditioners.h"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 uniform sampler2D colorSampler; // Original source image  
 uniform sampler2D smallBlurSampler; // Output of SmallBlurPS()  
@@ -73,7 +73,7 @@ half4 InterpolateDof( half3 small, half3 med, half3 large, half t )
    // d0, the small to medium blur over distance d1, and the medium to  
    // large blur over distance d2, where d0 + d1 + d2 = 1.  
    //vec4 dofLerpScale = vec4( -1 / d0, -1 / d1, -1 / d2, 1 / d2 );  
-   //vec4 dofLerpBias = vec4( 1, (1 – d2) / d1, 1 / d2, (d2 – 1) / d2 );  
+   //vec4 dofLerpBias = vec4( 1, (1 � d2) / d1, 1 / d2, (d2 � 1) / d2 );  
    
    weights = saturate( t * dofLerpScale + dofLerpBias );  
    weights.yz = min( weights.yz, 1 - weights.xy );  

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Final_V.glsl

@@ -22,7 +22,7 @@
 
 #include "../../../gl/hlslCompat.glsl"
 #include "../../../gl/torque.glsl"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 uniform vec4 rtParams0;
 uniform vec4 rtParams1;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/dof/gl/DOF_Passthrough_V.glsl

@@ -22,7 +22,7 @@
 
 #include "../../../gl/hlslCompat.glsl"
 #include "../../../gl/torque.glsl"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 uniform vec4 rtParams0;
 uniform vec4 rtParams1;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/gl/edgeAAP.glsl

@@ -22,7 +22,7 @@
 
 #include "../../../gl/hlslCompat.glsl"
 #include "shadergen:/autogenConditioners.h"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 uniform sampler2D edgeBuffer;
 uniform sampler2D backBuffer;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/edgeaa/gl/edgeAAV.glsl

@@ -22,7 +22,7 @@
 
 #include "../../../gl/hlslCompat.glsl"
 #include "../../../gl/torque.glsl"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 uniform vec4 rtParams0;
 uniform vec4 rtParams1;

+ 2 - 2
Templates/BaseGame/game/core/rendering/shaders/postFX/gl/chromaticLens.glsl

@@ -20,10 +20,10 @@
 // IN THE SOFTWARE.
 //-----------------------------------------------------------------------------
 
-// Based on 'Cubic Lens Distortion HLSL Shader' by François Tarlier
+// Based on 'Cubic Lens Distortion HLSL Shader' by Fran�ois Tarlier
 // www.francois-tarlier.com/blog/index.php/2009/11/cubic-lens-distortion-shader
 
-#include "./postFX.glsl"
+#include "./postFx.glsl"
 #include "../../gl/torque.glsl"
 #include "../../gl/hlslCompat.glsl"
 

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/gl/flashP.glsl

@@ -20,7 +20,7 @@
 // IN THE SOFTWARE.
 //-----------------------------------------------------------------------------
 
-#include "./postFX.glsl"
+#include "./postFx.glsl"
 #include "../../gl/torque.glsl"
 #include "../../gl/hlslCompat.glsl"
 

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/gl/motionBlurP.glsl

@@ -23,7 +23,7 @@
 #include "../../gl/hlslCompat.glsl"
 #include "../../gl/torque.glsl"
 #include "shadergen:/autogenConditioners.h"
-#include "postFX.glsl"
+#include "postFx.glsl"
 
 #undef IN_uv0
 #define _IN_uv0 uv0

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/gl/underwaterFogP.glsl

@@ -22,7 +22,7 @@
 
 #include "../../gl/hlslCompat.glsl"  
 #include "../../gl/torque.glsl"
-#include "postFX.glsl"
+#include "postFx.glsl"
 #include "shadergen:/autogenConditioners.h"
 
 //-----------------------------------------------------------------------------

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/bloomGaussBlurHP.glsl

@@ -22,7 +22,7 @@
 
 #include "../../../gl/hlslCompat.glsl"
 #include "shadergen:/autogenConditioners.h"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 uniform sampler2D inputTex ;
 uniform vec2 oneOverTargetSize;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/bloomGaussBlurVP.glsl

@@ -22,7 +22,7 @@
 
 #include "../../../gl/hlslCompat.glsl"
 #include "shadergen:/autogenConditioners.h"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 uniform sampler2D inputTex ;
 uniform vec2 oneOverTargetSize;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/brightPassFilterP.glsl

@@ -23,7 +23,7 @@
 #include "../../../gl/torque.glsl"
 #include "../../../gl/hlslCompat.glsl"
 #include "shadergen:/autogenConditioners.h"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 uniform sampler2D inputTex ;
 uniform sampler2D luminanceTex  ;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/calculateAdaptedLumP.glsl

@@ -22,7 +22,7 @@
 
 #include "../../../gl/hlslCompat.glsl"
 #include "shadergen:/autogenConditioners.h"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 uniform sampler2D currLum;
 uniform sampler2D lastAdaptedLum;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/finalPassCombineP.glsl

@@ -22,7 +22,7 @@
 
 #include "../../../gl/torque.glsl"
 #include "../../../gl/hlslCompat.glsl"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 #include "shadergen:/autogenConditioners.h"
 
 uniform sampler2D sceneTex;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/luminanceVisP.glsl

@@ -23,7 +23,7 @@
 #include "../../../gl/torque.glsl"
 #include "../../../gl/hlslCompat.glsl"
 #include "shadergen:/autogenConditioners.h"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 uniform sampler2D inputTex;
 uniform float brightPassThreshold;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/sampleLumInitialP.glsl

@@ -22,7 +22,7 @@
 
 #include "../../../gl/torque.glsl"
 #include "../../../gl/hlslCompat.glsl"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 uniform sampler2D inputTex;
 uniform vec2 texSize0;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/hdr/gl/sampleLumIterativeP.glsl

@@ -21,7 +21,7 @@
 //-----------------------------------------------------------------------------
 
 #include "../../../gl/hlslCompat.glsl"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 uniform sampler2D inputTex;
 uniform vec2 oneOverTargetSize;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/lightRay/gl/lightRayOccludeP.glsl

@@ -22,7 +22,7 @@
 
 #include "../../../gl/hlslCompat.glsl"
 #include "shadergen:/autogenConditioners.h"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 uniform sampler2D backBuffer;   // The original backbuffer.
 uniform sampler2D deferredTex;   // The pre-pass depth and normals.

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/lightRay/gl/lightRayP.glsl

@@ -21,7 +21,7 @@
 //-----------------------------------------------------------------------------
 
 #include "../../../gl/hlslCompat.glsl"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 uniform sampler2D frameSampler;
 uniform sampler2D backBuffer;

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/gl/SSAO_P.glsl

@@ -22,7 +22,7 @@
 
 #include "../../../gl/hlslCompat.glsl"
 #include "shadergen:/autogenConditioners.h"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
 
 #define DOSMALL
 #define DOLARGE

+ 1 - 1
Templates/BaseGame/game/core/rendering/shaders/postFX/ssao/gl/SSAO_PowerTable_V.glsl

@@ -22,7 +22,7 @@
 
 #include "../../../gl/torque.glsl"
 #include "../../../gl/hlslCompat.glsl"
-#include "../../gl/postFX.glsl"
+#include "../../gl/postFx.glsl"
                     
 void main()
 {

+ 4 - 3
Templates/BaseGame/game/data/ExampleModule/ExampleModule.cs

@@ -6,7 +6,6 @@
 //else.
 function ExampleModule::onCreate(%this)
 {
-   %bool = true;
 }
 
 //Similar to the create function, this is defined in thye module file, and called 
@@ -70,6 +69,8 @@ function ExampleModule::onDestroyGameServer(%this)
 function ExampleModule::initClient(%this)
 {
    AssetDatabase.acquireAsset("ExampleModule:exampleDatablock");
+   AssetDatabase.acquireAsset("ExampleModule:examplePostEffect");
+   AssetDatabase.acquireAsset("ExampleModule:exampleGUI");
    
    //client scripts
    //Here, we exec out keybind scripts so the player is able to move when they get into a game
@@ -91,7 +92,7 @@ function ExampleModule::initClient(%this)
 function ExampleModule::onCreateClientConnection(%this)
 {
    //This will push our keybind movemap onto the input stack, so we can control our camera in our ExampleGameMode
-   ExampleMoveMap.push();
+   //ExampleMoveMap.push();
 }
 
 //This is called when a client game session disconnects from a game server
@@ -103,5 +104,5 @@ function ExampleModule::onCreateClientConnection(%this)
 function ExampleModule::onDestroyClientConnection(%this)
 {
    //This will pop the keybind, cleaning it up from the input stack, as it no longer applies
-   ExampleMoveMap.pop();
+   //ExampleMoveMap.pop();
 }

+ 0 - 10
Templates/BaseGame/game/data/ExampleModule/ExampleModule.module

@@ -12,14 +12,4 @@
         canSaveDynamicFields="true"
         Extension="asset.taml"
         Recurse="true" />
-    <AutoloadAssets
-        canSave="true"
-        canSaveDynamicFields="true"
-        AssetType="ComponentAsset"
-        Recurse="true" />
-    <AutoloadAssets
-        canSave="true"
-        canSaveDynamicFields="true"
-        AssetType="GUIAsset"
-        Recurse="true" />
 </ModuleDefinition>

+ 56 - 48
Templates/BaseGame/game/data/ExampleModule/levels/ExampleLevel.mis

@@ -2,13 +2,16 @@
 new Scene(EditorTemplateLevel) {
    canSave = "1";
    canSaveDynamicFields = "1";
+   isSubScene = "0";
+   isEditing = "0";
+   isDirty = "0";
+   gameModeName = "ExampleGameMode";
       cdTrack = "2";
       CTF_scoreLimit = "5";
-      enabled = "1";
+      Enabled = "1";
       musicTrack = "lush";
-      gameModeName="ExampleGameMode";
 
-   new LevelInfo(TheLevelInfo) {
+   new LevelInfo(theLevelInfo) {
       nearClip = "0.1";
       visibleDistance = "1000";
       visibleGhostDistance = "0";
@@ -20,79 +23,84 @@ new Scene(EditorTemplateLevel) {
       canvasClearColor = "0 0 0 255";
       ambientLightBlendPhase = "1";
       ambientLightBlendCurve = "0 0 -1 -1";
-      advancedLightmapSupport = "0";
       soundAmbience = "AudioAmbienceDefault";
       soundDistanceModel = "Linear";
       canSave = "1";
       canSaveDynamicFields = "1";
+         advancedLightmapSupport = "0";
          desc0 = "A blank room template that acts as a starting point.";
-         enabled = "1";
-         levelName = "Blank Room Template";
+         Enabled = "1";
+         LevelName = "Blank Room Template";
    };
-   new SkyBox(theSky) {
-      Material = "BlankSkyMat";
-      drawBottom = "0";
-      fogBandHeight = "0";
-      position = "0 0 0";
-      rotation = "1 0 0 0";
-      scale = "1 1 1";
+   new GroundPlane() {
+      squareSize = "128";
+      scaleU = "25";
+      scaleV = "25";
+      Material = "Grid_512_Grey";
       canSave = "1";
       canSaveDynamicFields = "1";
+         Enabled = "1";
+         position = "0 0 0";
+         rotation = "1 0 0 0";
+         scale = "1 1 1";
    };
-   new Sun(theSun) {
-      azimuth = "230.396";
-      elevation = "45";
-      color = "0.968628 0.901961 0.901961 1";
-      ambient = "0.337255 0.533333 0.619608 1";
-      brightness = "1";
+   new ScatterSky() {
+      skyBrightness = "25";
+      sunSize = "1";
+      colorizeAmount = "0";
+      colorize = "0 0 0 1";
+      rayleighScattering = "0.0035";
+      sunScale = "1 1 1 1";
+      ambientScale = "1 1 1 1";
+      fogScale = "1 1 1 1";
+      exposure = "1";
+      zOffset = "0";
+      azimuth = "0";
+      elevation = "35";
+      moonAzimuth = "0";
+      moonElevation = "45";
       castShadows = "1";
-      staticRefreshFreq = "250";
+      staticRefreshFreq = "8";
       dynamicRefreshFreq = "8";
-      coronaEnabled = "1";
-      coronaScale = "0.5";
-      coronaTint = "1 1 1 1";
-      coronaUseLightColor = "1";
+      brightness = "1";
       flareScale = "1";
+      nightColor = "0.0196078 0.0117647 0.109804 1";
+      nightFogColor = "0.0196078 0.0117647 0.109804 1";
+      moonEnabled = "1";
+      moonMat = "Moon_Glow_Mat";
+      moonScale = "0.2";
+      moonLightColor = "0.192157 0.192157 0.192157 1";
+      useNightCubemap = "1";
+      nightCubemap = "NightCubemap";
       attenuationRatio = "0 1 1";
       shadowType = "PSSM";
       texSize = "1024";
-      overDarkFactor = "3000 1500 750 250";
-      shadowDistance = "200";
-      shadowSoftness = "0.25";
+      overDarkFactor = "2000 1000 500 100";
+      shadowDistance = "400";
+      shadowSoftness = "0.15";
       numSplits = "4";
-      logWeight = "0.9";
+      logWeight = "0.91";
       fadeStartDistance = "0";
       lastSplitTerrainOnly = "0";
       representedInLightmap = "0";
       shadowDarkenColor = "0 0 0 -1";
       includeLightmappedGeometryInShadow = "0";
-      position = "0 0 0";
+      position = "-19.4839 100.725 -19.5889";
       rotation = "1 0 0 0";
       scale = "1 1 1";
       canSave = "1";
       canSaveDynamicFields = "1";
-         bias = "0.1";
-         Blur = "1";
-         enabled = "1";
-         height = "1024";
-         lightBleedFactor = "0.8";
-         minVariance = "0";
-         pointShadowType = "PointShadowType_Paraboloid";
-         shadowBox = "-100 -100 -100 100 100 100";
-         splitFadeDistances = "1 1 1 1";
-         width = "3072";
+         mieScattering = "0.0045";
    };
-   new GroundPlane() {
-      squareSize = "128";
-      scaleU = "25";
-      scaleV = "25";
-      Material = "Grid_512_Grey";
+   new Skylight() {
+      Enabled = "1";
+      ReflectionMode = "Baked Cubemap";
+      position = "-2.09752 10.8435 53.7998";
+      rotation = "1 0 0 0";
       canSave = "1";
       canSaveDynamicFields = "1";
-         enabled = "1";
-         position = "0 0 0";
-         rotation = "1 0 0 0";
-         scale = "1 1 1";
+      persistentId = "fff282f5-dced-11e9-a423-bb0e346e3870";
+         reflectionPath = "D:/Gamedev/T3DMIT/T3DPreview4_0/Bugfixaroo/My Projects/Bugfixaroo/game/data/ExampleModule/levels/ExampleLevel/probes/";
    };
 };
 //--- OBJECT WRITE END ---

+ 35 - 0
Templates/BaseGame/game/data/ExampleModule/postFXs/ExamplePostEffect.cs

@@ -61,6 +61,12 @@ function ExamplePostEffect::preProcess( %this )
 {
 }
 
+function ExamplePostEffect::onAdd(%this)
+{
+   //Register the postFX with the manager
+   PostFXManager.registerPostEffect(%this);
+}
+
 function ExamplePostEffect::onEnabled( %this )
 {
    return true;
@@ -70,6 +76,35 @@ function ExamplePostEffect::onDisabled( %this )
 {
 }
 
+//This is used to populate the PostFXEditor's settings so the post FX can be edited
+//This is automatically polled for any postFX that has been registered(in our onAdd) and the settings
+//are thus exposed for editing
+function ExamplePostEffect::populatePostFXSettings(%this)
+{
+   PostEffectEditorInspector.startGroup("ExamplePostEffect - General");
+   PostEffectEditorInspector.addField("$PostFXManager::Settings::EnabledExamplePostEffect", "Enabled", "bool", "", $PostFXManager::PostFX::EnableExamplePostEffect, "");
+   PostEffectEditorInspector.endGroup();
+}
+
+//This function pair(applyFromPreset and settingsApply) are done the way they are, with the separated variables
+//so that we can effectively store the 'settings' away from the live variables that the postFX's actually utilize
+//when rendering. This allows us to modify things but still leave room for reverting or temporarily applying them
+function ExamplePostEffect::applyFromPreset(%this)
+{
+   //ExamplePostEffect Settings
+   $PostFXManager::PostFX::EnableExamplePostEffect = $PostFXManager::Settings::EnabledExamplePostEffect;
+
+   if($PostFXManager::PostFX::EnableExamplePostEffect)
+      %this.enable();
+   else
+      %this.disable();
+}
+
+function ExamplePostEffect::settingsApply(%this)
+{
+   $PostFXManager::Settings::EnabledExamplePostEffect = $PostFXManager::PostFX::EnableExamplePostEffect;
+}
+
 singleton PostEffect( ExamplePostEffect )
 {
    isEnabled = false;

+ 0 - 9
Templates/BaseGame/game/data/Kork/Images/player_Albedo.asset.taml

@@ -1,9 +0,0 @@
-<ImageAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="player_Albedo"
-    imageFile="@assetFile=player_Albedo.png"
-    useMips="true"
-    isHDRImage="false"
-    originalFilePath="E:/Gamedev/Art/TorqueCharacters/OrcMage/player_Albedo.png"
-    VersionId="1" />

BIN
Templates/BaseGame/game/data/Kork/Images/player_Albedo.png


+ 0 - 19
Templates/BaseGame/game/data/Kork/Kork.cs

@@ -1,19 +0,0 @@
-function Kork::onCreate(%this)
-{
-}
-
-function Kork::onDestroy(%this)
-{
-}
-
-function Kork::initServer(%this){}
-
-function Kork::onCreateGameServer(%this){}
-
-function Kork::onDestroyGameServer(%this){}
-
-function Kork::initClient(%this){}
-
-function Kork::onCreateClientConnection(%this){}
-
-function Kork::onDestroyClientConnection(%this){}

+ 0 - 25
Templates/BaseGame/game/data/Kork/Kork.module

@@ -1,25 +0,0 @@
-<ModuleDefinition
-    canSave="true"
-    canSaveDynamicFields="true"
-    ModuleId="Kork"
-    VersionId="1"
-    Group="Game"
-    scriptFile="Kork.cs"
-    CreateFunction="onCreate"
-    DestroyFunction="onDestroy">
-    <DeclaredAssets
-        canSave="true"
-        canSaveDynamicFields="true"
-        Extension="asset.taml"
-        Recurse="true" />
-    <AutoloadAssets
-        canSave="true"
-        canSaveDynamicFields="true"
-        AssetType="ComponentAsset"
-        Recurse="true" />
-    <AutoloadAssets
-        canSave="true"
-        canSaveDynamicFields="true"
-        AssetType="GUIAsset"
-        Recurse="true" />
-</ModuleDefinition>

+ 0 - 9
Templates/BaseGame/game/data/Kork/Shapes/OrcMage.asset.taml

@@ -1,9 +0,0 @@
-<ShapeAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="OrcMage"
-    fileName="@assetFile=OrcMage.dts"
-    isNewShape="1"
-    materialSlot0="@Asset=Kork:player_mat"
-    originalFilePath="E:/Gamedev/Art/TorqueCharacters/OrcMage/OrcMage.dts"
-    VersionId="1" />

+ 0 - 5
Templates/BaseGame/game/data/Kork/Shapes/OrcMage.cs

@@ -1,5 +0,0 @@
-
-singleton TSShapeConstructor(OrcMageDts)
-{
-   baseShape = "./OrcMage.dts";
-};

BIN
Templates/BaseGame/game/data/Kork/Shapes/OrcMage.dts


+ 0 - 9
Templates/BaseGame/game/data/Kork/materials/player_mat.asset.taml

@@ -1,9 +0,0 @@
-<MaterialAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="player_mat"
-    scriptFile="@assetFile=player_mat.cs"
-    materialDefinitionName="player_mat"
-    imageMap0="@Asset=Kork:player_Albedo"
-    shaderGraph="data/Kork/materials/player.sgf"
-    VersionId="1" />

+ 0 - 6
Templates/BaseGame/game/data/Kork/materials/player_mat.cs

@@ -1,6 +0,0 @@
-//--- OBJECT WRITE BEGIN ---
-singleton Material(player_mat) {
-   mapTo = "player";
-   DiffuseMapAsset[0] = "Kork:player_Albedo";
-};
-//--- OBJECT WRITE END ---

+ 0 - 9
Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_BaseColor.asset.taml

@@ -1,9 +0,0 @@
-<ImageAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="Orc_Material_BaseColor"
-    imageFile="@assetFile=Orc_Material_BaseColor.png"
-    useMips="true"
-    isHDRImage="false"
-    originalFilePath="E:/Gamedev/Art/SpaceOrcMage/Orc_Material_BaseColor.png"
-    VersionId="1" />

BIN
Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_BaseColor.png


BIN
Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_Metallic.png


+ 0 - 9
Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_Metallic.taml

@@ -1,9 +0,0 @@
-<ImageAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="Orc_Material_Metallic"
-    imageFile="@assetFile=Orc_Material_Metallic.png"
-    useMips="true"
-    isHDRImage="false"
-    originalFilePath="E:/Gamedev/Art/SpaceOrcMage/Orc_Material_Metallic.png"
-    VersionId="1" />

BIN
Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_Roughness.png


+ 0 - 9
Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_Roughness.taml

@@ -1,9 +0,0 @@
-<ImageAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="Orc_Material_Roughness"
-    imageFile="@assetFile=Orc_Material_Roughness.png"
-    useMips="true"
-    isHDRImage="false"
-    originalFilePath="E:/Gamedev/Art/SpaceOrcMage/Orc_Material_Roughness.png"
-    VersionId="1" />

BIN
Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_normal.png


+ 0 - 9
Templates/BaseGame/game/data/SpaceOrc/Images/Orc_Material_normal.taml

@@ -1,9 +0,0 @@
-<ImageAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="Orc_Material_normal"
-    imageFile="@assetFile=Orc_Material_normal.png"
-    useMips="true"
-    isHDRImage="false"
-    originalFilePath="E:/Gamedev/Art/SpaceOrcMage/Orc_Material_normal.png"
-    VersionId="1" />

+ 0 - 9
Templates/BaseGame/game/data/SpaceOrc/Shapes/SpaceOrcMage.asset.taml

@@ -1,9 +0,0 @@
-<ShapeAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="SpaceOrcMage"
-    fileName="@assetFile=SpaceOrcMage.dts"
-    isNewShape="1"
-    materialSlot0="@Asset=SpaceOrc:Orc_Material"
-    originalFilePath="E:/Gamedev/Art/SpaceOrcMage/SpaceOrcMage.dts"
-    VersionId="1" />

+ 0 - 5
Templates/BaseGame/game/data/SpaceOrc/Shapes/SpaceOrcMage.cs

@@ -1,5 +0,0 @@
-
-singleton TSShapeConstructor(SpaceOrcMageDts)
-{
-   baseShape = "./SpaceOrcMage.dts";
-};

BIN
Templates/BaseGame/game/data/SpaceOrc/Shapes/SpaceOrcMage.dts


+ 0 - 19
Templates/BaseGame/game/data/SpaceOrc/SpaceOrc.cs

@@ -1,19 +0,0 @@
-function SpaceOrc::onCreate(%this)
-{
-}
-
-function SpaceOrc::onDestroy(%this)
-{
-}
-
-function SpaceOrc::initServer(%this){}
-
-function SpaceOrc::onCreateGameServer(%this){}
-
-function SpaceOrc::onDestroyGameServer(%this){}
-
-function SpaceOrc::initClient(%this){}
-
-function SpaceOrc::onCreateClientConnection(%this){}
-
-function SpaceOrc::onDestroyClientConnection(%this){}

+ 0 - 25
Templates/BaseGame/game/data/SpaceOrc/SpaceOrc.module

@@ -1,25 +0,0 @@
-<ModuleDefinition
-    canSave="true"
-    canSaveDynamicFields="true"
-    ModuleId="SpaceOrc"
-    VersionId="1"
-    Group="Game"
-    scriptFile="SpaceOrc.cs"
-    CreateFunction="onCreate"
-    DestroyFunction="onDestroy">
-    <DeclaredAssets
-        canSave="true"
-        canSaveDynamicFields="true"
-        Extension="asset.taml"
-        Recurse="true" />
-    <AutoloadAssets
-        canSave="true"
-        canSaveDynamicFields="true"
-        AssetType="ComponentAsset"
-        Recurse="true" />
-    <AutoloadAssets
-        canSave="true"
-        canSaveDynamicFields="true"
-        AssetType="GUIAsset"
-        Recurse="true" />
-</ModuleDefinition>

+ 0 - 9
Templates/BaseGame/game/data/SpaceOrc/materials/Orc_Material.asset.taml

@@ -1,9 +0,0 @@
-<MaterialAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="Orc_Material"
-    scriptFile="@assetFile=Orc_Material.cs"
-    materialDefinitionName="Orc_Material"
-    imageMap0="@Asset=SpaceOrc:Orc_Material_BaseColor"
-    shaderGraph="data/SpaceOrc/materials/Orc_Material.sgf"
-    VersionId="1" />

+ 0 - 12
Templates/BaseGame/game/data/SpaceOrc/materials/Orc_Material.cs

@@ -1,12 +0,0 @@
-//--- OBJECT WRITE BEGIN ---
-singleton Material(Orc_Material) {
-   mapTo = "Orc_Material";
-   DiffuseMapAsset[0] = "SpaceOrc:Orc_Material_BaseColor";
-   diffuseMap[0] = "data/SpaceOrc/Images/Orc_Material_BaseColor.png";
-   normalMap[0] = "data/SpaceOrc/Images/Orc_Material_normal.png";
-   invertSmoothness[0] = "1";
-   roughMap[0] = "data/SpaceOrc/Images/Orc_Material_Roughness.png";
-   metalMap[0] = "data/SpaceOrc/Images/Orc_Material_Metallic.png";
-   DiffuseMapAsset0 = "SpaceOrc:Orc_Material_BaseColor";
-};
-//--- OBJECT WRITE END ---

BIN
Templates/BaseGame/game/data/StaticShapeTest/Images/Grid_512_orange.png


+ 0 - 9
Templates/BaseGame/game/data/StaticShapeTest/Images/Grid_512_orange_ALBEDO.asset.taml

@@ -1,9 +0,0 @@
-<ImageAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="Grid_512_orange_ALBEDO"
-    imageFile="@assetFile=Grid_512_orange.png"
-    useMips="true"
-    isHDRImage="false"
-    originalFilePath="E:/Gamedev/T3DMIT/clangtest/Templates/Full/game/core/art/grids/Grid_512_orange.png"
-    VersionId="1" />

+ 0 - 9
Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cube.asset.taml

@@ -1,9 +0,0 @@
-<ShapeAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="Cube"
-    fileName="@assetFile=Cube.fbx"
-    isNewShape="1"
-    materialSlot0="@Asset=StaticShapeTest:Grid_512_orange"
-    originalFilePath="E:/Gamedev/T3DMIT/clangtest/My Projects/T3DPreview4_0/art/StarterContent/Cube.fbx"
-    VersionId="1" />

+ 0 - 5
Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cube.cs

@@ -1,5 +0,0 @@
-
-singleton TSShapeConstructor(CubeFbx)
-{
-   baseShape = "./Cube.fbx";
-};

BIN
Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cube.fbx


+ 0 - 8
Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cylinder.asset.taml

@@ -1,8 +0,0 @@
-<ShapeAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="Cylinder"
-    fileName="@assetFile=Cylinder.fbx"
-    isNewShape="1"
-    originalFilePath="E:/Gamedev/T3DMIT/clangtest/My Projects/T3DPreview4_0/art/StarterContent/Cylinder.fbx"
-    VersionId="1" />

+ 0 - 5
Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cylinder.cs

@@ -1,5 +0,0 @@
-
-singleton TSShapeConstructor(CylinderFbx)
-{
-   baseShape = "./Cylinder.fbx";
-};

BIN
Templates/BaseGame/game/data/StaticShapeTest/Shapes/Cylinder.fbx


+ 0 - 21
Templates/BaseGame/game/data/StaticShapeTest/Shapes/materials.cs

@@ -1,21 +0,0 @@
-
-singleton Material(Grid_512_Orange)
-{
-   mapTo = "Grid_512_orange";
-   diffuseColor[0] = "0.8 0.8 0.8 1";
-   diffuseMap[0] = "tools/base/images/512_orange.png";
-   specular[0] = "0.8 0.8 0.8 1";
-   specularPower[0] = "0.25";
-   specularStrength[0] = "25";
-   translucentBlendOp = "LerpAlpha";
-   smoothness[0] = "1";
-   metalness[0] = "1";
-   DiffuseMapAsset0 = "StaticShapeTest:Grid_512_orange_ALBEDO";
-   specularStrength0 = "25";
-   specular0 = "0.8 0.8 0.8 1";
-   specularPower0 = "0.25";
-   emissive[0] = "0";
-   translucent = "1";
-   normalMap[0] = "data/pbr/images/FloorEbony_normal.png";
-   invertSmoothness[0] = "1";
-};

+ 0 - 19
Templates/BaseGame/game/data/StaticShapeTest/StaticShapeTest.cs

@@ -1,19 +0,0 @@
-function StaticShapeTest::onCreate(%this)
-{
-}
-
-function StaticShapeTest::onDestroy(%this)
-{
-}
-
-function StaticShapeTest::initServer(%this){}
-
-function StaticShapeTest::onCreateGameServer(%this){}
-
-function StaticShapeTest::onDestroyGameServer(%this){}
-
-function StaticShapeTest::initClient(%this){}
-
-function StaticShapeTest::onCreateClientConnection(%this){}
-
-function StaticShapeTest::onDestroyClientConnection(%this){}

+ 0 - 25
Templates/BaseGame/game/data/StaticShapeTest/StaticShapeTest.module

@@ -1,25 +0,0 @@
-<ModuleDefinition
-    canSave="true"
-    canSaveDynamicFields="true"
-    ModuleId="StaticShapeTest"
-    VersionId="1"
-    Group="Game"
-    scriptFile="StaticShapeTest.cs"
-    CreateFunction="onCreate"
-    DestroyFunction="onDestroy">
-    <DeclaredAssets
-        canSave="true"
-        canSaveDynamicFields="true"
-        Extension="asset.taml"
-        Recurse="true" />
-    <AutoloadAssets
-        canSave="true"
-        canSaveDynamicFields="true"
-        AssetType="ComponentAsset"
-        Recurse="true" />
-    <AutoloadAssets
-        canSave="true"
-        canSaveDynamicFields="true"
-        AssetType="GUIAsset"
-        Recurse="true" />
-</ModuleDefinition>

+ 0 - 9
Templates/BaseGame/game/data/StaticShapeTest/materials/Grid_512_orange.asset.taml

@@ -1,9 +0,0 @@
-<MaterialAsset
-    canSave="true"
-    canSaveDynamicFields="true"
-    AssetName="Grid_512_Orange"
-    scriptFile="@assetFile=data/StaticShapeTest/materials/Grid_512_orange.cs"
-    materialDefinitionName="Grid_512_Orange"
-    originalFilePath="E:/Gamedev/T3DMIT/clangtest/Templates/Full/game/core/art/grids/Grid_512_orange.png"
-    shaderGraph="data/StaticShapeTest/materials/Grid_512_orange.sgf"
-    VersionId="1" />

+ 0 - 7
Templates/BaseGame/game/data/StaticShapeTest/materials/Grid_512_orange.cs

@@ -1,7 +0,0 @@
-//--- OBJECT WRITE BEGIN ---
-singleton Material(Grid_512_orange) {
-   mapTo = "Grid_512_orange";
-   DiffuseMap[0] = "data/StaticShapeTest/Images/Grid_512_orange.png";
-   DiffuseMapAsset[0] = "StaticShapeTest:Grid_512_orange_ALBEDO";
-};
-//--- OBJECT WRITE END ---

+ 2 - 0
Templates/BaseGame/game/data/shaderCache/.gitignore

@@ -0,0 +1,2 @@
+*.hlsl
+*.glsl

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff