-
Notifications
You must be signed in to change notification settings - Fork 224
Cars – Local cubemaps
Local cubemaps is a trick allowing to improve reflections on spherical-looking objects by taking a snapshot of the whole car around them and using it as a mask for reflections on that object. Here is the whole thing in action:
Those Caterham headlights are a great example. Even SSLR can’t handle them properly, and without car reflected in those headlights, they look like some distant floating blobs.
-
It’s only meant for spherical-like objects of relatively small size, like those headlights. Since it takes a spherical shot around some point and uses it to mask reflections, it’s not going to help with anything else, like chrome bumpers or bonnet.
-
Meshes with local cubemap reflections should originally have “ksPerPixelMultiMap” shader, or shading will get messed up. If you need some features of other shaders, please let me know.
-
Due to heavy caching, rare updates and overly simplified rendering of that mask, the whole thing doesn’t affect FPS that much. And with disabled dynamic local cubemaps in Reflections FX settings, the whole thing is pretty much zero FPS cost.
There are a couple of ways to use this feature. If it’s case with headlights, there is a template file “oldschool_lights_reflections.ini” designed to simplify the whole setup process (setting up two local cubemaps for left and right headlights):
[INCLUDE: common/oldschool_lights_reflections.ini] ; including template which will do most of the work
MeshesLeft = headlightL ; list of meshes on the left side, optional
MeshesRight = headlightR ; list of meshes on the right side, optional
MeshesToCut = headlights ; list of meshes to be cut (in case there is a single mesh for both
; left and right headlights)
SplitAxis = 1, 0, 0 ; needed only if MeshesToCut is used, axis for splitting (in case mesh
; is rotated strangely)
SplitThreshold = 0 ; needed only if MeshesToCut is used, point on axis to split meshes around
Offset = 0, 0, 0 ; offset for cubemaps’ pivots in meters (X for left cubemap will be inverted)
HigherResolution = 0 ; set to 1 in rare cases you would want to use higher resolution
DynamicReflections = 0 ; set to 1 to enable dynamic update, for example, if movement and
; steering of frong wheels should be shown in reflections
DebugMode = 0 ; set to 1 to enable debug mode to check updating areas
Reflectivity = 0.5 ; how reflective should material be (0.5 is a good value for chrome)
ExcludeNodes = COCKPIT_HR, HUB_LR, HUB_RR ; list of nodes to exclude from reflections to speed things up (usually
; there is no sense to waste time rendering rear parts, rear wheels and interior)
For some more general cases, use more direct syntax (that template unwraps to it), only setting one cubemap per section:
[LOCAL_CUBEMAP_...]
MESHES = Spotlight_SUB0 ; list of meshes to change material and add local cubemaps for
POSITION = 0, 0, 0 ; optional, set position manually (otherwise center of meshes will be used)
OFFSET = 0.08, 0, 0.13 ; offset for cubemap pivot in meters
HIGH_RESOLUTION = 1 ; set to 1 in rare cases you would want to use higher resolution
IS_DYNAMIC = 1 ; set to 1 to enable dynamic update
DEBUG = 0 ; set to 1 to enable debug mode to check updating areas
STATIC_FACES = TOP, BOTTOM, FRONT, LEFT ; list of faces to stop from being updated dynamically (helps
; a lot with performance, so enable debug mode and add as many faces as possible)
EXCLUDE_NODES = COCKPIT_HR ; list of nodes to exclude from reflections to speed things up
If you would want to split mesh in two more manually, here are some docs for it as well.
- Similar thing for tracks.
If you have any question or suggestions, please feel free to add a new issue.
- Enabling Extended Physics
- Aerodynamics
- Body Flex
- Custom Suspension Joints
- Driver Weight Shift for Karts
- Extra Turbo Options
- More Clutch Damage
- New Inputs for Dynamic Controllers
- Physics Scripts
- Setup Items Driven By Controllers
- Suspension
- Cosmic Suspension
- Tyre Types
- Enabling Extended Physics
- General Options
- Custom Raycasting
- Collision Parameters
- Dynamic Physics Objects
- Geometric colliders
- Surface Tweaks
- Extra FX Flags
- Extra FX Emissive
- Mesh Adjustments
- Model Replacements
- Shader Replacements
- Scene Queries
- UV2
- General Options
- Analog Instruments
- Animations
- Digital Instruments
- Emissive Objects
- Extra Switches
- Inputs
- LED panels
- Multichannel Emissives
- Vintage Tachometers
- Audio
- Brake Disc FX
- Deforming Bonnets
- Driver Model
- Exhaust Smoke
- Exhaust Flames
- Extra Lights
- Fake Shadows FX
- Local Cubemaps
- Mesh Splitting
- Miscellaneous Options
- Neck FX
- Node Adjustments
- Smart Mirror
- Sparks
- Tyres FX
- Visually Adjustable Wings
- Wheels
- Wobbly Bits
- Wobbly Wipers