Classic Marathon Infinity

Classic Marathon Infinity

Not enough ratings
Raytraced Baked Lighting (Script)
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
80.120 KB
Sep 10 @ 3:05pm
1 Change Note ( view )

Subscribe to download
Raytraced Baked Lighting (Script)

Description
Features:
- Enjoy the novelty of browsing existing maps with ray traced baked lighting.
- Destroy light scenery to change level brightness dynamically in-game.
- Use the script as a 1st-pass lighting aid when designing new levels. Various configurables for mappers in script file.
(This script will never replace the intentional artistic touch of mappers given the constraints of the game engine.🤗)

How to Use Script:
1) (Optional) Open script in text editor, and adjust CONFIG values.
2) Start 'Classic Marathon Infinity' and select 'Raytracing_Baked_Lighting' as the Solo Script.
3) In-game: Press the Aux Trigger, (Default: ` ) to start the baking process.
4) The screen will print-out progress. This may take a while on complex maps. Once complete, the lighting on all surfaces will be updated.
5) Use the Action Trigger (Default: Tab) to switch post-bake modes.
Hold the Aux Trigger and use the Weapon Cycle keys (Default: Mouse Wheel) to adjust exposure, gamma, or blending up or down.
6) (Optional) Save the level's applied lighting with ".save level Level_Name" using in-game console.

Important: While existing lights indexes will not be adjusted by the script, the reassignment of surfaces with new lights may render levels unbeatable


How Script Functions:
1) User configures which scenery, media, and textures are ray emitters. [By Default, if it 'looked' emissive, I made it emissive]
2) Rays are cast from emitters. Rays hit surfaces and deposit all their energy. Rays are then diffusely regenerated from collided surfaces with less energy. Rays are allowed to 'bounce' a specified number of times.
3) After all ray collisions are completed, the histogram of all surface's irradiance (Energy-Per-Surface/Surface-Area) is remapped to a 0-100% light intensity value.
4) The closest available light indexes are determined for the targeted light intensities, and then those light indexes are applied to the surfaces. The initial automatic Log-Avg exposure tries its best to preserve highlights/shadows but it isn't perfect for every map design.

Other Notes:
1) By default, the ray tracing will replace all the level's original lights. However, the user can configure how much the ray traced light intensity will blend with the original light intensity. The user can also opt for only the brighter of the lights to be chosen. This is especially useful if 'scenery only' emitters, such as scenery lights, are chosen to be used.

2) 'Landscapes' are considered infinitely far away, and so do not bounce rays, nor accumulate energy. However, they can be emitters, such as for outdoor levels. For time-of-day simulation, landscapes specifically can be configured to emit rays at a fixed angle, rather than diffusely.

3) The script will generate new lights for a smoother gradient of possible light values. Lights with 'Constant' intensity across all 'Active' states [Weland default] will be reused in this gradient generation. The downside is this will lead to new light indexes that are not ascending with light intensity. Mappers are encouraged to turn off the 'Create New Lights' option in the CONFIG and manage the light indexes manually. The script will assign existing light indexes closest to the targeted intensity.

4) Adjusting the 'brightness' within the CONFIG changes the amount of rays generated for that emitter. Fewer rays generated = Less energy deposited. If too few rays are generated then adjacent surfaces can look 'spotty' and disjointed due to large differences in energy accumulated. [Example: Receiving 1 ray vs 2 rays total would be a 100% difference in energy]. Optimally, a HUGE amount of rays are used, so the relative energy differences between surfaces reaches a steady-state.

5) Emitters surfaces will bounce rays and receive energy but all emitters will be set to 100% light intensity at the end. This improves map contrast.

Feel free to edit/modify/improve script. Attribution appreciated, but not required.
Popular Discussions View All (1)
0
Sep 10 @ 3:56pm
Feature Requests Discussion
Zott