seanpaultaylor 12 лет назад
Родитель
Сommit
766bfb606b

+ 8 - 0
gameplay/gameplay.vcxproj

@@ -240,6 +240,8 @@
     <ClCompile Include="src\lua\lua_RenderTarget.cpp" />
     <ClCompile Include="src\lua\lua_Scene.cpp" />
     <ClCompile Include="src\lua\lua_SceneDebugFlags.cpp" />
+    <ClCompile Include="src\lua\lua_SceneRenderer.cpp" />
+    <ClCompile Include="src\lua\lua_SceneRendererForward.cpp" />
     <ClCompile Include="src\lua\lua_ScreenDisplayer.cpp" />
     <ClCompile Include="src\lua\lua_ScriptController.cpp" />
     <ClCompile Include="src\lua\lua_ScriptTarget.cpp" />
@@ -274,6 +276,8 @@
     <ClCompile Include="src\lua\lua_VertexFormatElement.cpp" />
     <ClCompile Include="src\lua\lua_VertexFormatUsage.cpp" />
     <ClCompile Include="src\lua\lua_VerticalLayout.cpp" />
+    <ClCompile Include="src\lua\lua_VisibleSet.cpp" />
+    <ClCompile Include="src\lua\lua_VisibleSetDefault.cpp" />
     <ClCompile Include="src\Material.cpp" />
     <ClCompile Include="src\MathUtil.cpp" />
     <ClCompile Include="src\MeshBatch.cpp" />
@@ -538,6 +542,8 @@
     <ClInclude Include="src\lua\lua_RenderTarget.h" />
     <ClInclude Include="src\lua\lua_Scene.h" />
     <ClInclude Include="src\lua\lua_SceneDebugFlags.h" />
+    <ClInclude Include="src\lua\lua_SceneRenderer.h" />
+    <ClInclude Include="src\lua\lua_SceneRendererForward.h" />
     <ClInclude Include="src\lua\lua_ScreenDisplayer.h" />
     <ClInclude Include="src\lua\lua_ScriptController.h" />
     <ClInclude Include="src\lua\lua_ScriptTarget.h" />
@@ -572,6 +578,8 @@
     <ClInclude Include="src\lua\lua_VertexFormatElement.h" />
     <ClInclude Include="src\lua\lua_VertexFormatUsage.h" />
     <ClInclude Include="src\lua\lua_VerticalLayout.h" />
+    <ClInclude Include="src\lua\lua_VisibleSet.h" />
+    <ClInclude Include="src\lua\lua_VisibleSetDefault.h" />
     <ClInclude Include="src\Material.h" />
     <ClInclude Include="src\MathUtil.h" />
     <ClInclude Include="src\MeshBatch.h" />

+ 24 - 0
gameplay/gameplay.vcxproj.filters

@@ -906,6 +906,18 @@
     <ClCompile Include="src\social\GooglePlaySocialSession.cpp">
       <Filter>src\social</Filter>
     </ClCompile>
+    <ClCompile Include="src\lua\lua_SceneRenderer.cpp">
+      <Filter>src\lua</Filter>
+    </ClCompile>
+    <ClCompile Include="src\lua\lua_SceneRendererForward.cpp">
+      <Filter>src\lua</Filter>
+    </ClCompile>
+    <ClCompile Include="src\lua\lua_VisibleSet.cpp">
+      <Filter>src\lua</Filter>
+    </ClCompile>
+    <ClCompile Include="src\lua\lua_VisibleSetDefault.cpp">
+      <Filter>src\lua</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="src\Animation.h">
@@ -1802,6 +1814,18 @@
     <ClInclude Include="src\social\GooglePlaySocialSession.h">
       <Filter>src\social</Filter>
     </ClInclude>
+    <ClInclude Include="src\lua\lua_SceneRenderer.h">
+      <Filter>src\lua</Filter>
+    </ClInclude>
+    <ClInclude Include="src\lua\lua_SceneRendererForward.h">
+      <Filter>src\lua</Filter>
+    </ClInclude>
+    <ClInclude Include="src\lua\lua_VisibleSet.h">
+      <Filter>src\lua</Filter>
+    </ClInclude>
+    <ClInclude Include="src\lua\lua_VisibleSetDefault.h">
+      <Filter>src\lua</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="src\Game.inl">

