This replaces the previous "curvature to roughness" method. Both are related and rely on the screen space variance of geometric normals but this new solution offers more control (the screen space variance and the clamping threshold can be controlled).
49 lines
1.1 KiB
Plaintext
49 lines
1.1 KiB
Plaintext
material {
|
|
name : Lit,
|
|
shadingModel : lit,
|
|
parameters : [
|
|
{
|
|
type : float3,
|
|
name : baseColor
|
|
},
|
|
{
|
|
type : float,
|
|
name : roughness
|
|
},
|
|
{
|
|
type : float,
|
|
name : metallic
|
|
},
|
|
{
|
|
type : float,
|
|
name : reflectance
|
|
},
|
|
{
|
|
type : float,
|
|
name : clearCoat
|
|
},
|
|
{
|
|
type : float,
|
|
name : clearCoatRoughness
|
|
},
|
|
{
|
|
type : float,
|
|
name : anisotropy
|
|
}
|
|
],
|
|
specularAntiAliasing : true
|
|
}
|
|
|
|
fragment {
|
|
void material(inout MaterialInputs material) {
|
|
prepareMaterial(material);
|
|
material.baseColor.rgb = materialParams.baseColor;
|
|
material.roughness = materialParams.roughness;
|
|
material.metallic = materialParams.metallic;
|
|
material.reflectance = materialParams.reflectance;
|
|
material.clearCoat = materialParams.clearCoat;
|
|
material.clearCoatRoughness = materialParams.clearCoatRoughness;
|
|
material.anisotropy = materialParams.anisotropy;
|
|
}
|
|
}
|