File information

Last updated

Original upload

Created by

Wall_SoGB

Uploaded by

WallSoGB

Virus scan

Safe to use

About this mod

Adds fully dynamic, real time reflection system to the game. Realistic ambient lighting on meshes. Highly customizable, can run even on weak computers!

Requirements
Permissions and credits
Changelogs
 


What?
I was bored. Very bored.

This mod adds a new texture effect - real time cube map - which can be applied either globally, or on a per-mesh basis thanks to shader flags.

For users:
CHECK THE INI BEFORE USING THE MOD
I will scream at you in comments if you don't
The mod by default is configured to work only on correctly set up materials, meaning you need patched meshes to see reflections.
You can disable this behavior in the INI, and force reflections onto every material with env mapping - keep in mind that this can lead to improperly looking meshes (wrong brightness, broken effects if mesh uses a special, colored cube map).

The renderer is highly configurable - you can configure brightness, draw distance, apply behaviors, quality modes and more.
Thanks to this, the performance can be as low as 1-2 frames, or as high as over 30 - it's suitable both for casual players, and screen archers alike.


For modders:
The reflection system makes use of the Unknown10 shader flag in the shader property - unless overridden in the INI, only meshes with that flag will have the reflection map.
As with normal cube maps, the behavior of environment masks and "environment map scale" is unchanged - it's heavily recommended to lower the scale, since world reflections tend to be brighter than vanilla's texture-based cube maps.
Additionally, disable Envmap_Light_Fade as it's not needed for real time reflections, as naturally, they don't "glow" with an abstract color.

Since 1.3, mod features new shaders, which allow for per pixel blur based on the alpha channel of the env mask.
I tried my best to make it compatible with PBR roughness maps, so full white = maximum blur, full black = no blur.
Masks lacking the alpha channel will not use blur at all.
This feature is available for any cubemap, static and dynamic alike.


Here's a sample of blur levels with alpha intensity as percentage.


You can also increase the strength of the normal map (somewhat similar to Millenia's fix but applied per geometry) by attaching "NiFloatExtraData" with name "NormalIntensity" to the geometry. The value range is 0-15, as higher values tend to break normals.


Placed cameras:
Mod adds ability to place cube map cameras yourself - this allows for proper mirrors, at an additional performance cost.
Placed cube maps override world cube maps for the whole cell.

The system has few restrictions:
  • You can have only 1 placed camera in one cell, if cell contains multiple cameras, first one found is picked - if there's demand, I could expand this system.
  • There's no smooth transition when switching cameras - skill issue.

To create a such camera, simply create a unique static mesh containing a NiNode named "CellCamera". Upon finding that node in a cell, the mod will automatically use it as the new world camera position.

You can use command "CubemapRefreshCell" to rescan current cell in case you spawn the node dynamically. You need to call it after you spawn, or despawn the node.







You can batch convert meshes using Sniff

Crude mesh conversion tutorial



Caveats and quirks
Some of this stuff is WIP and requires more engine decoding.
  • Worldspaces like Freeside or Sierra Madre lack LOD, making world reflections look barren - needs manual patching.
  • Fake SSR looks utterly horrible (I mean it) on smooth surfaces that face the player - e.g., weapon scopes - no idea how to resolve this.
  • Frustum culling applies to lights - WIP.
  • Actors are culled - WIP.

Source Code
GitHub

Credits
SimpleINI
NVR's Mathieu and ENB's Boris for help and tips with shaders