I thought I’d make a new thread as the previous discussion I was having was over in the events section and it seems more relevant to have it here.
I’ve managed to take advantage of the fact that there is a customData channel in the GBuffer which the Default Lit and Unlit shaders dont use. All of the others (clear coat, hair, subsurface) use it.
I’ve added an output node int the material editor that lets you write whatever you want to it from a material.
I throught from discussions on the forum that I would have to access this custom data through a custom node. Doing this was giving me a failed assertion that told me that the GBuffer resource wasn’t valid. BUT then I had a look at the GBuffer visualisation and I saw my pass in the subsurface output! I then worked out that the customData get’s written there and I wouldn’t have to go through a custom node.
It actually didn’t take too much to do (well after having to figure out how the shader compiler works with all its defines when you add an output. I’m thankful for visual studios ‘go to defintion’ because documentation surely didn’t help me.
The first thing that I can see people being worried about is mixing the subsurface output with these arbitrary ones. Well because the Gbuffer is limited in how many passes it can do (or more to the point how many epic want to put in for performance reasons), I don’t see any extra custom passes being added. One workaround I have thought about it to use the stencil buffer to send material/mask IDs through so that you can do your own masking in post process. So all SS materials would be given a stencil id of 1 or something and anything else would be a custom thing. This would be up to the user though.
I’m interested to hear everyone’s thoughts on if this is a useful feature.