Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //From my Amnesia Rebirth Tutorial Series
- //Episode 20 Advanced Lighting Pt.2! Light Functions!
- //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
- //-----------------------------------------------------------
- //Set a light to be visible or not visable.
- Light_SetVisible("light_5", false);
- //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light), wildcards supported.
- //active (bool)- whether or not the light should be visible.
- //Set a light's brightness
- Light_SetBrightness("Light_Box_1", 0.0f);
- //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light), wildcards supported.
- //brightness (float)- the brightness that the light should be set to.
- //Fade a light's to a new brightness over a period of time
- Light_FadeBrightnessTo("Light_Box_1", 0.0f, 5.0f, eEasing_Linear);
- //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light), wildcards supported.
- //brightness (float)- the brightness that the light should be set to.
- //fadeTime(float)- the amount of time that the light take to reach the new brightness.
- //easingType (eEasing)- the method at which the light should fade away, default is eEasing_Linear which will fade the light linearly.
- //Fade light to a new color and radius, to find color values you can look at a color wheel online https://www.colorspire.com/rgb-color-wheel/
- Light_FadeTo("light_*", cColor(1.0, 0.0, 0.0), 2.0f, 2.0f);
- //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light), wildcards supported.
- //lightColor (cColor)- the color that the light should be (you can specify one of the 4 default colors by using cColor_White, cColor_Red, cColor_Green, cColor_Blue instead).
- //radius (float)- the new radius of the light.
- //fadeTime(float)- the amount of time that the light take to reach the new radius.
- //Place a light in the level that will flash in and out once, to find color values you can look at a color wheel online https://www.colorspire.com/rgb-color-wheel/
- LightFlash_Add(5.0f, 1.0f, 1.0f, Map_GetEntity("relic_room_gate_1").GetPosition(), cColor(1.0, 0.0, 1.0), 10.0f, 1.0f);
- //flashDuration (float)- the amount of time the flash of light should remain in the level
- //fadeInTime (float)- the amount of time that the light should fade into full brightness.
- //fadeOutTime (float)- the amount of time that the light should fade out into being off.
- //position3D (cVector3f)- the coordinates that the light should flash at (you can specify coordinates by using cVector3f(0.0, 0.0, 0.0)).
- //lightColor (cColor)- the color that the light should be (you can specify one of the 4 default colors by using cColor_White, cColor_Red, cColor_Green, cColor_Blue instead).
- //radius (float)- the radius of the light that will flash.
- //brightness (float)- the brightness that the light should be set to.
- //Setup flickering on one or more lights
- Light_SetupFlicker(...);
- //Values to pass in are the exact options as in the level editor under the flicker tab starting with lightName(can be a wildcard), onMinTime, OnMaxTime, onSoundFileName, onPSFileName, etc.
- //Note: the sound and ps names can be empty strings ""
- //Activate flicking on a light, the light specified should have already been setup by using the Light_SetupFlicker function or have values set in the level editor under the flicker tab
- Light_SetFlickerActive("light_5", true);
- //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light), wildcards supported.
- //active (bool)- whether or not this effect should be activated.
- //Get the current brightness of a light
- Light_GetBrightness("Light_Box_1");
- //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light).
- //Fade light's brightness back to its original value
- Light_FadeBrightnessToDefault("Box_Light_1", 5.0f, eEasing_Linear);
- //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light), wildcards supported.
- //fadeTime(float)- the amount of time that the light take to reach the new brightness.
- //easingType (eEasing)- the method at which the light should fade away, default is eEasing_Linear which will fade the light linearly.
- //Get a light's original brightness
- Light_GetDefaultBrightness("Box_Light_1");
- //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light).
- //Enable or disable a spotlight's ability to cast shadows
- Light_SetCastShadows("Spot_Light_1", false);
- //lightName (String)- name of a spot light as it appears in your level editor (can only be a spot light).
- //Enables "cheap" rendering for a light that uses a gobo
- Light_SetCheapGobo("Light_Point_3", true);
- //lightName (String)- name of the light as it appears in your level editor (can be a box, point or spot light), wildcards supported.
- //active (bool)- whether or not this effect should be activated.
Advertisement
Add Comment
Please, Sign In to add comment