• Postprocess

Light glow

By: SKY ENGINE AI
scroll down ↓to find out morelight-glow_2_resourcesTutorial

Light Glow

In this case we will present you Light Glow postprocess step.

Agenda:

  • Light Glow theory
  • Light Glow step usage

Scene setup

Let's use custom scene composer to set up the scene.

    from skyrenderer.cases.utils import LightGlowSceneComposer
    from skyrenderer.render_chain import RenderChain
    scene_composer = LightGlowSceneComposer(antialiasing_level=64)
    scene_composer.setup_scene()
    scene_composer.renderer_context.define_render_chain(
        RenderChain(
            render_steps=[scene_composer.visible_light_render_step],
            width=1280,
            height=800,
        ),
    )
    scene_composer.visualize()
light-glow_1_resourcesTutorial
2025-02-21 13:37:04,697 | skyrenderer.scene.renderer_context |  INFO: Root paths:
- root path: /home/skyengine/anaconda/lib/python3.6/site-packages/skyrenderer
- assets path: /dli/mount/assets
- config path: /home/skyengine/anaconda/lib/python3.6/site-packages/skyrenderer/config
- gpu sources path: /home/skyengine/anaconda/lib/python3.6/site-packages/skyrenderer/optix_sources/sources
- cache path: /dli/mount/cache
- ptx cache path: compiled_ptx/ptx
- ocio path: ocio_configs/aces_1.2/config.ocio

2025-02-21 13:37:05,333 | skyalembic.archive_manager |  WARNING: Loading not adapted alembic file

2025-02-21 13:37:05,336 | skyrenderer.basic_types.provider.iprovider |  WARNING: Provider for this config has been already initialized! There should be just one Provider created per unit source, consider fixing the scene.
Config:
metal

2025-02-21 13:37:07,943 | skyrenderer.utils.time_measurement |  INFO: Setup time: 2.60 seconds

2025-02-21 13:37:08,516 | skyrenderer.basic_types.provider.unit_providers.alembic_buffer_provider |  INFO: Calculating 'position_map' and 'pdf_map' for Neon_GEOshape_NeonSE_emission, this may take a while... 


2025-02-21 13:37:08,517 | skyrenderer.basic_types.provider.unit_providers.alembic_buffer_provider |  INFO: Consider adding mesh cacher if you want to avoid waiting in the future.

2025-02-21 13:37:21,080 | skyrenderer.utils.time_measurement |  INFO: Context update time: 13.14 seconds

2025-02-21 13:37:46,266 | skyrenderer.utils.time_measurement |  INFO: Key points calculation time: 0 ms

2025-02-21 13:37:46,267 | skyrenderer.utils.time_measurement |  INFO: Render time: 25.19 seconds

Light Glow theory

Light Glow is a visual effect that simulates the soft, ambient glow surrounding a light source. This effect is used to
represent both the direct light emission from a source, and the diffuse scattering of light through the atmosphere or other media.

Light Glow step usage

The SKY ENGINE AI neon has a defined Emissive Shader material, and it is a source of mesh light.

HINT: For more information about mesh light, see: CLIENT_MeshLight tutorial.
Our neon lights up the wall behind it, but for a realistic effect we lack the dispersion of light around
the geometry of the neon. To achieve that we need a Lights Glow Postprocess step.

We define a new render chain with two steps:

  • predefined scene composer's visible light render step
  • LightGlow postprocess step
    from skyrenderer.render_chain import LightsGlowPostprocess
    light_glow = LightsGlowPostprocess(scene_composer.renderer_context)
    scene_composer.renderer_context.define_render_chain(
        RenderChain(
            render_steps=[scene_composer.visible_light_render_step, light_glow],
            width=1280,
            height=800,
        ),
    )
    scene_composer.visualize()
light-glow_2_resourcesTutorial
2025-02-21 13:37:46,829 | skyrenderer.basic_types.light.mesh_light |  WARNING: Creating light parameter provider in context which is set up - hanging link possible

2025-02-21 13:37:46,891 | skyrenderer.utils.time_measurement |  INFO: Setup time: 64 ms

2025-02-21 13:37:47,427 | skyrenderer.basic_types.provider.unit_providers.alembic_buffer_provider |  INFO: Calculating 'position_map' and 'pdf_map' for Neon_GEOshape_NeonSE_emission, this may take a while... 


2025-02-21 13:37:47,428 | skyrenderer.basic_types.provider.unit_providers.alembic_buffer_provider |  INFO: Consider adding mesh cacher if you want to avoid waiting in the future.

2025-02-21 13:38:00,106 | skyrenderer.utils.time_measurement |  INFO: Context update time: 13.21 seconds

2025-02-21 13:38:24,782 | skyrenderer.utils.time_measurement |  INFO: Key points calculation time: 0 ms

2025-02-21 13:38:24,784 | skyrenderer.utils.time_measurement |  INFO: Render time: 24.68 seconds

We can add LightsGlowPostprocess step multiple times to strengthen the effect.

    scene_composer.renderer_context.define_render_chain(
        RenderChain(
            render_steps=[scene_composer.visible_light_render_step, light_glow, light_glow],
            width=1280,
            height=800,
        ),
    )
    scene_composer.visualize()
light-glow_3_resourcesTutorial
2025-02-21 13:38:25,323 | skyrenderer.basic_types.light.mesh_light |  WARNING: Creating light parameter provider in context which is set up - hanging link possible

2025-02-21 13:38:25,385 | skyrenderer.utils.time_measurement |  INFO: Setup time: 65 ms

2025-02-21 13:38:25,913 | skyrenderer.basic_types.provider.unit_providers.alembic_buffer_provider |  INFO: Calculating 'position_map' and 'pdf_map' for Neon_GEOshape_NeonSE_emission, this may take a while... 


2025-02-21 13:38:25,914 | skyrenderer.basic_types.provider.unit_providers.alembic_buffer_provider |  INFO: Consider adding mesh cacher if you want to avoid waiting in the future.

2025-02-21 13:38:38,516 | skyrenderer.utils.time_measurement |  INFO: Context update time: 13.13 seconds

2025-02-21 13:39:03,636 | skyrenderer.utils.time_measurement |  INFO: Key points calculation time: 0 ms

2025-02-21 13:39:03,636 | skyrenderer.utils.time_measurement |  INFO: Render time: 25.12 seconds

Summary

In this section you have learnt:

  • You need to cover a geometry with EmissiveShader material definition prior to setting the LightGlow render step.
  • LightGlow postprocess step must be added after visible right render step.
  • LightGlow simulates the soft, ambient glow surrounding a light source.