+ 6 - 3
gameplay/src/lua/lua_Form.cpp

@@ -784,9 +784,12 @@ int lua_Form_draw(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Form* instance = getInstance(state);
-                instance->draw();
-                
-                return 0;
+                unsigned int result = instance->draw();
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
             }
 
             lua_pushstring(state, "lua_Form_draw - Failed to match the given parameters to a valid function signature.");

+ 2 - 0
gameplay/src/lua/lua_Global.cpp

@@ -112,6 +112,7 @@ void luaRegister_lua_Global()
     gameplay::ScriptUtil::setGlobalHierarchyPair("RenderState", "Material");
     gameplay::ScriptUtil::setGlobalHierarchyPair("RenderState", "Pass");
     gameplay::ScriptUtil::setGlobalHierarchyPair("RenderState", "Technique");
+    gameplay::ScriptUtil::setGlobalHierarchyPair("SceneRenderer", "SceneRendererForward");
     gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "AIAgent");
     gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "AIState");
     gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Button");
@@ -139,6 +140,7 @@ void luaRegister_lua_Global()
     gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "PhysicsGhostObject");
     gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "PhysicsRigidBody");
     gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "Terrain");
+    gameplay::ScriptUtil::setGlobalHierarchyPair("VisibleSet", "VisibleSetDefault");
     gameplay::ScriptUtil::addStringFromEnumConversionFunction(&gameplay::lua_stringFromEnumGlobal);
 
     // Register enumeration AIMessage::ParameterType.

+ 109 - 0
gameplay/src/lua/lua_Joint.cpp

@@ -105,6 +105,8 @@ void luaRegister_Joint()
         {"getWorldViewProjectionMatrix", lua_Joint_getWorldViewProjectionMatrix},
         {"hasTag", lua_Joint_hasTag},
         {"isStatic", lua_Joint_isStatic},
+        {"isVisible", lua_Joint_isVisible},
+        {"isVisibleInHierarchy", lua_Joint_isVisibleInHierarchy},
         {"release", lua_Joint_release},
         {"removeAllChildren", lua_Joint_removeAllChildren},
         {"removeChild", lua_Joint_removeChild},
@@ -141,6 +143,7 @@ void luaRegister_Joint()
         {"setTranslationX", lua_Joint_setTranslationX},
         {"setTranslationY", lua_Joint_setTranslationY},
         {"setTranslationZ", lua_Joint_setTranslationZ},
+        {"setVisible", lua_Joint_setVisible},
         {"transformPoint", lua_Joint_transformPoint},
         {"transformVector", lua_Joint_transformVector},
         {"translate", lua_Joint_translate},
@@ -3970,6 +3973,76 @@ int lua_Joint_isStatic(lua_State* state)
     return 0;
 }
 
