2
0
Эх сурвалжийг харах

shifts glowmap out of the composite and to it's own texture, as well as featureset. (GL port pending design finalization)

AzaezelX 6 жил өмнө
parent
commit
d034895e8f

+ 72 - 34
Engine/source/lighting/advanced/hlsl/deferredShadingFeaturesHLSL.cpp

@@ -37,7 +37,7 @@
 //****************************************************************************
 //****************************************************************************
 U32 PBRConfigMapHLSL::getOutputTargets(const MaterialFeatureData& fd) const
 U32 PBRConfigMapHLSL::getOutputTargets(const MaterialFeatureData& fd) const
 {
 {
-   return fd.features[MFT_isDeferred] ? ShaderFeature::RenderTarget3 : ShaderFeature::DefaultTarget;
+   return fd.features[MFT_isDeferred] ? ShaderFeature::RenderTarget2 : ShaderFeature::DefaultTarget;
 }
 }
 
 
 void PBRConfigMapHLSL::processPix( Vector<ShaderComponent*> &componentList, const MaterialFeatureData &fd )
 void PBRConfigMapHLSL::processPix( Vector<ShaderComponent*> &componentList, const MaterialFeatureData &fd )
@@ -104,24 +104,6 @@ void PBRConfigMapHLSL::processPix( Vector<ShaderComponent*> &componentList, cons
    meta->addStatement(new GenOp("   @ = @.g;\r\n", new DecOp(ao), pbrConfig));
    meta->addStatement(new GenOp("   @ = @.g;\r\n", new DecOp(ao), pbrConfig));
    meta->addStatement(new GenOp("   @ = @.a;\r\n", new DecOp(metalness), pbrConfig));
    meta->addStatement(new GenOp("   @ = @.a;\r\n", new DecOp(metalness), pbrConfig));
 
 
-   if (fd.features[MFT_GlowMap])
-   {
-      Var* glowMul = new Var("glowMul", "float");
-      glowMul->uniform = true;
-      glowMul->constSortPos = cspPotentialPrimitive;
-
-      ShaderFeature::OutputTarget inTarg = ShaderFeature::DefaultTarget;
-      ShaderFeature::OutputTarget outTarg = ShaderFeature::DefaultTarget;
-      if (fd.features[MFT_isDeferred])
-      {
-         inTarg = ShaderFeature::RenderTarget1;
-         outTarg = ShaderFeature::RenderTarget3;
-      }
-      Var* diffuseColor = (Var*)LangElement::find(getOutputTargetVarName(inTarg));
-      Var* emissionColor = (Var*)LangElement::find(getOutputTargetVarName(outTarg));
-
-      meta->addStatement(new GenOp("   @.rgb += @.rgb*float3(@,@,@)*@.aaa;\r\n", emissionColor, diffuseColor, glowMul, glowMul, glowMul, texOp));
-   }
    output = meta;
    output = meta;
 }
 }
 
 
@@ -241,24 +223,80 @@ void PBRConfigVarsHLSL::processPix( Vector<ShaderComponent*> &componentList, con
    output = meta;
    output = meta;
 }
 }
 
 
+U32 GlowMapHLSL::getOutputTargets(const MaterialFeatureData& fd) const
+{
+   return fd.features[MFT_isDeferred] ? ShaderFeature::RenderTarget3 : ShaderFeature::DefaultTarget;
+}
+
 //deferred emissive
 //deferred emissive
