Jump to content

Set Light Quality disables lights?


Recommended Posts

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.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...