Source code for the Starfield Luma mod.
To set up a development environment for this mod (skip to step 7 if you don't care about developing the code plugin and only want to modify shaders):
- Have Visual Studio (only VS 2022 was tested) installed, with components to build C++ code for Windows
- Follow the requirements specified here: SF Plugin Template requirements. You need to install vcpkg and CMake, either as VS installer components or as a custom install (a custom install is preferred, as vcpkg that comes with VS seems to have troubles with Luma), and set up the specified environment paths
- Install the official mod and anything that comes along with it (e.g. SFSE, Shader Injector): Starfield Luma
- Run
make-sln-msvc.bat
- Open
build\Luma.sln
with VS and run theALL_BUILD
CMake inRelease
configuration, this will automatically build the plugin binary and copy it and its shaders in your game mods directory (and reset the mod settings) - Alternatively, run
build-msvc-release.bat
, though that might not work - If you don't have the
SFPath
environment variable set up from a prior step, openshaders\target_folder.txt
and paste your Starfield mods directory + relative shaders binaries path in there (e.g.C:\Games\Starfield\Data\shadersfx\
) - set the
DEVELOPMENT
defines to1
inPlugin\src\Settings.h
andshaders\shared.hlsl
to have full access to the mod development settings - To allow shaders hot reload (live edits) while running, open
SFShaderInjector.ini
(it goes alongside the Shader Injector ASI or DLL, wherever the mod was installed) and changeAllowLiveUpdates
to1
- You can now modify (or add) any hlsl shader in the
shaders
folder and runcompile_all_shaders.ps1
to build them and copy them to the game folder - To debug Luma code, build the solution in "Debug" configuration, run Starfield and hook the debugger (a message box will appear, giving you time to hook)
If you to package a new (full) release, run Plugin\dist\deploy-release.ps1
(this also deploys shaders, but it doesn't rebuild them).
If you want to modify the Shader Injector source code, you can find it here. That isn't necessary for the development of this mod.
If you want to bump up the project version, it's in Plugin\CMakeList.txt
.
Note that SFPath
can also point to a virtual folder from a mod manager.