Lighting is the simulation of light in the graphics scene of a place, and is part of the rendering engine. The Lighting service provides the ability to manipulate lighting. Designing lighting is often important in development.
The main features of lighting are the environment, global lighting, dynamic lighting and post-processing effects. In the context of parts, materials sets how the parts' surfaces respond to light. Custom PBR textures from images are supported. There are also special effects related to parts such as ParticleEmitters.
There are limitations of lighting such as the 60 studs limit on the dynamic light range and lack of screen space reflections and ray tracing support found in other contemporary engines like Unity.[1][2]
History[]
Lens flare was introduced as a built-in lighting effect which would be later removed in late 2007.
On January 28, 2011, Roblox introduced ambient shadows (screen space ambient occlusion) which is enabled at high graphics level setting and disabled at lower graphics levels.[3]
On January 20, 2012, a blog post was published that showcased prototype dynamic lighting for a Hack Week project.[4] On February 7, 2013, a blog post was published on prototype using voxels to generate lighting and shadows.[5] On April 15, 2013, Shedletsky uploaded a video showcasing games making use of dynamic lighting on a testing site.[6] On May 9, 2013, dynamic lighting would be released with voxel-based lighting and shadows as well as new light sources,[7] which would also receive shadows on September 30, 2013.[8] On May 29, 2014, stencil shadows would be replaced by a blob system that would be fused with voxel-based shadows.[9]
On April 4, 2013, bevels were removed for performance reasons. Furthermore, a blog post was published stating that "they hurt performance and don't fit our vision for the future look of ROBLOX".[10]
On June 6, 2014, Roblox introduced dynamic reflections which allows reflective objects and water to reflect the sky dynamically through the use of cube mapping. Previously, reflections would only reflect the sky itself without any changes such as the time of day.[11]
In April 2015, Roblox introduced particle emitters.[12]
On December 21, 2015, zeuxcg uploaded a video showcasing a new lighting system with features such as HDR rendering and smaller voxels.[13] On December 19, 2016, as a project of Hack Week 2016, zeuxcg uploaded another video showcasing the lighting system with voxels replaced by shadow mapping and would be known as Future Is Bright.[14][15] In 2017, an article was published covering comparisons between voxels and shadow mapping in aspects of lighting, both quality and performance, with a conclusion hinting that a hybrid of both would be used.[16] On October 3, 2018, the new lighting system would be introduced as a beta feature. The lighting system would enabled through the Technology mode ("Voxel") while the old system would have its own Technology mode ("Legacy").[17] The new lighting system would be released on December 3 as the first phase of Future Is Bright.[18] On January 28, 2019, the Compatibility mode would also be introduced which would use the same system as Voxel but it would approximately recreate the Legacy mode.[19] On July 17, 2019, the Legacy mode would be deprecated and the old lighting system would be disabled in favor of the new lighting system for performance and maintenance reasons.[20] On April 18, 2019, phase 2 of Future Is Bright was announced as a Roblox Studio beta feature[21], introducing shadow mapping to directional light as "ShadowMap" mode and two properties for controlling its shadows: Lighting.ShadowSoftness and BasePart.CastShadow, which would be released on May 10, 2019.[22] On January 10, 2020, phase 2.5 was released which implemented the PBR model and switched to a new specular BRDF. Two new properties were added to Lighting: EnvironmentDiffuseScale for diffuse light and EnvironmentSpecularScale for specular light.[23] On June 23, 2020, phase 3 was announced as a beta feature[24], introducing the Future Technology mode which adds shadow mapping and specular highlights to local lights, which would be released on November 19, 2020.[25]
On January 21, 2016, a Hack Week blog post was published featuring a prototype service known as EffectsManager, which could allow developers to add custom pixel shaders through a special type of local scripts containing HLSL code, which would be parented to the service.[26] Although the feature had not been introduced, in May 2016, Roblox introduced post-processing effects, some of which would use the effects similarly found in the hack week, and a form of anti-aliasing known as MSAA.[27][28]
On April 22, 2020, Atmosphere was introduced.[29]
On November 13, 2020, a DevForum post announced a series of updates around clouds known as Dynamic Skies with three main phases. Phase 1 introduces Clouds while Phases 2 and 3 will introduce more controls and allow flying through and above clouds.[30]
In January 2021, ambient shadows were switched to Horizon-Based Ambient Occlusion.[31]
On March 17, 2021, environment probe known as EnvMap was introduced as a beta feature which simulates indirect lighting, improving indoor lighting.[32] EnvMap would be released on July 21, 2021.[33]
On the week of Oct. 21st, 2024, Compatibility lighting will be removed from Roblox Studio & will be replaced with Voxel.
Environment[]
The environment of lighting has three main features: the sky, atmosphere and clouds. The environment also affects diffuse and specular light. Most aspects of the environment is affected by the time of day which can be controlled through Lighting's TimeOfDay (string) or ClockTime (number) property.
Sky[]
The sky has two features: the sky itself and the celestial bodies including the sun, the moon and the stars. Sky is used to replace the sky's appearance with other images, and is also used to change the appearance of celestial bodies as well as disable them. The Atmosphere's effect is affected by the sky. Clouds provide an alternative option to using sky images with clouds. Sky is affected by the time of day, turning dark at night and turning bright at day.
Atmosphere[]
There are two ways to create lighting atmosphere including fog:
- Lighting has two properties: FogEnd and FogStart, both of which change the range of the fog and is the most basic way to create fog.
- Atmosphere provides more advanced fog than the basic fog. Atmosphere must be parented to Lighting and there must be at least one Sky in Lighting in order to for Atmosphere to affect the lighting. Atmosphere reflects the sky and simulates fog better than the basic fog.
Clouds[]
- See also: Procedural Skies
Clouds adds clouds to lighting when parented to Terrain. The clouds appearance can be changed by the Clouds properties. Clouds affect the brightness of the directional source.
Light[]
Light can be separated into two categories: global lighting which pertains to the environment and dynamic lighting which pertains to parts. Roblox also features HDR rendering. The ExposureCompensation property of Lighting controls how much light is rendered. In order to save performance, local lighting and shadows are only rendered within a certain range.
Global lighting[]
Global lighting covers light in a global scale i.e. not casted from objects. There are three main sources of global lighting: directional, ambient and environmental light. Many properties of global lighting can be changed through Lighting.
Directional[]
Apart from the sky, both the sun and the moon cast a directional source. There is only one source and it is shared by both. Lighting can be used to change the time of day and latitude, both of which will change the direction of the source, the brightness of the source and the color of top and bottom surface lighting.
Ambient[]
There are two types of ambient light: ambient light itself and outdoor ambient light. Ambient light illuminates all of the objects uniformly. The Ambient property of Lighting can be used to change the color of light with the value component being the brightness of the light. Outdoor ambient light illuminates outdoor surfaces but also casts shadows indoors, which is enabled through the GlobalShadows property. The OutdoorAmbient property also changes the color of outdoor light. Environmental light may be used instead of outdoor ambient light as well as ambient light itself for more realistic approach to lighting.
Environmental[]
Environmental light is made up of diffuse light and specular light, and is derived from the environment, providing approximate global illumination. The EnvironmentDiffuseScale property and the EnvironmentSpecularScale property of Lighting can be used to change both of light, respectively. Diffuse light is casted from the environment while specular light affects reflection of materials on the environment. Specular light can be thought of as enabling reflections.
Indoor environmental light technically comes from an image automatically generated by an environment probe (or a cube map) known as EnvMap. Specular light are most visible indoors and often resembles reflections. Because of how environment probes behave, specular light are not suitable for mirror-like objects. There can be one or two probes at a time. The engine automatically chooses where to place the probe, preferably in the center of a "room". For moving between rooms, two are used to blend between the old probe and the new probe.[34]
Dynamic lighting[]
- Main article: Dynamic lighting
Dynamic lighting is a feature where any light including directional light can cast shadows. Dynamic lighting also introduces local sources of light parented to a part or an Attachment which can be created through the three light classes:
- PointLight represents a point source that emits light in all directions. An example of this light is a light bulb.
- SpotLight represents a point source that emits light in a directed cone. An example of this light is a flashlight.
- SurfaceLight represents a surface source that emits light. An example of this light is a screen.
The Lighting's GlobalShadows property can enable and disable shadows from directional and diffuse light. Local lights also have the Shadows property that can be used to toggle shadows being casted. Parts also have the CastShadow property which can be used to enable and disable shadows of an individual part, often used to improve performance such as turning off shadows for grass meshes.
Technology[]
The engine uses different types of light technology which can be changed through the Technology property of Lighting, although the property is only temporarily used for transitioning places to newer technology as a process of the Future Is Bright development update.
Voxel[]
The engine uses voxels to simulate shadows casted by diffuse and outdoor ambient light, with each voxel measuring 4 studs (in a square), similar to that of Terrain. In Technology modes except for Future, voxel simulates shadows (except for character shadows which uses different technology, which is mostly shadow mapping).
ShadowMap[]
The engine uses shadow mapping to render sun shadows casted by the directional source in ShadowMap mode. However, the light and shadows from any light sources remains voxelised. On shadowed out areas, objects use voxelised shadows to render realistic shadings on walls and/or floors. Shadow mapping is visible in certain conditions according to the graphics level setting. In low graphics levels, shadow mapping is replaced with voxels.
Future[]
The engine gains shadow mapping on any light sources, making lights feel smoother and realistic. Object also gain environment mapping, also known as reflection mapping, which allows them to be able to reflect any light sources. Shadow mapping is visible in certain conditions according to the graphics level setting. In low graphics levels, shadow mapping is replaced with voxels.
Comparisons between modes[]
Technology | Directional | Dynamic lighting | Enviornment Mapping |
---|---|---|---|
Future | Shadow mapping* | Shadow mapping* | Yes |
ShadowMap | Shadow mapping* | Voxel | No |
Voxel | Voxel | Voxel | No |
* = will fall back to voxels if the range is far enough according to the client's graphics level setting.
Gallery[]
Removed lighting modes:
Post-processing effects[]
Roblox features some post-processing effects:
- DepthOfFieldEffect applies depth of field effect.
- BloomEffect applies the bloom effect.
- BlurEffect applies Gaussian blur.
- ColorCorrectionEffect controls the appearance of the scene.
- SunRaysEffect applies a halo of light from the sun.
Parts[]
Materials[]
- Main article: Material
The Material property affects the appearance of parts. Custom PBR textures from images are supported through SurfaceAppearance and MaterialVariant instances.
Special effects[]
Roblox features a set of special effects:
- ParticleEmitter emits particles of 2D images.
- Unlike ParticleEmitter, Beam uses Attachments to create a beam between both of the attachments.
- Trail uses Attachments to emit a trail from a line formed by both of the attachments.
Limitations[]
Unlike other engines such as Unity, lighting in Roblox has some limitations and the lack of features:
- There is a limit of 60 studs for local lights.
- There is a feature request about this limitation in which a Roblox staff member replied that there are technical challenges on high range lights.[35]
- There is no ability to add directional lights.[36]
- There is no ability to change the appearance of the sky other than changing the images, e.g. for smooth transition.[37]
- Roblox does not support screen space reflections other than the Water material.
- A Roblox staff post states that SSR can only run smoothly on high end devices.[38]
- Roblox does not have real-time ray tracing support which is available in other games like Battlefield V.
Trivia[]
This section is a trivia section. Please relocate any relevant information into other sections of the article.
- Oddly, UnionOperations, MeshParts, and parts (if they're in a model that has Humanoid on it) do not cast voxelised shadows. It's unknown if this is intentional, or for performance purposes.
References[]
- ↑ https://docs.unity3d.com/560/Documentation/Manual/PostProcessing-ScreenSpaceReflection.html
- ↑ https://unity.com/ray-tracing
- ↑ https://web.archive.org/web/20220616133237/https://blog.roblox.com/2011/01/let-your-dim-light-shine-ambient-shadows/
- ↑ https://web.archive.org/web/20220113005005/https://blog.roblox.com/2012/01/tech-demo-dynamic-lighting-exploration/
- ↑ https://web.archive.org/web/20220316190548/https://blog.roblox.com/2013/02/dynamic-lighting-and-shadows-the-voxel-solution/
- ↑ http://www.youtube.com/watch?v=UGNF_LhXBko
- ↑ https://web.archive.org/web/20220814085908/https://blog.roblox.com/2013/05/lights-on-dynamic-lighting-and-shadows-are-here/
- ↑ https://web.archive.org/web/20220517200750/https://blog.roblox.com/2013/09/dynamic-lights-now-support-shadows/
- ↑ https://web.archive.org/web/20220817171700/https://blog.roblox.com/2014/05/character-shadows-get-the-dynamic-lighting-treatment/
- ↑ Gemlocker (2013, April 4). "Bye Bye Bevels: The First Step Toward Our New Look". From Roblox Blog. Accessed February 26, 2023. Archived from the original on March 23, 2022.
- ↑ https://web.archive.org/web/20220603220904/https://blog.roblox.com/2014/06/environment-maps-bring-dynamic-reflections-to-roblox/
- ↑ https://web.archive.org/web/20220112015521/https://blog.roblox.com/2015/04/explore-the-endless-possibilities-of-custom-particles/
- ↑ https://www.youtube.com/watch?v=z5TmqDtpwSM
- ↑ https://www.youtube.com/watch?v=lrvOGqC9ZjQ
- ↑ https://web.archive.org/web/20220612061852/https://blog.roblox.com/2017/01/hack-week-2016-imagining-future-roblox/
- ↑ https://roblox.github.io/future-is-bright/compare
- ↑ https://devforum.roblox.com/t/future-is-bright-phase-1-studio-beta/182687
- ↑ https://devforum.roblox.com/t/future-is-bright-phase-1-released/207935
- ↑ https://devforum.roblox.com/t/deprecating-lightinglegacy-introducing-lightingcompatibility/232667
- ↑ https://devforum.roblox.com/t/compatibility-replacing-legacy-on-17th-of-june-2019/269872/70
- ↑ https://devforum.roblox.com/t/future-is-bright-phase-2-studio-beta/269370
- ↑ https://devforum.roblox.com/t/future-is-bright-phase-2-released/278531
- ↑ https://devforum.roblox.com/t/future-is-bright-phase-25-released/429543
- ↑ https://devforum.roblox.com/t/future-is-bright-phase-3-studio-beta/639903
- ↑ https://devforum.roblox.com/t/future-is-bright-phase-3-released/878634
- ↑ https://web.archive.org/web/20211015170000/http://blog.roblox.com/2016/01/hack-week-2015-shaders/
- ↑ https://www.youtube.com/watch?v=Xoj5KI4Sbr4
- ↑ https://web.archive.org/web/20220221011922/https://blog.roblox.com/2016/05/a-whole-new-world-roblox-adds-post-effects-and-anti-aliasing/
- ↑ https://devforum.roblox.com/t/release-notes-for-429/537322/2
- ↑ https://devforum.roblox.com/t/dynamic-skies-are-getting-cloudy/869476
- ↑ https://devforum.roblox.com/t/horizon-based-ambient-occasion-hbao-issues/972390
- ↑ https://devforum.roblox.com/t/indoor-dynamic-environment-maps-beta/1115802
- ↑ https://devforum.roblox.com/t/better-indoor-reflections-live-for-future-lighting/1365721
- ↑ https://devforum.roblox.com/t/indoor-dynamic-environment-maps-beta/1115802
- ↑ https://devforum.roblox.com/t/increase-range-limit-of-lights/68336/112
- ↑ https://devforum.roblox.com/t/directionallight/22669
- ↑ https://devforum.roblox.com/t/add-the-ability-to-modify-the-skybox-color-and-brightness/394566
- ↑ https://devforum.roblox.com/t/better-indoor-reflections-live-for-future-lighting/1365721
External links[]
Programming |
| ||||||
---|---|---|---|---|---|---|---|
Design | |||||||
Assets | |||||||
Tools | |||||||
Monetization | |||||||
Analytics | Developer Stats · Monthly active users (MAU) | ||||||
Advertising | |||||||
Resources |