Files
filament/samples/materials/sandboxLitSolidRefractionSsr.mat
T
Mathias Agopian f290742f1b Screen-space refraction
With this PR screen-space refraction is functional.

Caveats:

The blur passes for supporting rough refractive materials is quite
heavy and increases with the resolution.

SSR uses a gaussian approximation for the brdf and therefore doesn’t
match perfectly cubemap-based refraction and IBL.

The use of MSAA with screen-space effects, while working, is going
to incur a large cost, especially on tilers.
2020-01-29 10:17:08 -08:00

71 lines
1.7 KiB
Plaintext

material {
name : SolidRefraction,
shadingModel : lit,
refractionType : solid,
refractionMode : screenspace,
parameters : [
{
type : float,
name : alpha
},
{
type : float3,
name : baseColor
},
{
type : float,
name : roughness
},
{
type : float,
name : metallic
},
{
type : float,
name : clearCoat
},
{
type : float,
name : clearCoatRoughness
},
{
type : float,
name : anisotropy
},
{
type : float3,
name : absorption
},
{
type : float,
name : thickness
},
{
type : float,
name : ior
},
{
type : float,
name : transmission
}
],
specularAntiAliasing : true
}
fragment {
void material(inout MaterialInputs material) {
prepareMaterial(material);
material.baseColor.rgb = materialParams.baseColor * materialParams.alpha;
material.baseColor.a = materialParams.alpha;
material.roughness = materialParams.roughness;
material.metallic = materialParams.metallic;
material.clearCoat = materialParams.clearCoat;
material.clearCoatRoughness = materialParams.clearCoatRoughness;
material.anisotropy = materialParams.anisotropy;
material.absorption = materialParams.absorption;
material.thickness = materialParams.thickness;
material.ior = materialParams.ior;
material.transmission = materialParams.transmission;
}
}