-void DeferredEmissiveHLSL::processPix(Vector<ShaderComponent*> &componentList, const MaterialFeatureData &fd)
+void GlowMapHLSL::processPix(Vector<ShaderComponent*> &componentList, const MaterialFeatureData &fd)
 {
 {
-   //for now emission just uses the diffuse color, we could plug in a separate texture for emission at some stage
-   Var *diffuseTargetVar = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::RenderTarget1));
-   if (!diffuseTargetVar)
-      return; //oh dear something is not right, maybe we should just write 0's instead
-
-   // search for scene color target var
-   Var *sceneColorVar = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::RenderTarget3));
-   if (!sceneColorVar)
+   Var* texCoord = getInTexCoord("texCoord", "float2", componentList);
+
+   // create texture var
+   Var* glowMap = new Var;
+   glowMap->setType("SamplerState");
+   glowMap->setName("glowMap");
+   glowMap->uniform = true;
+   glowMap->sampler = true;
+   glowMap->constNum = Var::getTexUnitNum();
+
+   Var* glowMapTex = new Var;
+   glowMapTex->setName("glowMapTex");
+   glowMapTex->setType("Texture2D");
+   glowMapTex->uniform = true;
+   glowMapTex->texture = true;
+   glowMapTex->constNum = glowMap->constNum;
+   LangElement* texOp = new GenOp("@.Sample(@, @)", glowMapTex, glowMap, texCoord);
+
+   Var* glowMul = new Var("glowMul", "float");
+   glowMul->uniform = true;
+   glowMul->constSortPos = cspPotentialPrimitive;
+
+   Var *targ = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
+   if (fd.features[MFT_isDeferred])
    {
    {
-      // create scene color target var
-      sceneColorVar = new Var;
-      sceneColorVar->setType("fragout");
-      sceneColorVar->setName(getOutputTargetVarName(ShaderFeature::RenderTarget3));
-      sceneColorVar->setStructName("OUT");
+      targ = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::RenderTarget3));
+      if (!targ)
+      {
+         // create scene color target var
+         targ = new Var;
+         targ->setType("fragout");
+         targ->setName(getOutputTargetVarName(ShaderFeature::RenderTarget3));
+         targ->setStructName("OUT");
+         output = new GenOp("@ = float4(@.rgb*@,0);", targ, texOp, glowMul);
+      }
+      else
+      {
+         output = new GenOp("@ += float4(@.rgb*@,0);", targ, texOp, glowMul);
+      }
    }
    }
+   else
+   {
+      output = new GenOp("@ += float4(@.rgb*@,@.a);", targ, texOp, glowMul, targ);
+   }
+
+}
+
+ShaderFeature::Resources GlowMapHLSL::getResources(const MaterialFeatureData& fd)
+{
+   Resources res;
+   res.numTex = 1;
+   res.numTexReg = 1;
 
 
-   output = new GenOp("@ = float4(@.rgb,0);", sceneColorVar, diffuseTargetVar);
+   return res;
+}
+
+void GlowMapHLSL::setTexData(Material::StageData& stageDat,
+   const MaterialFeatureData& fd,
+   RenderPassData& passData,
+   U32& texIndex)
+{
+   GFXTextureObject* tex = stageDat.getTex(MFT_GlowMap);
+   if (tex)
+   {
+      passData.mTexType[texIndex] = Material::Standard;
+      passData.mSamplerNames[texIndex] = "glowMap";
+      passData.mTexSlot[texIndex++].texObject = tex;
+   }
 }
 }

+ 11 - 3
Engine/source/lighting/advanced/hlsl/deferredShadingFeaturesHLSL.h

@@ -70,15 +70,23 @@ public:
       const MaterialFeatureData &fd );
       const MaterialFeatureData &fd );
 };
 };
 
 
-class DeferredEmissiveHLSL : public ShaderFeatureHLSL
+class GlowMapHLSL : public ShaderFeatureHLSL
 {
 {
 public:
 public:
-   virtual String getName() { return "Deferred Shading: Emissive"; }
+   virtual String getName() { return "Glow Map"; }
 
 
    virtual void processPix(Vector<ShaderComponent*> &componentList,
    virtual void processPix(Vector<ShaderComponent*> &componentList,
       const MaterialFeatureData &fd);
       const MaterialFeatureData &fd);
 
 
-   virtual U32 getOutputTargets(const MaterialFeatureData &fd) const { return ShaderFeature::RenderTarget3; }
+   virtual U32 getOutputTargets(const MaterialFeatureData& fd) const;
+
+   virtual Resources getResources(const MaterialFeatureData& fd);
+
+   // Sets textures and texture flags for current pass
+   virtual void setTexData(Material::StageData& stageDat,
+      const MaterialFeatureData& fd,
+      RenderPassData& passData,
+      U32& texIndex);
 };
 };
 
 
 #endif
 #endif

+ 1 - 3
Engine/source/materials/materialDefinition.cpp

@@ -128,7 +128,7 @@ Material::Material()
       mSmoothnessChan[i] = 0;
       mSmoothnessChan[i] = 0;
       mAOChan[i] = 1;
       mAOChan[i] = 1;
       mMetalChan[i] = 2;
       mMetalChan[i] = 2;
-      mGlowChan[i] = 3;
+
       mAccuEnabled[i]   = false;
       mAccuEnabled[i]   = false;
       mAccuScale[i]     = 1.0f;
       mAccuScale[i]     = 1.0f;
       mAccuDirection[i] = 1.0f;
       mAccuDirection[i] = 1.0f;
