Compile-Time Switches
Some Vite features cannot be console variables. Either they change shader permutation sets, which are decided when shaders are compiled, or they alter hot code paths where a runtime branch would cost more than the feature saves.
The switches
Macro | Default | Effect when enabled |
|---|---|---|
|
| Compiles out a large set of ray tracing shader permutations |
|
| Vite's optimised SSAO memory access path |
|
| Deterministic fixed-step PhysX with render interpolation |
|
| Output-resolution translucency and volumetric fog when upscaling |
|
| Separate translucency depth texture from the NvRTX branch |
Each is defined with an #ifndef guard, so any of them can be overridden from the build system without editing the header.
Overriding a switch
Change a compile-time switch
Open your project's
Source/<Project>.Target.cs, or the engine target file if you are changing it engine-wide.Add the definition to
GlobalDefinitions:public MyGameTarget(TargetInfo Target) : base(Target) { Type = TargetType.Game; DefaultBuildSettings = BuildSettingsVersion.V2; ExtraModuleNames.Add("MyGame"); GlobalDefinitions.Add("VITE_RT_PSO_DEBLOAT=0"); }Regenerate project files.
Rebuild the engine, and wipe the shader cache if you changed
VITE_RT_PSO_DEBLOATor any switch that affects shader permutations. See Cache Management.
Prefer GlobalDefinitions in a target file over editing CoreDefines.h. Editing the header changes the value for every target and creates a diff against the engine repository that you will have to carry through every merge.