From 0e65a1ddd671de4835676e80776bbe9dd13465e9 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+AgentXLP@users.noreply.github.com> Date: Sat, 6 Dec 2025 23:57:29 -0500 Subject: [PATCH] Update lighting engine documentation --- docs/lua/guides/lighting-engine.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/lua/guides/lighting-engine.md b/docs/lua/guides/lighting-engine.md index 1805a4201..8c5e0e69c 100644 --- a/docs/lua/guides/lighting-engine.md +++ b/docs/lua/guides/lighting-engine.md @@ -8,25 +8,29 @@ The Lighting Engine is a vertex point lighting system built directly into sm64co To use the Lighting Engine, you need to figure out how you want to approach using it given the different modes it has. There are also 2 methods to enable the lighting engine, either by setting the ambient color, or spawning a point light in. +If you want to make a vertex buffer not be affected by the lighting engine even when it's enabled, you can use `gsSPVertexNonGlobal` in the displaylist instead of `gsSPVertex`. This tells the renderer to not apply any of the effects Lua can do. + ## Section 2: Modes The lighting engine has 3 modes you can switch between using `le_set_mode(mode)`. -1. `LE_MODE_AFFECT_ALL_SHADED_AND_COLORED`: (Default) Applies lighting to every shaded and vertex colored surface minus some geometry and menus. +1. `LE_MODE_AFFECT_ALL_SHADED_AND_COLORED`: Applies lighting to every shaded and vertex colored surface minus some geometry and menus. 2. `LE_MODE_AFFECT_ALL_SHADED`: Applies lighting to every shaded surface minus some geometry and menus. -3. `LE_MODE_AFFECT_ONLY_GEOMETRY_MODE`: Only applies lighting to geometry that has the `G_LIGHTING_ENGINE_EXT` geometry mode. +3. `LE_MODE_AFFECT_ONLY_GEOMETRY_MODE`: **(Default)** Only applies lighting to geometry that has the `G_LIGHTING_ENGINE_EXT` geometry mode. `LE_MODE_AFFECT_ONLY_GEOMETRY_MODE` was the only "mode" until djoslin0 improved the lighting engine and came up with a system for affecting shaded surfaces without needing to apply the lighting engine geometry mode to every actor and level manually. +I recommend you use `LE_MODE_AFFECT_ALL_SHADED_AND_COLORED` since that generally covers everything and doesn't require any additional effort like manually adding the lighting engine flag to everything. + ## Section 3: Tonemapping The lighting engine has 4 tonemapping modes you can switch between using `le_set_tone_mapping(toneMapping)`. 1. `LE_TONE_MAPPING_TOTAL_WEIGHTED`: Weighs the combined ambient color and lights together, can look slightly dim. -2. `LE_TONE_MAPPING_WEIGHTED`: (Default) Weights the lights on top of the ambient color instead of with it, generally looks the best with good color balance. +2. `LE_TONE_MAPPING_WEIGHTED`: **(Default)** Weights the lights on top of the ambient color instead of with it, generally looks the best with good color balance. 3. `LE_TONE_MAPPING_CLAMP`: The sum of the lights and ambient color clamped between 0 and 255. Colors can look overexposed if lights are too bright. @@ -94,4 +98,4 @@ You can also make your own light behavior and call `bhv_point_light_init()` and | `le_get_light_intensity(id)` | Gets a lighting engine point light's `intensity` | | `le_set_light_intensity(id, intensity)` | Sets a lighting engine point light's `intensity` | | `le_get_light_use_surface_normals(id)` | Gets whether a lighting engine point light will use a surface's normals to determine its brightness with `useSurfaceNormals` | -| `le_set_light_use_surface_normals(id, useSurfaceNormals)` | Sets whether a lighting engine point light will use a surface's normals to determine its brightness with `useSurfaceNormals` | \ No newline at end of file +| `le_set_light_use_surface_normals(id, useSurfaceNormals)` | Sets whether a lighting engine point light will use a surface's normals to determine its brightness with `useSurfaceNormals` |