@@ -325,8 +325,6 @@ void Material::initPersistFields()
 
 
       addField("glowMap", TypeImageFilename, Offset(mGlowMapFilename, Material), MAX_STAGES,
       addField("glowMap", TypeImageFilename, Offset(mGlowMapFilename, Material), MAX_STAGES,
          "Metalness map. will be packed into the B channel of a packed 'specular' map");
          "Metalness map. will be packed into the B channel of a packed 'specular' map");
-      addField("glowChan", TypeF32, Offset(mGlowChan, Material), MAX_STAGES,
-         "The input channel metalness maps use.");
       addField("glowMul", TypeF32, Offset(mGlowMul, Material), MAX_STAGES,
       addField("glowMul", TypeF32, Offset(mGlowMul, Material), MAX_STAGES,
          "The input channel metalness maps use.");
          "The input channel metalness maps use.");
       addField("glow", TypeBool, Offset(mGlow, Material), MAX_STAGES,
       addField("glow", TypeBool, Offset(mGlow, Material), MAX_STAGES,

+ 0 - 1
Engine/source/materials/materialDefinition.h

@@ -256,7 +256,6 @@ public:
    FileName mGlowMapFilename[MAX_STAGES];
    FileName mGlowMapFilename[MAX_STAGES];
    StringTableEntry mGlowMapAssetId[MAX_STAGES];
    StringTableEntry mGlowMapAssetId[MAX_STAGES];
    AssetPtr<ImageAsset> mGlowMapAsset[MAX_STAGES];
    AssetPtr<ImageAsset> mGlowMapAsset[MAX_STAGES];
-   F32      mGlowChan[MAX_STAGES];
    F32      mGlowMul[MAX_STAGES];
    F32      mGlowMul[MAX_STAGES];
    /// A second normal map which repeats at the detail map
    /// A second normal map which repeats at the detail map
    /// scale and blended with the base normal map.
    /// scale and blended with the base normal map.

+ 4 - 6
Engine/source/materials/materialFeatureTypes.cpp

@@ -47,7 +47,6 @@ ImplementFeatureType( MFT_InvertSmoothness, U32(-1), -1, true);
 ImplementFeatureType( MFT_PBRConfigMap, MFG_Texture, 8.0f, true);
 ImplementFeatureType( MFT_PBRConfigMap, MFG_Texture, 8.0f, true);
 ImplementFeatureType( MFT_PBRConfigVars, MFG_Texture, 8.0f, true);
 ImplementFeatureType( MFT_PBRConfigVars, MFG_Texture, 8.0f, true);
 ImplementFeatureType( MFT_MatInfoFlags, MFG_Texture, 9.0f, true);
 ImplementFeatureType( MFT_MatInfoFlags, MFG_Texture, 9.0f, true);
-ImplementFeatureType( MFT_GlowMap, MFG_Texture, 10.0f, true );
 ImplementFeatureType( MFT_NormalMap, MFG_Texture, 11.0f, true );
 ImplementFeatureType( MFT_NormalMap, MFG_Texture, 11.0f, true );
 ImplementFeatureType( MFT_DetailNormalMap, MFG_Texture, 12.0f, true );
 ImplementFeatureType( MFT_DetailNormalMap, MFG_Texture, 12.0f, true );
 ImplementFeatureType( MFT_Imposter, U32(-1), -1, true );
 ImplementFeatureType( MFT_Imposter, U32(-1), -1, true );
@@ -56,9 +55,10 @@ ImplementFeatureType( MFT_AccuMap, MFG_PreLighting, 2.0f, true );
 
 
 ImplementFeatureType(MFT_ReflectionProbes, MFG_Lighting, 1.0f, true);
 ImplementFeatureType(MFT_ReflectionProbes, MFG_Lighting, 1.0f, true);
 ImplementFeatureType( MFT_RTLighting, MFG_Lighting, 2.0f, true );
 ImplementFeatureType( MFT_RTLighting, MFG_Lighting, 2.0f, true );
-ImplementFeatureType( MFT_LightMap, MFG_Lighting, 3.0f, true );
-ImplementFeatureType( MFT_ToneMap, MFG_Lighting, 4.0f, true );
-ImplementFeatureType( MFT_VertLitTone, MFG_Lighting, 5.0f, false );
+ImplementFeatureType( MFT_GlowMap, MFG_Lighting, 3.0f, true );
+ImplementFeatureType( MFT_LightMap, MFG_Lighting, 4.0f, true );
+ImplementFeatureType( MFT_ToneMap, MFG_Lighting, 5.0f, true );
+ImplementFeatureType( MFT_VertLitTone, MFG_Lighting, 6.0f, false );
 ImplementFeatureType( MFT_StaticCubemap, U32(-1), -1.0, true );
 ImplementFeatureType( MFT_StaticCubemap, U32(-1), -1.0, true );
 ImplementFeatureType( MFT_CubeMap, MFG_Lighting, 7.0f, true );
 ImplementFeatureType( MFT_CubeMap, MFG_Lighting, 7.0f, true );
 ImplementFeatureType( MFT_SubSurface, MFG_Lighting, 8.0f, true );
 ImplementFeatureType( MFT_SubSurface, MFG_Lighting, 8.0f, true );
@@ -104,7 +104,5 @@ ImplementFeatureType( MFT_ImposterVert, MFG_PreTransform, 1.0, false );
 // Deferred Shading
 // Deferred Shading
 ImplementFeatureType( MFT_isDeferred, U32(-1), -1, true );
 ImplementFeatureType( MFT_isDeferred, U32(-1), -1, true );
 ImplementFeatureType( MFT_SkyBox, MFG_Transform, 1.0f, false );
 ImplementFeatureType( MFT_SkyBox, MFG_Transform, 1.0f, false );
-ImplementFeatureType( MFT_DeferredEmissive, MFG_Texture, 8.9f, false);
-
 ImplementFeatureType( MFT_HardwareSkinning, MFG_Transform,-2.0, false );
 ImplementFeatureType( MFT_HardwareSkinning, MFG_Transform,-2.0, false );
 
 

+ 0 - 1
Engine/source/materials/materialFeatureTypes.h

@@ -192,5 +192,4 @@ DeclareFeatureType( MFT_HardwareSkinning );
 DeclareFeatureType( MFT_isDeferred );
 DeclareFeatureType( MFT_isDeferred );
 DeclareFeatureType( MFT_SkyBox );
 DeclareFeatureType( MFT_SkyBox );
 DeclareFeatureType( MFT_MatInfoFlags );
 DeclareFeatureType( MFT_MatInfoFlags );
-DeclareFeatureType( MFT_DeferredEmissive );
 #endif // _MATERIALFEATURETYPES_H_
 #endif // _MATERIALFEATURETYPES_H_

+ 8 - 2
Engine/source/materials/processedMaterial.cpp

@@ -487,14 +487,20 @@ void ProcessedMaterial::_setStageData()
             inputKey[0] = mMaterial->mSmoothnessChan[i];
             inputKey[0] = mMaterial->mSmoothnessChan[i];
             inputKey[1] = mMaterial->mAOChan[i];
             inputKey[1] = mMaterial->mAOChan[i];
             inputKey[2] = mMaterial->mMetalChan[i];
             inputKey[2] = mMaterial->mMetalChan[i];
-            inputKey[3] = mMaterial->mGlowChan[i];
+            inputKey[3] = 0;
             mStages[i].setTex(MFT_PBRConfigMap, _createCompositeTexture(mMaterial->mRoughMapFilename[i], mMaterial->mAOMapFilename[i],
             mStages[i].setTex(MFT_PBRConfigMap, _createCompositeTexture(mMaterial->mRoughMapFilename[i], mMaterial->mAOMapFilename[i],
-               mMaterial->mMetalMapFilename[i], mMaterial->mGlowMapFilename[i],
+               mMaterial->mMetalMapFilename[i], "",
                inputKey, profile));
                inputKey, profile));
             if (!mStages[i].getTex(MFT_PBRConfigMap))
             if (!mStages[i].getTex(MFT_PBRConfigMap))
                mMaterial->logError("Failed to load PBR Config map %s for stage %i", _getTexturePath(mMaterial->mPBRConfigMapFilename[i]).c_str(), i);
                mMaterial->logError("Failed to load PBR Config map %s for stage %i", _getTexturePath(mMaterial->mPBRConfigMapFilename[i]).c_str(), i);
          }
          }
       }
       }
