Lighting & Shadows
Lights💡can be set up as objects in the .scn
(Scene) file.
Breakdown​
Type​
- Object type, in this case
application/light
Content options​
lightType
:​
ambient
directional
point
spot
rectArea
hemisphere
args
: [RGB color, intensity]
​
point
:[RGB color, intensity, distance, decay]
spot
:[RGB color, intensity, distance, angle, penumbra, decay]
rectArea
:[RGB color, intensity, width, height]
hemisphere
:[Sky RGB, Ground RGB, intensity]
position
: [x, y, z]
​
shadow
: [side, mapSize, near, far, bias, normalBias]
​
note
Shadows only work with directional
point
and spot
lights
Code Example:​
{
"type": "application/light",
"content": {
"lightType": "directional",
"args": [[255, 255, 255], 5],
"position": [1, 2, 3],
"shadow": [50, 4096, 0.1, 1000, 0, 0.2]
}
}
tip
Good to know:​
ambient
does not require aposition
, since it illuminates the entire scene.