+int lua_Joint_isVisible(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Joint* instance = getInstance(state);
+                bool result = instance->isVisible();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Joint_isVisible - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Joint_isVisibleInHierarchy(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Joint* instance = getInstance(state);
+                bool result = instance->isVisibleInHierarchy();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Joint_isVisibleInHierarchy - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Joint_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -6070,6 +6143,42 @@ int lua_Joint_setTranslationZ(lua_State* state)
     return 0;
 }
 
+int lua_Joint_setVisible(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+
+                Joint* instance = getInstance(state);
+                instance->setVisible(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Joint_setVisible - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Joint_static_ANIMATE_ROTATE(lua_State* state)
 {
     // Validate the number of parameters.

+ 3 - 0
gameplay/src/lua/lua_Joint.h

@@ -80,6 +80,8 @@ int lua_Joint_getWorldViewMatrix(lua_State* state);
 int lua_Joint_getWorldViewProjectionMatrix(lua_State* state);
 int lua_Joint_hasTag(lua_State* state);
 int lua_Joint_isStatic(lua_State* state);
+int lua_Joint_isVisible(lua_State* state);
+int lua_Joint_isVisibleInHierarchy(lua_State* state);
 int lua_Joint_release(lua_State* state);
 int lua_Joint_removeAllChildren(lua_State* state);
 int lua_Joint_removeChild(lua_State* state);
@@ -116,6 +118,7 @@ int lua_Joint_setTranslation(lua_State* state);
 int lua_Joint_setTranslationX(lua_State* state);
 int lua_Joint_setTranslationY(lua_State* state);
 int lua_Joint_setTranslationZ(lua_State* state);
+int lua_Joint_setVisible(lua_State* state);
 int lua_Joint_static_ANIMATE_ROTATE(lua_State* state);
 int lua_Joint_static_ANIMATE_ROTATE_TRANSLATE(lua_State* state);
 int lua_Joint_static_ANIMATE_SCALE(lua_State* state);

+ 158 - 6
gameplay/src/lua/lua_Model.cpp

@@ -27,9 +27,13 @@ void luaRegister_Model()
         {"getRefCount", lua_Model_getRefCount},
         {"getSkin", lua_Model_getSkin},
         {"hasMaterial", lua_Model_hasMaterial},
+        {"isShadowCaster", lua_Model_isShadowCaster},
+        {"isShadowReceiver", lua_Model_isShadowReceiver},
         {"release", lua_Model_release},
         {"setMaterial", lua_Model_setMaterial},
         {"setNode", lua_Model_setNode},
+        {"setShadowCaster", lua_Model_setShadowCaster},
+        {"setShadowReceiver", lua_Model_setShadowReceiver},
         {NULL, NULL}
     };
     const luaL_Reg lua_statics[] = 
@@ -132,9 +136,12 @@ int lua_Model_draw(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Model* instance = getInstance(state);
-                instance->draw();
-                
-                return 0;
+                unsigned int result = instance->draw();
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
             }
 
             lua_pushstring(state, "lua_Model_draw - Failed to match the given parameters to a valid function signature.");
@@ -150,9 +157,12 @@ int lua_Model_draw(lua_State* state)
                 bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
                 Model* instance = getInstance(state);
-                instance->draw(param1);
-                
-                return 0;
+                unsigned int result = instance->draw(param1);
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
             }
 
             lua_pushstring(state, "lua_Model_draw - Failed to match the given parameters to a valid function signature.");
@@ -484,6 +494,76 @@ int lua_Model_hasMaterial(lua_State* state)
     return 0;
 }
 
+int lua_Model_isShadowCaster(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Model* instance = getInstance(state);
+                bool result = instance->isShadowCaster();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Model_isShadowCaster - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Model_isShadowReceiver(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Model* instance = getInstance(state);
+                bool result = instance->isShadowReceiver();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Model_isShadowReceiver - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Model_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -803,6 +883,78 @@ int lua_Model_setNode(lua_State* state)
     return 0;
 }
 
+int lua_Model_setShadowCaster(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+
+                Model* instance = getInstance(state);
+                instance->setShadowCaster(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Model_setShadowCaster - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Model_setShadowReceiver(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+
+                Model* instance = getInstance(state);
+                instance->setShadowReceiver(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Model_setShadowReceiver - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Model_static_create(lua_State* state)
 {
     // Get the number of parameters.

+ 4 - 0
gameplay/src/lua/lua_Model.h

@@ -15,9 +15,13 @@ int lua_Model_getNode(lua_State* state);
 int lua_Model_getRefCount(lua_State* state);
 int lua_Model_getSkin(lua_State* state);
 int lua_Model_hasMaterial(lua_State* state);
+int lua_Model_isShadowCaster(lua_State* state);
+int lua_Model_isShadowReceiver(lua_State* state);
 int lua_Model_release(lua_State* state);
 int lua_Model_setMaterial(lua_State* state);
 int lua_Model_setNode(lua_State* state);
+int lua_Model_setShadowCaster(lua_State* state);
+int lua_Model_setShadowReceiver(lua_State* state);
 int lua_Model_static_create(lua_State* state);
 
 void luaRegister_Model();

+ 109 - 0
gameplay/src/lua/lua_Node.cpp

@@ -103,6 +103,8 @@ void luaRegister_Node()
         {"getWorldViewProjectionMatrix", lua_Node_getWorldViewProjectionMatrix},
         {"hasTag", lua_Node_hasTag},
         {"isStatic", lua_Node_isStatic},
+        {"isVisible", lua_Node_isVisible},
+        {"isVisibleInHierarchy", lua_Node_isVisibleInHierarchy},
         {"release", lua_Node_release},
         {"removeAllChildren", lua_Node_removeAllChildren},
         {"removeChild", lua_Node_removeChild},
@@ -139,6 +141,7 @@ void luaRegister_Node()
         {"setTranslationX", lua_Node_setTranslationX},
         {"setTranslationY", lua_Node_setTranslationY},
         {"setTranslationZ", lua_Node_setTranslationZ},
+        {"setVisible", lua_Node_setVisible},
         {"transformPoint", lua_Node_transformPoint},
         {"transformVector", lua_Node_transformVector},
         {"translate", lua_Node_translate},
@@ -3925,6 +3928,76 @@ int lua_Node_isStatic(lua_State* state)
     return 0;
 }
 
+int lua_Node_isVisible(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Node* instance = getInstance(state);
+                bool result = instance->isVisible();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Node_isVisible - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_Node_isVisibleInHierarchy(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                Node* instance = getInstance(state);
+                bool result = instance->isVisibleInHierarchy();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_Node_isVisibleInHierarchy - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Node_release(lua_State* state)
 {
     // Get the number of parameters.
@@ -6025,6 +6098,42 @@ int lua_Node_setTranslationZ(lua_State* state)
     return 0;
 }
 
+int lua_Node_setVisible(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+
+                Node* instance = getInstance(state);
+                instance->setVisible(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_Node_setVisible - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Node_static_ANIMATE_ROTATE(lua_State* state)
 {
     // Validate the number of parameters.

+ 3 - 0
gameplay/src/lua/lua_Node.h

@@ -79,6 +79,8 @@ int lua_Node_getWorldViewMatrix(lua_State* state);
 int lua_Node_getWorldViewProjectionMatrix(lua_State* state);
 int lua_Node_hasTag(lua_State* state);
 int lua_Node_isStatic(lua_State* state);
+int lua_Node_isVisible(lua_State* state);
+int lua_Node_isVisibleInHierarchy(lua_State* state);
 int lua_Node_release(lua_State* state);
 int lua_Node_removeAllChildren(lua_State* state);
 int lua_Node_removeChild(lua_State* state);
@@ -115,6 +117,7 @@ int lua_Node_setTranslation(lua_State* state);
 int lua_Node_setTranslationX(lua_State* state);
 int lua_Node_setTranslationY(lua_State* state);
 int lua_Node_setTranslationZ(lua_State* state);
+int lua_Node_setVisible(lua_State* state);
 int lua_Node_static_ANIMATE_ROTATE(lua_State* state);
 int lua_Node_static_ANIMATE_ROTATE_TRANSLATE(lua_State* state);
 int lua_Node_static_ANIMATE_SCALE(lua_State* state);

+ 6 - 3
gameplay/src/lua/lua_ParticleEmitter.cpp

@@ -235,9 +235,12 @@ int lua_ParticleEmitter_draw(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 ParticleEmitter* instance = getInstance(state);
-                instance->draw();
-                
-                return 0;
+                unsigned int result = instance->draw();
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
             }
 
             lua_pushstring(state, "lua_ParticleEmitter_draw - Failed to match the given parameters to a valid function signature.");

+ 186 - 0
gameplay/src/lua/lua_SceneRenderer.cpp

@@ -0,0 +1,186 @@
+#include "Base.h"
+#include "ScriptController.h"
+#include "lua_SceneRenderer.h"
+#include "Base.h"
+#include "SceneRenderer.h"
+
+namespace gameplay
+{
+
+void luaRegister_SceneRenderer()
+{
+    const luaL_Reg lua_members[] = 
+    {
+        {"isWireframe", lua_SceneRenderer_isWireframe},
+        {"render", lua_SceneRenderer_render},
+        {"setWireframe", lua_SceneRenderer_setWireframe},
+        {NULL, NULL}
+    };
+    const luaL_Reg* lua_statics = NULL;
+    std::vector<std::string> scopePath;
+
+    gameplay::ScriptUtil::registerClass("SceneRenderer", lua_members, NULL, lua_SceneRenderer__gc, lua_statics, scopePath);
+}
+
+static SceneRenderer* getInstance(lua_State* state)
+{
+    void* userdata = luaL_checkudata(state, 1, "SceneRenderer");
+    luaL_argcheck(state, userdata != NULL, 1, "'SceneRenderer' expected.");
+    return (SceneRenderer*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
+}
+
+int lua_SceneRenderer__gc(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                void* userdata = luaL_checkudata(state, 1, "SceneRenderer");
+                luaL_argcheck(state, userdata != NULL, 1, "'SceneRenderer' expected.");
+                gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)userdata;
+                if (object->owns)
+                {
+                    SceneRenderer* instance = (SceneRenderer*)object->instance;
+                    SAFE_DELETE(instance);
+                }
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_SceneRenderer__gc - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_SceneRenderer_isWireframe(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                SceneRenderer* instance = getInstance(state);
+                bool result = instance->isWireframe();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_SceneRenderer_isWireframe - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_SceneRenderer_render(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<VisibleSet> param1 = gameplay::ScriptUtil::getObjectPointer<VisibleSet>(2, "VisibleSet", false, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'VisibleSet'.");
+                    lua_error(state);
+                }
+
+                SceneRenderer* instance = getInstance(state);
+                unsigned int result = instance->render(param1);
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_SceneRenderer_render - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_SceneRenderer_setWireframe(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+
+                SceneRenderer* instance = getInstance(state);
+                instance->setWireframe(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_SceneRenderer_setWireframe - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+}

+ 17 - 0
gameplay/src/lua/lua_SceneRenderer.h

@@ -0,0 +1,17 @@
+#ifndef LUA_SCENERENDERER_H_
+#define LUA_SCENERENDERER_H_
+
+namespace gameplay
+{
+
+// Lua bindings for SceneRenderer.
+int lua_SceneRenderer__gc(lua_State* state);
+int lua_SceneRenderer_isWireframe(lua_State* state);
+int lua_SceneRenderer_render(lua_State* state);
+int lua_SceneRenderer_setWireframe(lua_State* state);
+
+void luaRegister_SceneRenderer();
+
+}
+
+#endif

+ 194 - 0
gameplay/src/lua/lua_SceneRendererForward.cpp

@@ -0,0 +1,194 @@
+#include "Base.h"
+#include "ScriptController.h"
+#include "lua_SceneRendererForward.h"
+#include "Base.h"
+#include "Form.h"
+#include "Model.h"
+#include "ParticleEmitter.h"
+#include "SceneRenderer.h"
+#include "SceneRendererForward.h"
+#include "Terrain.h"
+
+namespace gameplay
+{
+
+void luaRegister_SceneRendererForward()
+{
+    const luaL_Reg lua_members[] = 
+    {
+        {"isWireframe", lua_SceneRendererForward_isWireframe},
+        {"render", lua_SceneRendererForward_render},
+        {"setWireframe", lua_SceneRendererForward_setWireframe},
+        {NULL, NULL}
+    };
+    const luaL_Reg lua_statics[] = 
+    {
+        {"create", lua_SceneRendererForward_static_create},
+        {NULL, NULL}
+    };
+    std::vector<std::string> scopePath;
+
+    gameplay::ScriptUtil::registerClass("SceneRendererForward", lua_members, NULL, NULL, lua_statics, scopePath);
+}
+
+static SceneRendererForward* getInstance(lua_State* state)
+{
+    void* userdata = luaL_checkudata(state, 1, "SceneRendererForward");
+    luaL_argcheck(state, userdata != NULL, 1, "'SceneRendererForward' expected.");
+    return (SceneRendererForward*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
+}
+
+int lua_SceneRendererForward_isWireframe(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                SceneRendererForward* instance = getInstance(state);
+                bool result = instance->isWireframe();
+
+                // Push the return value onto the stack.
+                lua_pushboolean(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_SceneRendererForward_isWireframe - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_SceneRendererForward_render(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<VisibleSet> param1 = gameplay::ScriptUtil::getObjectPointer<VisibleSet>(2, "VisibleSet", false, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'VisibleSet'.");
+                    lua_error(state);
+                }
+
+                SceneRendererForward* instance = getInstance(state);
+                unsigned int result = instance->render(param1);
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_SceneRendererForward_render - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_SceneRendererForward_setWireframe(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                lua_type(state, 2) == LUA_TBOOLEAN)
+            {
+                // Get parameter 1 off the stack.
+                bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
+
+                SceneRendererForward* instance = getInstance(state);
+                instance->setWireframe(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_SceneRendererForward_setWireframe - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_SceneRendererForward_static_create(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 0:
+        {
+            void* returnPtr = (void*)SceneRendererForward::create();
+            if (returnPtr)
+            {
+                gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                object->instance = returnPtr;
+                object->owns = false;
+                luaL_getmetatable(state, "SceneRendererForward");
+                lua_setmetatable(state, -2);
+            }
+            else
+            {
+                lua_pushnil(state);
+            }
+
+            return 1;
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 0).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+}

+ 17 - 0
gameplay/src/lua/lua_SceneRendererForward.h

@@ -0,0 +1,17 @@
+#ifndef LUA_SCENERENDERERFORWARD_H_
+#define LUA_SCENERENDERERFORWARD_H_
+
+namespace gameplay
+{
+
+// Lua bindings for SceneRendererForward.
+int lua_SceneRendererForward_isWireframe(lua_State* state);
+int lua_SceneRendererForward_render(lua_State* state);
+int lua_SceneRendererForward_setWireframe(lua_State* state);
+int lua_SceneRendererForward_static_create(lua_State* state);
+
+void luaRegister_SceneRendererForward();
+
+}
+
+#endif

+ 12 - 6
gameplay/src/lua/lua_Terrain.cpp

@@ -188,9 +188,12 @@ int lua_Terrain_draw(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 Terrain* instance = getInstance(state);
-                instance->draw();
-                
-                return 0;
+                unsigned int result = instance->draw();
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
             }
 
             lua_pushstring(state, "lua_Terrain_draw - Failed to match the given parameters to a valid function signature.");
@@ -206,9 +209,12 @@ int lua_Terrain_draw(lua_State* state)
                 bool param1 = gameplay::ScriptUtil::luaCheckBool(state, 2);
 
                 Terrain* instance = getInstance(state);
-                instance->draw(param1);
-                
-                return 0;
+                unsigned int result = instance->draw(param1);
+
+                // Push the return value onto the stack.
+                lua_pushunsigned(state, result);
+
+                return 1;
             }
 
             lua_pushstring(state, "lua_Terrain_draw - Failed to match the given parameters to a valid function signature.");

+ 232 - 0
gameplay/src/lua/lua_VisibleSet.cpp

@@ -0,0 +1,232 @@
+#include "Base.h"
+#include "ScriptController.h"
+#include "lua_VisibleSet.h"
+#include "VisibleSet.h"
+
+namespace gameplay
+{
+
+void luaRegister_VisibleSet()
+{
+    const luaL_Reg lua_members[] = 
+    {
+        {"getNext", lua_VisibleSet_getNext},
+        {"getScene", lua_VisibleSet_getScene},
+        {"reset", lua_VisibleSet_reset},
+        {"setScene", lua_VisibleSet_setScene},
+        {NULL, NULL}
+    };
+    const luaL_Reg* lua_statics = NULL;
+    std::vector<std::string> scopePath;
+
+    gameplay::ScriptUtil::registerClass("VisibleSet", lua_members, NULL, lua_VisibleSet__gc, lua_statics, scopePath);
+}
+
+static VisibleSet* getInstance(lua_State* state)
+{
+    void* userdata = luaL_checkudata(state, 1, "VisibleSet");
+    luaL_argcheck(state, userdata != NULL, 1, "'VisibleSet' expected.");
+    return (VisibleSet*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
+}
+
+int lua_VisibleSet__gc(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                void* userdata = luaL_checkudata(state, 1, "VisibleSet");
+                luaL_argcheck(state, userdata != NULL, 1, "'VisibleSet' expected.");
+                gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)userdata;
+                if (object->owns)
+                {
+                    VisibleSet* instance = (VisibleSet*)object->instance;
+                    SAFE_DELETE(instance);
+                }
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_VisibleSet__gc - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSet_getNext(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                VisibleSet* instance = getInstance(state);
+                void* returnPtr = (void*)instance->getNext();
+                if (returnPtr)
+                {
+                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = false;
+                    luaL_getmetatable(state, "Node");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_VisibleSet_getNext - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSet_getScene(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                VisibleSet* instance = getInstance(state);
+                void* returnPtr = (void*)instance->getScene();
+                if (returnPtr)
+                {
+                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = false;
+                    luaL_getmetatable(state, "Scene");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_VisibleSet_getScene - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSet_reset(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                VisibleSet* instance = getInstance(state);
+                instance->reset();
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_VisibleSet_reset - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSet_setScene(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Scene> param1 = gameplay::ScriptUtil::getObjectPointer<Scene>(2, "Scene", false, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Scene'.");
+                    lua_error(state);
+                }
+
+                VisibleSet* instance = getInstance(state);
+                instance->setScene(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_VisibleSet_setScene - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+}

+ 18 - 0
gameplay/src/lua/lua_VisibleSet.h

@@ -0,0 +1,18 @@
+#ifndef LUA_VISIBLESET_H_
+#define LUA_VISIBLESET_H_
+
+namespace gameplay
+{
+
+// Lua bindings for VisibleSet.
+int lua_VisibleSet__gc(lua_State* state);
+int lua_VisibleSet_getNext(lua_State* state);
+int lua_VisibleSet_getScene(lua_State* state);
+int lua_VisibleSet_reset(lua_State* state);
+int lua_VisibleSet_setScene(lua_State* state);
+
+void luaRegister_VisibleSet();
+
+}
+
+#endif

+ 251 - 0
gameplay/src/lua/lua_VisibleSetDefault.cpp

@@ -0,0 +1,251 @@
+#include "Base.h"
+#include "ScriptController.h"
+#include "lua_VisibleSetDefault.h"
+#include "Base.h"
+#include "VisibleSetDefault.h"
+
+namespace gameplay
+{
+
+void luaRegister_VisibleSetDefault()
+{
+    const luaL_Reg lua_members[] = 
+    {
+        {"getNext", lua_VisibleSetDefault_getNext},
+        {"getScene", lua_VisibleSetDefault_getScene},
+        {"reset", lua_VisibleSetDefault_reset},
+        {"setScene", lua_VisibleSetDefault_setScene},
+        {NULL, NULL}
+    };
+    const luaL_Reg lua_statics[] = 
+    {
+        {"create", lua_VisibleSetDefault_static_create},
+        {NULL, NULL}
+    };
+    std::vector<std::string> scopePath;
+
+    gameplay::ScriptUtil::registerClass("VisibleSetDefault", lua_members, NULL, NULL, lua_statics, scopePath);
+}
+
+static VisibleSetDefault* getInstance(lua_State* state)
+{
+    void* userdata = luaL_checkudata(state, 1, "VisibleSetDefault");
+    luaL_argcheck(state, userdata != NULL, 1, "'VisibleSetDefault' expected.");
+    return (VisibleSetDefault*)((gameplay::ScriptUtil::LuaObject*)userdata)->instance;
+}
+
+int lua_VisibleSetDefault_getNext(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                VisibleSetDefault* instance = getInstance(state);
+                void* returnPtr = (void*)instance->getNext();
+                if (returnPtr)
+                {
+                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = false;
+                    luaL_getmetatable(state, "Node");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_VisibleSetDefault_getNext - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSetDefault_getScene(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                VisibleSetDefault* instance = getInstance(state);
+                void* returnPtr = (void*)instance->getScene();
+                if (returnPtr)
+                {
+                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = false;
+                    luaL_getmetatable(state, "Scene");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_VisibleSetDefault_getScene - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSetDefault_reset(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            {
+                VisibleSetDefault* instance = getInstance(state);
+                instance->reset();
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_VisibleSetDefault_reset - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSetDefault_setScene(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Scene> param1 = gameplay::ScriptUtil::getObjectPointer<Scene>(2, "Scene", false, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Scene'.");
+                    lua_error(state);
+                }
+
+                VisibleSetDefault* instance = getInstance(state);
+                instance->setScene(param1);
+                
+                return 0;
+            }
+
+            lua_pushstring(state, "lua_VisibleSetDefault_setScene - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+int lua_VisibleSetDefault_static_create(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TTABLE || lua_type(state, 1) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                bool param1Valid;
+                gameplay::ScriptUtil::LuaArray<Scene> param1 = gameplay::ScriptUtil::getObjectPointer<Scene>(1, "Scene", false, &param1Valid);
+                if (!param1Valid)
+                {
+                    lua_pushstring(state, "Failed to convert parameter 1 to type 'Scene'.");
+                    lua_error(state);
+                }
+
+                void* returnPtr = (void*)VisibleSetDefault::create(param1);
+                if (returnPtr)
+                {
+                    gameplay::ScriptUtil::LuaObject* object = (gameplay::ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(gameplay::ScriptUtil::LuaObject));
+                    object->instance = returnPtr;
+                    object->owns = false;
+                    luaL_getmetatable(state, "VisibleSetDefault");
+                    lua_setmetatable(state, -2);
+                }
+                else
+                {
+                    lua_pushnil(state);
+                }
+
+                return 1;
+            }
+
+            lua_pushstring(state, "lua_VisibleSetDefault_static_create - Failed to match the given parameters to a valid function signature.");
+            lua_error(state);
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
+}

+ 18 - 0
gameplay/src/lua/lua_VisibleSetDefault.h

@@ -0,0 +1,18 @@
+#ifndef LUA_VISIBLESETDEFAULT_H_
+#define LUA_VISIBLESETDEFAULT_H_
+
+namespace gameplay
+{
+
+// Lua bindings for VisibleSetDefault.
+int lua_VisibleSetDefault_getNext(lua_State* state);
+int lua_VisibleSetDefault_getScene(lua_State* state);
+int lua_VisibleSetDefault_reset(lua_State* state);
+int lua_VisibleSetDefault_setScene(lua_State* state);
+int lua_VisibleSetDefault_static_create(lua_State* state);
+
+void luaRegister_VisibleSetDefault();
+
+}
+
+#endif

+ 4 - 0
gameplay/src/lua/lua_all_bindings.cpp

@@ -103,6 +103,8 @@ void lua_RegisterAllBindings()
     luaRegister_RenderStateStateBlock();
     luaRegister_RenderTarget();
     luaRegister_Scene();
+    luaRegister_SceneRenderer();
+    luaRegister_SceneRendererForward();
     luaRegister_ScreenDisplayer();
     luaRegister_ScriptController();
     luaRegister_ScriptTarget();
@@ -130,6 +132,8 @@ void lua_RegisterAllBindings()
     luaRegister_VertexFormat();
     luaRegister_VertexFormatElement();
     luaRegister_VerticalLayout();
+    luaRegister_VisibleSet();
+    luaRegister_VisibleSetDefault();
     luaRegister_lua_Global();
 }
 

+ 4 - 0
gameplay/src/lua/lua_all_bindings.h

@@ -98,6 +98,8 @@
 #include "lua_RenderStateStateBlock.h"
 #include "lua_RenderTarget.h"
 #include "lua_Scene.h"
+#include "lua_SceneRenderer.h"
+#include "lua_SceneRendererForward.h"
 #include "lua_ScreenDisplayer.h"
 #include "lua_ScriptController.h"
 #include "lua_ScriptTarget.h"
@@ -125,6 +127,8 @@
 #include "lua_VertexFormat.h"
 #include "lua_VertexFormatElement.h"
 #include "lua_VerticalLayout.h"
+#include "lua_VisibleSet.h"
+#include "lua_VisibleSetDefault.h"
 #include "lua_Global.h"
 
 namespace gameplay

+ 1 - 1
samples/browser/src/SceneRendererSample.cpp

@@ -2,7 +2,7 @@
 #include "SamplesGame.h"
 
 #if defined(ADD_SAMPLE)
-    ADD_SAMPLE("Scene", "Scene Renderer", SceneRendererSample, 3);
+    ADD_SAMPLE("Scene", "SceneRenderer", SceneRendererSample, 3);
 #endif
 
 SceneRendererSample::SceneRendererSample() : _font(NULL), _scene(NULL), _visibleSet(NULL), _lightNode(NULL)