Skip to content

Add some shader source files to trinity - #121

Merged
filipppavlov merged 84 commits into
mainfrom
shader-source
Oct 16, 2026
Merged

filipppavlov merged 84 commits into
mainfrom
shader-source

Conversation

@filipppavlov

@filipppavlov filipppavlov commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Refactor and add some of the game project's source shader files to Trinity. This is a very small subset of shaders and include files that are supposed to be project-independent and are strongly related to Trinity's code itself. For example, include
files contain per-object and per-scene constant buffer layouts (as they must match the layout of these buffers in Trinity's C++ code), but they don't contain lighting model code as it is different between game clients.

Shader files are partitioned into public shader include files in shaders/include directory and (private) shader source in other shaders/ directories. Game projects can use Trinity's public includes in their shaders, and they are supposed to compile and use Trinity's source shaders, although they can override them if needed.

Aside from shaders, this PR contains a few fixes and extensions to the Shader Compiler:

  • Add "include directory" command-line argument: /I directory will add the directory to the search paths used when looking for include files
  • Add a distinction between local and system includes. For system includes, directories provided with /I are searched first.
  • Fix a crash when compiling a raytracing shader for dx12 if the shader contains an error not caught by the Shader Compiler itself.
  • Move static const variable declarations out of the global constant buffer for dx11 and dx12, and maintain the source order for these const declarations: this fixes a bug when the compiler may rearrange const declarations inside the global constant buffer even if there is a dependency between const because of initializers.

Linked issue (optional)

https://fenriscreations.atlassian.net/browse/PLAT-11863

@filipppavlov
filipppavlov marked this pull request as ready for review October 15, 2026 09:28
Comment thread shaders/Managed/Space/SpecialFX/Particles/Gpu/SortInner.fx Outdated
Comment thread shaders/Managed/Space/SpecialFX/Particles/Gpu/Sort.fx Outdated
Comment thread shaders/Managed/Space/SpecialFX/Volumetric/Fog/ApplyFroxels.fx
@filipppavlov
filipppavlov merged commit 6f89cd8 into main Oct 16, 2026
20 of 21 checks passed
@filipppavlov
filipppavlov deleted the shader-source branch October 16, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants