Browse Source

Merge pull request #488 from LumaDigital/master

Exposed Texture Unit Names
JoshEngebretson 10 years ago
parent
commit
b6b3546c93
2 changed files with 8 additions and 1 deletions
  1. 6 1
      Source/Atomic/Graphics/Material.cpp
  2. 2 0
      Source/Atomic/Graphics/Material.h

+ 6 - 1
Source/Atomic/Graphics/Material.cpp

@@ -47,7 +47,7 @@ namespace Atomic
 
 extern const char* wrapModeNames[];
 
-static const char* textureUnitNames[] =
+const char* textureUnitNames[] =
 {
     "diffuse",
     "normal",
@@ -770,6 +770,11 @@ Variant Material::ParseShaderParameterValue(const String& value)
         return ToVectorVariant(valueTrimmed);
 }
 
+const char** Material::GetTextureUnitNames()
+{
+    return textureUnitNames;
+}
+
 void Material::CheckOcclusion()
 {
     // Determine occlusion by checking the base pass of each technique

+ 2 - 0
Source/Atomic/Graphics/Material.h

@@ -231,6 +231,8 @@ public:
     static String GetTextureUnitName(TextureUnit unit);
     /// Parse a shader parameter value from a string. Retunrs either a bool, a float, or a 2 to 4-component vector.
     static Variant ParseShaderParameterValue(const String& value);
+    /// Return the names of supported texture units
+    static const char** GetTextureUnitNames();
 
 private:
     /// Re-evaluate occlusion rendering.