+      if (mMaterial->mGlowMapFilename[i].isNotEmpty())
+      {
+         mStages[i].setTex(MFT_GlowMap, _createTexture(mMaterial->mGlowMapFilename[i], &GFXStaticTextureProfile));
+         if (!mStages[i].getTex(MFT_GlowMap))
+            mMaterial->logError("Failed to load glow map %s for stage %i", _getTexturePath(mMaterial->mGlowMapFilename[i]).c_str(), i);
+      }
    }
    }
 
 
    mMaterial->mCubemapData = dynamic_cast<CubemapData*>(Sim::findObject(mMaterial->mCubemapName));
    mMaterial->mCubemapData = dynamic_cast<CubemapData*>(Sim::findObject(mMaterial->mCubemapName));

+ 0 - 2
Engine/source/materials/processedShaderMaterial.cpp

@@ -437,8 +437,6 @@ void ProcessedShaderMaterial::_determineFeatures(  U32 stageNum,
    if (mStages[stageNum].getTex(MFT_PBRConfigMap))
    if (mStages[stageNum].getTex(MFT_PBRConfigMap))
    {
    {
       fd.features.addFeature(MFT_PBRConfigMap);
       fd.features.addFeature(MFT_PBRConfigMap);
-      if (mStages[stageNum].getTex(MFT_PBRConfigMap)->mHasTransparency)
-         fd.features.addFeature(MFT_GlowMap);
    }
    }
    else
    else
       fd.features.addFeature(MFT_PBRConfigVars);
       fd.features.addFeature(MFT_PBRConfigVars);

+ 6 - 3
Engine/source/renderInstance/renderDeferredMgr.cpp

@@ -644,6 +644,11 @@ void ProcessedDeferredMaterial::_determineFeatures( U32 stageNum,
    else
    else
        newFeatures.addFeature( MFT_PBRConfigVars );
        newFeatures.addFeature( MFT_PBRConfigVars );
 
 
+   if (mStages[stageNum].getTex(MFT_GlowMap))
+   {
+      newFeatures.addFeature(MFT_GlowMap);
+   }
+
    // Deferred Shading : Material Info Flags
    // Deferred Shading : Material Info Flags
    newFeatures.addFeature( MFT_MatInfoFlags );
    newFeatures.addFeature( MFT_MatInfoFlags );
 
 
@@ -743,9 +748,7 @@ void ProcessedDeferredMaterial::_determineFeatures( U32 stageNum,
       else
       else
       {
       {
          // If this object isn't lightmapped or emissive, add a zero-output feature for render target 3
          // If this object isn't lightmapped or emissive, add a zero-output feature for render target 3
-         if (fd.features.hasFeature(MFT_IsEmissive))
-            newFeatures.addFeature(MFT_DeferredEmissive);
-         else
+         if (!fd.features.hasFeature(MFT_IsEmissive)&&(!fd.features.hasFeature(MFT_GlowMap)))
             newFeatures.addFeature( MFT_RenderTarget3_Zero );
             newFeatures.addFeature( MFT_RenderTarget3_Zero );
       }
       }
    }
    }

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

@@ -66,7 +66,6 @@ void _initShaderGenGLSL( ShaderGen *shaderGen )
    FEATUREMGR->registerFeature( MFT_CubeMap, new ReflectCubeFeatGLSL );
    FEATUREMGR->registerFeature( MFT_CubeMap, new ReflectCubeFeatGLSL );
    FEATUREMGR->registerFeature( MFT_InvertSmoothness, new NamedFeatureGLSL("Roughest = 1.0"));
    FEATUREMGR->registerFeature( MFT_InvertSmoothness, new NamedFeatureGLSL("Roughest = 1.0"));
    FEATUREMGR->registerFeature( MFT_AccuMap, new AccuTexFeatGLSL );
    FEATUREMGR->registerFeature( MFT_AccuMap, new AccuTexFeatGLSL );
-   FEATUREMGR->registerFeature( MFT_GlowMap, new NamedFeatureGLSL( "Glow Map" ) );
    FEATUREMGR->registerFeature( MFT_IsTranslucent, new NamedFeatureGLSL( "Translucent" ) );
    FEATUREMGR->registerFeature( MFT_IsTranslucent, new NamedFeatureGLSL( "Translucent" ) );
    FEATUREMGR->registerFeature( MFT_IsTranslucentZWrite, new NamedFeatureGLSL( "Translucent ZWrite" ) );
    FEATUREMGR->registerFeature( MFT_IsTranslucentZWrite, new NamedFeatureGLSL( "Translucent ZWrite" ) );
    FEATUREMGR->registerFeature( MFT_Visibility, new VisibilityFeatGLSL );
    FEATUREMGR->registerFeature( MFT_Visibility, new VisibilityFeatGLSL );

+ 1 - 2
Engine/source/shaderGen/HLSL/shaderGenHLSLInit.cpp

@@ -70,7 +70,6 @@ void _initShaderGenHLSL( ShaderGen *shaderGen )
    FEATUREMGR->registerFeature( MFT_Visibility, new VisibilityFeatHLSL );
    FEATUREMGR->registerFeature( MFT_Visibility, new VisibilityFeatHLSL );
    FEATUREMGR->registerFeature( MFT_Fog, new FogFeatHLSL );
    FEATUREMGR->registerFeature( MFT_Fog, new FogFeatHLSL );
    FEATUREMGR->registerFeature( MFT_AccuMap, new AccuTexFeatHLSL );
    FEATUREMGR->registerFeature( MFT_AccuMap, new AccuTexFeatHLSL );
-   FEATUREMGR->registerFeature( MFT_GlowMap, new NamedFeatureHLSL( "Glow Map" ) );
    FEATUREMGR->registerFeature( MFT_LightbufferMRT, new NamedFeatureHLSL( "Lightbuffer MRT" ) );
    FEATUREMGR->registerFeature( MFT_LightbufferMRT, new NamedFeatureHLSL( "Lightbuffer MRT" ) );
    FEATUREMGR->registerFeature( MFT_RenderTarget1_Zero, new RenderTargetZeroHLSL( ShaderFeature::RenderTarget1 ) );
    FEATUREMGR->registerFeature( MFT_RenderTarget1_Zero, new RenderTargetZeroHLSL( ShaderFeature::RenderTarget1 ) );
    FEATUREMGR->registerFeature( MFT_RenderTarget2_Zero, new RenderTargetZeroHLSL( ShaderFeature::RenderTarget2 ) );
    FEATUREMGR->registerFeature( MFT_RenderTarget2_Zero, new RenderTargetZeroHLSL( ShaderFeature::RenderTarget2 ) );
@@ -105,7 +104,7 @@ void _initShaderGenHLSL( ShaderGen *shaderGen )
    FEATUREMGR->registerFeature( MFT_PBRConfigMap, new PBRConfigMapHLSL);
    FEATUREMGR->registerFeature( MFT_PBRConfigMap, new PBRConfigMapHLSL);
    FEATUREMGR->registerFeature( MFT_PBRConfigVars, new PBRConfigVarsHLSL);
    FEATUREMGR->registerFeature( MFT_PBRConfigVars, new PBRConfigVarsHLSL);
    FEATUREMGR->registerFeature( MFT_MatInfoFlags, new MatInfoFlagsHLSL );
    FEATUREMGR->registerFeature( MFT_MatInfoFlags, new MatInfoFlagsHLSL );
-   FEATUREMGR->registerFeature( MFT_DeferredEmissive, new DeferredEmissiveHLSL);
+   FEATUREMGR->registerFeature( MFT_GlowMap, new GlowMapHLSL);
    FEATUREMGR->registerFeature( MFT_SkyBox,  new NamedFeatureHLSL( "skybox" ) );
    FEATUREMGR->registerFeature( MFT_SkyBox,  new NamedFeatureHLSL( "skybox" ) );
    FEATUREMGR->registerFeature( MFT_HardwareSkinning, new HardwareSkinningFeatureHLSL );
    FEATUREMGR->registerFeature( MFT_HardwareSkinning, new HardwareSkinningFeatureHLSL );
 }
 }

