Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2024-04-19 11:44:41



Reply to topic  [ 3 posts ] 
Lua related: debug setting for shadow controls 
Author Message

Joined: 2020-07-08 23:18:37
Posts: 34
Reply with quote
Most of the time I want shadows enabled in my viewer, but there are places where having them enabled causes a serious hit to the framerate. I've created my own Lua sidebar button for turning advanced lighting model (ALM) off and on. What I really want to do is change the button that toggles ALM to just turning shadows on and off. I am lazy enough to want a single button for quick changes depending on the situation of the moment, avoiding the need to enter preferences every time I want to change the setting. I have not found any debug setting relating to the shadow controls. Can a debug setting for shadows be added (assuming one doesn't already exist which I have simply failed to find)? I could then add that debug setting to my 'whitelist' and use it in my custom Lua automation script.


2020-07-09 00:30:54
Profile

Joined: 2016-06-19 21:33:37
Posts: 342
Location: Columbus area, OH, USA
Reply with quote
You might have a look at RenderShadowDetail. I use that setting along with a few others to create graphics 'profiles' that I can quickly switch via the keyboard commands.


2020-07-09 01:26:55
Profile

Joined: 2020-07-08 23:18:37
Posts: 34
Reply with quote
Thank you, Zane! That was the setting I needed. I should have experimented with RenderShadowDetail, but the description must have given me a different idea of its purpose. Nevertheless...

Code:
shadows_on=true
...
function OnLogin(location)
...
    -- Setup the side bar button for Shadows:
    OnAutomationMessage("shadows-on")
...
function OnAutomationMessage(text)
...
    elseif text == "shadows-on" then
        shadows_on=true
        SetDebugSetting("RenderShadowDetail", "2")
        SideBarButton(6, "shadow_off.png", "AutomationMessage('shadows-off')", "Disable shadows")
    elseif text == "shadows-off" then
        shadows_on=false
        SetDebugSetting("RenderShadowDetail", "0")
        SideBarButton(6, "shadow_on.png", "AutomationMessage('shadows-on')", "Enable shadows")


works exactly as I hoped after adding RenderShadowDetail to LuaSettingsWhitelist.
I made two simple icons in GIMP for this button.


2020-07-09 03:09:22
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 34 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.