The Render Settings include values for a range of visual elements in Scene, such as fog and ambient light.
Set a global texture property.
--Create a shader first and define it "half _Mult".
--Use "_Mult" as "_Metallic" and delete "_Metallic".
--set value and put on a gameobject
Space.RenderSettings.SetGlobalShaderTexture("_TestTex",Space.Resources[3])
Set a global float property for all shaders.
--Create a shader first and define "sampler2D _TestTex".
--Use "_TestTex" as "_MainTex" and delete "_MainTex".
--set value and put on a gameobject
Space.RenderSettings.SetGlobalShaderFloat("_Mult",1)
Set a global color property for all shaders.
--create a shader first and define "fixed4 _TestColor"
--use "_TestColor" as "_Color" and delete "_TestColor".
--set value and put on a gameobject
Space.RenderSettings.SetGlobalShaderFloat("_TestColor",Color.Red)
Set a global color property for all shaders.
--set value and put on a gameobject
Space.RenderSettings.SetGlobalShaderFloat("_TestVector",Vector.One)
Cubemap resolution for default reflection.
Space.RenderSettings.DefaultReflectionResolution=256
--get value.
The global skybox to use.
Space.RenderSettings.Skybox=Space.Resources[1].AsMaterial
--get value.
--clicking this object will toggle between two Skyboxes --[Add 2 materials to the first two Resource slots in Scripting Runtime component] thisGameObject = Space.Host.ExecutingObject OnClick = function() if Space.RenderSettings.Skybox==Space.Resources[1].AsMaterial then Space.RenderSettings.Skybox=Space.Resources[2].AsMaterial else Space.RenderSettings.Skybox=Space.Resources[1].AsMaterial end end thisGameObject.AddClickable() thisGameObject.Clickable.OnClick(OnClick)
The fade speed of all flares in the Scene.
Space.RenderSettings.FlareFadeSpeed=5
--get value.
The intensity of all flares in the Scene.
Space.RenderSettings.FlareStrength=1
--get value.
Size of the light halos.
Space.RenderSettings.HaloStrength=1
--get value.
The number of times a reflection includes other reflections.
Space.RenderSettings.ReflectionBounces=5
--get value.
How much the skybox / custom cubemap reflection affects the Scene.
Space.RenderSettings.ReflectionIntensity=1
--get value.
The color used for the sun shadows in the Subtractive lightmode.
Space.RenderSettings.SubtractiveShadowColor=Color.Red
--get value.
How much the light from the Ambient Source affects the Scene.
Space.RenderSettings.AmbientIntensity=1
--get value.
Flat ambient lighting color.
Space.RenderSettings.AmbientLight=Color.Blue
--get value.
Ambient lighting coming from below.
Space.RenderSettings.AmbientGroundColor=Color.Green
--get value.
Ambient lighting coming from the sides.
Space.RenderSettings.AmbientEquatorColor=Color.Green
--get value.
Ambient lighting coming from above.
Space.RenderSettings.AmbientSkyColor=Color.White
--get value.
Ambient lighting mode.
Space.RenderSettings.AmbientMode=0
--Skybox = 0.
--Trilight = 1.
--Flat = 3.
--Custom = 4.
The ending distance of linear fog.
Space.RenderSettings.FogEndDistance=300
--get value.
The starting distance of linear fog.
Space.RenderSettings.FogStartDistance=10
--get value.
The density of the exponential fog.
Space.RenderSettings.FogDensity=10
--get value.
Ambient lighting mode.
Space.RenderSettings.FogMode=2
--Linear = 1.
--Exponential = 2.
--ExponentialSquared = 3.
The color of the fog.
Space.RenderSettings.Fog=true
--get value.
How much the light from the Ambient Source affects the Scene.
Space.RenderSettings.AmbientSkyboxAmount=10
--get value.
Ambient lighting mode.
Space.RenderSettings.DefaultReflectionMode=1
--Skybox = 0.
--Custom = 1.
--get value.
|