+ 77 - 140
Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui

@@ -571,7 +571,7 @@
                         profile = "ToolsGuiTransparentProfile";
                         profile = "ToolsGuiTransparentProfile";
                         isContainer = "1";
                         isContainer = "1";
                         position = "0 0";
                         position = "0 0";
-                        Extent = "185 68";
+                        Extent = "185 50";
                         HorizSizing = "width";
                         HorizSizing = "width";
 						
 						
                         new GuiTextCtrl() {
                         new GuiTextCtrl() {
@@ -592,15 +592,6 @@
                            Profile = "ToolsGuiTextProfile";
                            Profile = "ToolsGuiTextProfile";
                         };
                         };
                         
                         
-                        new GuiTextCtrl() {
-                           HorizSizing = "right";
-                           VertSizing = "bottom";
-                           position = "9 48";
-                           Extent = "72 16";
-                           text = "GlowMul";
-                           Profile = "ToolsGuiTextProfile";
-                        };
-
                         new GuiControl() {
                         new GuiControl() {
                            class = "AggregateControl";
                            class = "AggregateControl";
                            position = "91 4";
                            position = "91 4";
@@ -700,55 +691,6 @@
                               text = "0";
                               text = "0";
                            };
                            };
                         };
                         };
-                        new GuiControl() {
-                           class = "AggregateControl";
-                           position = "91 48";
-                           Extent = "96 20";
-                           
-                           new GuiSliderCtrl() {
-                              canSaveDynamicFields = "0";
-                              internalName = "GlowMulSlider";
-                              Enabled = "1";
-                              isContainer = "0";
-                              Profile = "ToolsGuiSliderProfile";
-                              HorizSizing = "right";
-                              VertSizing = "bottom";
-                              position = "0 1";
-                              Extent = "61 14";
-                              MinExtent = "8 2";
-                              canSave = "1";
-                              Visible = "1";
-                              Command = "MaterialEditorGui.updateActiveMaterial(\"GlowMul[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, true);";
-                              AltCommand = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"GlowMul[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, false);";
-                              tooltipprofile = "ToolsGuiDefaultProfile";
-                              ToolTip = "Sets GlowMul.";
-                              hovertime = "1000";
-                              range = "0 1";
-                              ticks = "0";
-                              value = "0";
-                           };
-                           new GuiTextEditCtrl() {
-                              canSaveDynamicFields = "0";
-                              internalName = "GlowMulTextEdit";
-                              Enabled = "1";
-                              isContainer = "0";
-                              Profile = "ToolsGuiTextEditProfile";
-                              HorizSizing = "right";
-                              VertSizing = "bottom";
-                              position = "64 0";
-                              Extent = "29 18";
-                              MinExtent = "8 2";
-                              canSave = "1";
-                              Visible = "1";
-                              Command = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"GlowMul[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue());";
-                              hovertime = "1000";
-                              AnchorTop = "1";
-                              AnchorBottom = "0";
-                              AnchorLeft = "1";
-                              AnchorRight = "0";
-                              text = "0";
-                           };
-                        };
                      };
                      };
 					 
 					 
                      new GuiContainer(){ // spec Map options
                      new GuiContainer(){ // spec Map options
@@ -1736,6 +1678,23 @@
 						 canSaveDynamicFields = "0";
 						 canSaveDynamicFields = "0";
 					  };
 					  };
 				    };
 				    };
