Cxntrxl-OptimizedGraphicsFix icon

OptimizedGraphicsFix

A (very small) API for interacting with lighting and occlusion culling after RUMBLE 0.5's optimization changes.

By Cxntrxl
Last updated a day ago
Total downloads 14
Total rating 0 
Categories Mods
Dependency string Cxntrxl-OptimizedGraphicsFix-1.0.0
Dependants 1 other package depends on this package

README

Optimized Graphics Fix

Optimized Graphics Fix is an API to help prevent mod conflicts when changing scene lighting settings. By itself, it doesn't do anything, and requires other mods to implement it.

Current mods:

  • Advanced Structure Skins 1.3.1+

For Developers

Mod Base Class

OptimizedGraphicsFix.VerboseLogging - Set to true during development to output logs when lighting settings change. Also lists which mod applies changes and the priority of any locks applied.

Lighting

Lock(int lockPriority) - Locks lighting settings. Any mod attempting to unlock lighting settings will need to supply a priority equal to or greater than yours. Police this value yourself and use reasonable judgement.

Unlock(int lockPriority) - Unlocks lighting settings. If settings are locked under a higher priority than you supply, the unlock will fail.

UseBounceLighting(bool useBounce) - If useBounce is true, sets the ambient lighting mode to Trilight. Otherwise, it sets it back to Skybox. By default, rumble's skybox does not supply ambient lighting, causing dark shadows on custom shaders.

SetSkyLightColor(Color color) - Sets the light affecting the top surfaces of all dynamically lit objects. Leave null for default value.

SetHorizonLightColor(Color color) - Sets the light affecting the side surfaces of all dynamically lit objects. Leave null for default value.

SetGroundLightColor(Color color) - Sets the light affecting the bottom surfaces of all dynamically lit objects. Leave null for default value.

Occlusion Culling

DisableCulling() - Disables occlusion culling for all cameras in the scene (and tells the mod to disable it for all cameras in the scene on new scene load).

EnableCulling() - Sets occlusion culling back to the default value for all cameras in the scene (and stops disabling culling on scene load)