Environment scheme
|
- For an easy-level tutorial on creating an Environment Scheme, see Creating an environment scheme.
An Environment Scheme is a template that describes the Lighting properties of a Room or set of rooms. It contains parameters which are used by the rendering loop to achieve various lighting effects. These can be modified via the Environment panel on HeroBlade.
Schemes can be set to "static" or "dynamic".
Static vs Dynamic Schemes
- See also: Dynamic Sky If a scheme is set to static, its parameters are set once at design time and do not change based on the time of day. If the scheme is set to dynamic, the parameters are set to Timeline notation and change dynamically as the game day progresses.
Dynamic Environment Schemes
If a scheme is "dynamic", then the constants used to render change based on the time of day. The rate that each parameter changes is encoded in Timeline notation. A loose description of the time index meanings are as follows:
- Time index 0.0 = 6 am
- Time index 0.25= 12 pm
- Time index 0.50= 6 pm
- Time index 0.75= 12 am
- Time index 1.00 - The same as time index 0.0, midnight.
Please note that environment schemes ignore the last two parameters of a timeline, the "loop type" and "lifetime length". The loop type will always be "Loop", and the lifetime will always be "1.0". Please review the Timeline documentation.
For a dynamic scheme, we might have:
AmbientColor = [0.0:#0,0,0,1;L][0.5:#1,1,1,1;L][1.0:#0,0,0,1;L]L;1.0
This says that the AmbientColor interpolates from color #0,0,0,1 at midnight to #1,1,1,1 at noon, then back to #0,0,0,1 at midnight.
Static Environment Schemes
If a scheme is "static", then the constants used to render do not change based on the time of day. It is set to a fixed value at design time. For example, we might have:
AmbientColor = #0,0,0,1
Lighting models
Schemes support two different light models, the Ambient-Diffuse Model and the 3-Point Model.
Both light models' parameters are affected by the scheme being static or dynamic. If the scheme is static, then the color parameters are set using the Color Picker GUI, and encoded in Color notation. If the scheme is dynamic, the color parameters are set using the Timeline GUI, and the parameters are encoded in Timeline notation.
Ambient-Diffuse model
The Ambient-Diffuse Model is defined as
NdotL * DiffuseColor + AmbientColor
Here is an example of how the "Ambient" and "Diffuse" light colors affect a scene
3-Point model
A 3-point lighting model is a way to define the light color at the front, side, and back of an object.
The 3-Point Model is defined as
if(NdotL > 0) { return lerp(SideColor,FrontColor,NdotL); } else { return lerp(SideColor,BackColor,-NdotL); }
Here is an example of how "Front", "Side", and "Back" light colors affect a scene
High Dynamic Range (HDR) Lighting
HDR is a style of rendering that allows for lighting calculations to be performed in a larger dynamic range. In a sense allowing for dark things to be dark and bright things to be bright without sacrificing details- Glare Type - The pattern in the glare of the HDR.
- Key Value - Essentially a brightness factor
- Adaption Multiplier - Essentially effect how long it takes for the lighting to "return to normal"
- Bloom Scale - A scaling value for the blooming effect
- Star Scale - A scaling value for the pattern
More Info on HDR in the HeroEngine
Fog
The fog model supports five parameters. If the scheme is dynamic, each parameter is stored in Timeline notation, and selected with the Timeline GUI.
- Color - The color of the fog.
- Min Density - This is the minimum amount of fog present in the entire scene.
- Max Density - This is the maximum amount of fog present in the entire scene.
- Ramp Start - This is the distance in units that the fog starts linearly interpolating from "Min Density" to "Max Density".
- Ramp Length - This is the distance in units it takes for the fog to ramp from "Min Density" to "Max Density".