Game Lighting Help

Alright so I want to make it where when clicking a GUI it changes the Technology to Compatibility and when pressed again it changes back to Future.

The issue is I don’t know how to make it to where you can change Technology or if it’s even possible. Can’t find anything regarding my issue.

Here’s an example but with EnvironmentDiffuseScale and Shadows

local shadows = script.Parent.Shadows
local reflections = script.Parent.Reflections
local depthOfField = script.Parent.DepthOfField
local bloom = script.Parent.Bloom

shadows.MouseButton1Click:Connect(function()
	if game.Lighting.GlobalShadows == false then
		shadows.Text = 'Shadows: ON'
		game.Lighting.GlobalShadows = not game.Lighting.GlobalShadows
	else
		shadows.Text = 'Shadows: OFF'
		game.Lighting.GlobalShadows = not game.Lighting.GlobalShadows
	end
end)

reflections.MouseButton1Click:Connect(function()
	if game.Lighting.EnvironmentDiffuseScale == 1 then
		reflections.Text = 'Reflections: OFF'
		game.Lighting.EnvironmentDiffuseScale = 0
		game.Lighting.EnvironmentSpecularScale = 0
	else
		reflections.Text = 'Reflections: ON'
		game.Lighting.EnvironmentDiffuseScale = 1
		game.Lighting.EnvironmentSpecularScale = 1
	end
end)

If anyone could help me it would be appreciated greatly.

2 Likes

You can’t change the lighting engine during runtime, instead if you wanted to disable shadows you would need to loop over every BasePart in the workspace and set the CastShadows bool to false.

EDIT: game.Lighting.GlobalShadows is what you should do to disable shadows, my bad.

roblox needs to enable client side technology, shadows can help by disabling them but it’s still not the best if you know what I mean.

I don’t know what you mean, if you are doing this performance reasons then ask players to decrease their graphics settings.