Let There Be (Unified) Light! Unified Lighting Enters Studio Beta

I love this update. But since Future the lighting service takes time before the shadows are applied. Is there a way to expose a variable when lighting service state is fully initialized?

When running Future or Unified the game takes several seconds until the quality of the light is fully rendered. While waiting you have the default lighting. A simple wait is not good as some devices may take longer than a fixed value.

For ex see: Waiting for Lighting to Reach Max Quality

Perhaps something like the following?

local Lighting = game:GetService("Lighting")
local targetTechnology = Enums.LightingQuality.REALISTIC
local realisticLightingLoaded = false

local function waitForLightingTechnology(technology)
   local conn
   conn = Lighting.LightQualityChanged:Connect(function(quality: Enums.LightingQuality)
          if(quality == technology) then
                 realisticLightingLoaded = true
          end
   end)
end


-- this is useful for if we want to make a loading screen and wait for lighting to properly render
-- SHOW LOADING SCREEN CODE HERE
waitForLightingTechnology(targetTechnology)
print("Lighting is fully loaded with", targetTechnology, "technology!")
-- HIDE LOADING SCREEN CODE HERE

Or simply even

-- SHOW LOADING SCREEN CODE HERE
-- wait for lighting to load
game.LightingService.RealisticRendered:Wait()
-- HIDELOADING SCREEN CODE HERE
1 Like