diff --git a/Content/Documentation/ScriptingAPI-Documentation.md b/Content/Documentation/ScriptingAPI-Documentation.md index 03aaf48dd..cfcfdacca 100644 --- a/Content/Documentation/ScriptingAPI-Documentation.md +++ b/Content/Documentation/ScriptingAPI-Documentation.md @@ -675,10 +675,10 @@ It inherits functions from RenderPath2D, so it can render a 2D overlay. - [constructor]RenderPath3D() - SetAO(int value) -- Sets up the ambient occlusion effect (possible values below) - AO_DISABLED : int -- turn off AO computation (use in SetAO() function) -- AO_SSAO : int -- enable simple brute force screen space ambient occlusion (use in SetAO() function) -- AO_HBAO : int -- enable horizon based screen space ambient occlusion (use in SetAO() function) -- AO_MSAO : int -- enable multi scale screen space ambient occlusion (use in SetAO() function) -- SetHBAOEnabled(bool value) + - AO_SSAO : int -- enable simple brute force screen space ambient occlusion (use in SetAO() function) + - AO_HBAO : int -- enable horizon based screen space ambient occlusion (use in SetAO() function) + - AO_MSAO : int -- enable multi scale screen space ambient occlusion (use in SetAO() function) +- SetAOPower(float value) -- applies AO power value if any AO is enabled - SetSSREnabled(bool value) - SetRaytracedReflectionsEnabled(bool value) - SetShadowsEnabled(bool value) diff --git a/WickedEngine/wiRenderPath3D_BindLua.cpp b/WickedEngine/wiRenderPath3D_BindLua.cpp index 21dd5255f..745f62f4d 100644 --- a/WickedEngine/wiRenderPath3D_BindLua.cpp +++ b/WickedEngine/wiRenderPath3D_BindLua.cpp @@ -26,6 +26,7 @@ namespace wi::lua lunamethod(RenderPath_BindLua, SetLayerMask), lunamethod(RenderPath3D_BindLua, SetAO), + lunamethod(RenderPath3D_BindLua, SetAOPower), lunamethod(RenderPath3D_BindLua, SetSSREnabled), lunamethod(RenderPath3D_BindLua, SetRaytracedReflectionsEnabled), lunamethod(RenderPath3D_BindLua, SetShadowsEnabled), @@ -71,6 +72,22 @@ namespace wi::lua wi::lua::SError(L, "SetAO(AO value) not enough arguments!"); return 0; } + int RenderPath3D_BindLua::SetAOPower(lua_State* L) + { + if (component == nullptr) + { + wi::lua::SError(L, "SetAOPower(float value) component is null!"); + return 0; + } + if (wi::lua::SGetArgCount(L) > 0) + { + float value = wi::lua::SGetFloat(L, 1); + ((RenderPath3D*)component)->setAOPower(value); + } + else + wi::lua::SError(L, "SetAOPower(float value) not enough arguments!"); + return 0; + } int RenderPath3D_BindLua::SetSSREnabled(lua_State* L) { if (component == nullptr) diff --git a/WickedEngine/wiRenderPath3D_BindLua.h b/WickedEngine/wiRenderPath3D_BindLua.h index 2261e59d2..9e18d70c3 100644 --- a/WickedEngine/wiRenderPath3D_BindLua.h +++ b/WickedEngine/wiRenderPath3D_BindLua.h @@ -27,6 +27,7 @@ namespace wi::lua } int SetAO(lua_State* L); + int SetAOPower(lua_State* L); int SetSSREnabled(lua_State* L); int SetRaytracedReflectionsEnabled(lua_State* L); int SetShadowsEnabled(lua_State* L);