I have a some custom BRDFs, that would previously have been custom Shading Models. I would also like to take advantage of Substrate’s BSDFs, and slab blending. After some initial investigation, it looks to be a lot more work to add in custom BSDFs or custom slabs into Substrate than it previously was to add custom shading models. I intend on using the Blendable GBuffer.
What’s the easiest way to add enough hooks to the engine to supply my own slab, BxDF, or other shading model style feature? How should I go about doing this?
[Attachment Removed]
Hey there! Looking at the initial commit for the Substrate Toon BSDF to UE5/Main, I would agree with your assessment that adding your own BSDF to Substrate involves changing more files than it would be if you added your own custom shading model in the legacy material system (speaking as someone who was working on an article to help folks add their own custom shading models).
I don’t want to discourage you from doing that, though. We’re definitely interested in getting feedback from folks exploring that path, even though it’s possible that it’ll see some changes in the future. I just want to make sure you go into that exploration knowing things are likely to change, and the current state of things will involve some pretty sizable integration challenges.
If you do start going down this path, please don’t hesitate to reach out for help with specific issues!
[Attachment Removed]
If I had to guess, that shading model ID would be for Substrate’s Blendable GBuffer support, but not for legacy materials in general. If you’re going down the Blendable path, you’ll likely need to keep this in mind.
Sadly, there’s no easy “hooks” at this time, but we’re happy to take input and feedback on what we can do to meet your needs with future iterations. Like I said, right now it’ll still require the more invasive changes. Out of curiosity, what kind of slabs are y’all wanting to add?
[Attachment Removed]
Thanks for the reference! That’s pretty much what I was running into. I’m looking at ways to add kind of a “hook” currently. Having functions defined in another file that then gets called by SubstrateExport/Read/Evaluation, etc, if any of the built-in types haven’t been found. This way the change to the core Substrate files is very minimal, and the “custom” file(s) can grow as needed, and I can add in my own utility headers and so on. Does this seem like a reasonable way to go?
In that commit, I’m also a little surprised to see `SHADINGMODELID_SUBSTRATE_TOON` be defined. Is that for legacy support, or does Substrate still use a lot of the legacy shading model logic/paths?
[Attachment Removed]
This has been helpful, thank you very much! I may reach out later with more specific questions.
[Attachment Removed]