+				   new GuiBitmapCtrl() {
+					  bitmap = "tools/gui/images/separator-v";
+					  wrap = "0";
+					  position = "6 75";
+					  extent = "175 2";
+					  minExtent = "8 2";
+					  horizSizing = "width";
+					  vertSizing = "bottom";
+					  profile = "ToolsGuiButtonProfile";
+					  visible = "1";
+					  active = "1";
+					  tooltipProfile = "GuiToolTipProfile";
+					  hovertime = "1000";
+					  isContainer = "0";
+					  canSave = "1";
+					  canSaveDynamicFields = "0";
+				   };
 				   new GuiContainer() {
 				   new GuiContainer() {
 					  margin = "0 0 0 0";
 					  margin = "0 0 0 0";
 					  padding = "0 0 0 0";
 					  padding = "0 0 0 0";
@@ -1744,7 +1703,7 @@
 					  anchorLeft = "1";
 					  anchorLeft = "1";
 					  anchorRight = "0";
 					  anchorRight = "0";
 					  position = "6 364";
 					  position = "6 364";
-					  extent = "185 52";
+					  extent = "185 67";
 					  minExtent = "8 2";
 					  minExtent = "8 2";
 					  horizSizing = "width";
 					  horizSizing = "width";
 					  vertSizing = "bottom";
 					  vertSizing = "bottom";
@@ -1890,86 +1849,64 @@
 						 canSave = "1";
 						 canSave = "1";
 						 canSaveDynamicFields = "0";
 						 canSaveDynamicFields = "0";
 					  };
 					  };
