We have an Raygen Shader that also needs to sample the GBuffer. This wasn’t a problem at all with the legacy GBuffer or Blendable, but the current design around the adaptive GBuffer appears to make this not possible within the same shader (and pass).
The issue is with FSubstrateMaterialContainer and FSubstrateTopLayerDataContainer being macros depending on SUBSTRATE_MATERIALCONTAINER_IS_VIEWRESOURCE, which in turn cause UnpackSubstrateHeaderIn() and UnpackSubstrateBSDF() to be compiled only with one type.
This design is really problematic. We basically cannot handle FSubstrateRaytracingPayload if we have viewresource enabled. If viewresource is disabled, then we can’t decode the GBuffer.
- Are there any plans to address this in the future?
- Maybe move this onto templated types instead?
I also noticed that the substrate data in FSubstrateRaytracingPayload is limited to the payload size. Does that mean we can’t really use complex materials if encoding them would exceed this size?
Thanks!
Ernesto.
[Attachment Removed]