Phodex Games Posted April 9, 2018 Share Posted April 9, 2018 Hi, I make it short & simple. When I change the light quality with "world:SetLightQuality()" all Lights just disappear instead of changing the light quality. What am I doing wrong? Quote Link to comment Share on other sites More sharing options...
Gonan Posted April 9, 2018 Share Posted April 9, 2018 what is the value that you are passing in the call to SetLightQuality(). What value do you get back from GetLightQuality(), and have a look at the help for world and SetLightQuality if you haven't already done so. Quote Link to comment Share on other sites More sharing options...
Phodex Games Posted April 10, 2018 Author Share Posted April 10, 2018 @Gonan Hmm I played around with it. GetLightQuality() returns 1, which is also the LW default. When I say world:SetLightQuality(1) it "works", but it stays the same anyway. If I set it to 0 or 2 the lights just go off... Quote Link to comment Share on other sites More sharing options...
Gonan Posted April 12, 2018 Share Posted April 12, 2018 There is some sample code in the help for world GetLightQuality. Try a new project with that code. Does changing the SetLightQuality to 0 or 2 work? If so are you making the same calls in the loop in your original code, esp. World update and render. Quote Link to comment Share on other sites More sharing options...
Josh Posted April 12, 2018 Share Posted April 12, 2018 Does this happen when you change the setting in the editor options? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Phodex Games Posted April 13, 2018 Author Share Posted April 13, 2018 21 hours ago, Gonan said: If so are you making the same calls in the loop in your original code, esp. World update and render. Yeah I changed some stuff in the main lua, but the rendering & update stuff is untouched and default. If I start the Leadwerks FPS level it works, although i cannot really see a quality difference, but lights don't go off if I change the light quality in the game menu. @Josh In the editor it works just fine... Quote Link to comment Share on other sites More sharing options...
Gonan Posted April 13, 2018 Share Posted April 13, 2018 From your replies so far, changing the world:SetLightQuality does not turn off the lights in the fps sample, but you can't see any difference to the quality. My next question is where are you calling SetLightQuality in your code, its not in each pass of the main loop is it? If it is hold your last set quality value in your own variable, and if it changes then call world:SetLightQuality, with the new value, just the once. I'm thinking is it possible that the update and render calls rely on a state of some internal workings after setting the light quality, if this is true, ie world update is affected by a render state change the lights won't display until the next pass of the main loop. Quote Link to comment Share on other sites More sharing options...
Phodex Games Posted April 14, 2018 Author Share Posted April 14, 2018 Hi, no I am just calling it once. I am currently building my options menu and therefore have a class handling the options the function looks like this: function SysControl:SetLightingQuality(quality) --this is exactly the same as I found in the fps demo level code, to set light quality world:SetLightQuality(quality) System:SetProperty("lightquality",quality) end But what I found out is that it seems to work if I set the light quality in the main.lua before the main loop starts. But actually I see no diffrence between the diffrent lightning levels, but I dont think that it is not working, I just think the quality difference is minimal, therefore it would be best to keep it on 0, isn't it? Maybe it has some more drastical effect if you have volumeric lighting and enviorment probes, but I havent tried that yet. I mean if this option does not affect the visuals of my scene then I am thinking about keeping it away anyway. I should also mention, that I have just a point light and NO directional light in my scene. EDIT: I did some closer research, and yes it actually works if I set the light quality before the main loop starts. But on runtime the lights still go off. I also works for the FPS level, I just did not notice as the difference on the shadows is not that huge... Quote Link to comment Share on other sites More sharing options...
Gonan Posted April 14, 2018 Share Posted April 14, 2018 system:SetProperty is not in the api documentation, I don't know if this is by design, or an omission. If you called your function more than once, my only remaining suggestion, is to compare the quality parameter with system:GetProperty("lightquality") and if they are not equal execute the content of your function. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.