-					  new GuiRadioCtrl(glowChanBtn0) {
-						 text = "R";
-						 groupNum = "4";
-						 buttonType = "RadioButton";
-						 useMouseEvents = "0";
-						 position = "100 5";
-						 extent = "20 10";
-						 minExtent = "8 2";
-						 horizSizing = "right";
-						 vertSizing = "bottom";
-						 profile = "ToolsGuiRadioProfile";
-						 visible = "1";
-						 active = "1";
-						 command = "MaterialEditorGui.setglowChan(0);";
-						 tooltipProfile = "GuiToolTipProfile";
-						 hovertime = "1000";
-						 isContainer = "0";
-						 canSave = "1";
-						 canSaveDynamicFields = "0";
-					  };
-					  new GuiRadioCtrl(glowChanBtn1) {
-						 text = "G";
-						 groupNum = "4";
-						 buttonType = "RadioButton";
-						 useMouseEvents = "0";
-						 position = "121 5";
-						 extent = "20 10";
-						 minExtent = "8 2";
-						 horizSizing = "right";
-						 vertSizing = "bottom";
-						 profile = "ToolsGuiRadioProfile";
-						 visible = "1";
-						 active = "1";
-						 command = "MaterialEditorGui.setglowChan(1);";
-						 tooltipProfile = "GuiToolTipProfile";
-						 hovertime = "1000";
-						 isContainer = "0";
-						 canSave = "1";
-						 canSaveDynamicFields = "0";
-					  };
-					  new GuiRadioCtrl(glowChanBtn2) {
-						 text = "B";
-						 groupNum = "4";
-						 buttonType = "RadioButton";
-						 useMouseEvents = "0";
-						 position = "142 5";
-						 extent = "20 10";
-						 minExtent = "8 2";
-						 horizSizing = "right";
-						 vertSizing = "bottom";
-						 profile = "ToolsGuiRadioProfile";
-						 visible = "1";
-						 active = "1";
-						 command = "MaterialEditorGui.setglowChan(2);";
-						 tooltipProfile = "GuiToolTipProfile";
-						 hovertime = "1000";
-						 isContainer = "0";
-						 canSave = "1";
-						 canSaveDynamicFields = "0";
-					  };
-					  new GuiRadioCtrl(glowChanBtn3) {
-						 text = "A";
-						 groupNum = "4";
-						 buttonType = "RadioButton";
-						 useMouseEvents = "0";
-						 position = "163 5";
-						 extent = "20 10";
-						 minExtent = "8 2";
-						 horizSizing = "right";
-						 vertSizing = "bottom";
-						 profile = "ToolsGuiRadioProfile";
-						 visible = "1";
-						 active = "1";
-						 command = "MaterialEditorGui.setglowChan(3);";
-						 tooltipProfile = "GuiToolTipProfile";
-						 hovertime = "1000";
-						 isContainer = "0";
-						 canSave = "1";
-						 canSaveDynamicFields = "0";
-					  };
+                        new GuiTextCtrl() {
+                           HorizSizing = "right";
+                           VertSizing = "bottom";
+                           position = "9 48";
+                           Extent = "72 16";
+                           text = "GlowMul";
+                           Profile = "ToolsGuiTextProfile";
+                        };
+                        
+                        new GuiControl() {
+                           class = "AggregateControl";
+                           position = "91 48";
+                           Extent = "96 20";
+                           
+                           new GuiSliderCtrl() {
+                              canSaveDynamicFields = "0";
+                              internalName = "GlowMulSlider";
+                              Enabled = "1";
+                              isContainer = "0";
+                              Profile = "ToolsGuiSliderProfile";
+                              HorizSizing = "right";
+                              VertSizing = "bottom";
+                              position = "0 1";
+                              Extent = "61 14";
+                              MinExtent = "8 2";
+                              canSave = "1";
+                              Visible = "1";
+                              Command = "MaterialEditorGui.updateActiveMaterial(\"GlowMul[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, true);";
+                              AltCommand = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"GlowMul[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, false);";
+                              tooltipprofile = "ToolsGuiDefaultProfile";
+                              ToolTip = "Sets GlowMul.";
+                              hovertime = "1000";
+                              range = "0 20";
+                              ticks = "0";
+                              value = "0";
+                           };
+                           new GuiTextEditCtrl() {
+                              canSaveDynamicFields = "0";
+                              internalName = "GlowMulTextEdit";
+                              Enabled = "1";
+                              isContainer = "0";
+                              Profile = "ToolsGuiTextEditProfile";
+                              HorizSizing = "right";
+                              VertSizing = "bottom";
+                              position = "64 0";
+                              Extent = "29 18";
+                              MinExtent = "8 2";
+                              canSave = "1";
+                              Visible = "1";
+                              Command = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"GlowMul[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue());";
+                              hovertime = "1000";
+                              AnchorTop = "1";
+                              AnchorBottom = "0";
+                              AnchorLeft = "1";
+                              AnchorRight = "0";
+                              text = "0";
+                           };
+                        };
 				    };
 				    };
 				  };
 				  };
                };
                };