Closed jnsmalm closed 1 year ago
we will cross check
The default behavior of KHR_materials_transmission
is thin-walled transmission, meaning you can have blurring due to roughness, but there is no refraction (the ray exits the volume in the same place it entered). In order to enable transmission with refraction, a glTF model also needs the KHR_materials_volume
extension, to provide (or at least indicate) volumetric thickness, along with optional settings such as attenuation color & distance.
I see. Is a u_TransmissionFramebufferSampler always required? I guess it should not be needed if transmission roughness is 0, but in shader it seams like u_TransmissionFramebufferSampler is always required, is this by design?
u_TransmissionFramebufferSampler
is only required when MATERIAL_TRANSMISSION
is enabled. Theoretically, the sampler would not be needed if the transmission factor is zero, but this value depends on the current transmission texture value (if one is supplied).
In my case I use MATERIAL_TRANSMISSION together with USE_IBL, but in the code below it also assumes I'm using MATERIAL_VOLUME because it calls getIBLVolumeRefraction, is this intended or a bug? Can't I use MATERIAL_TRANSMISSION without MATERIAL_VOLUME?