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).
34 lines
772 B
Plaintext
34 lines
772 B
Plaintext
material {
|
|
name : Cloth,
|
|
shadingModel : cloth,
|
|
parameters : [
|
|
{
|
|
type : float3,
|
|
name : baseColor
|
|
},
|
|
{
|
|
type : float,
|
|
name : roughness
|
|
},
|
|
{
|
|
type : float3,
|
|
name : sheenColor
|
|
},
|
|
{
|
|
type : float3,
|
|
name : subsurfaceColor
|
|
}
|
|
],
|
|
specularAntiAliasing : true
|
|
}
|
|
|
|
fragment {
|
|
void material(inout MaterialInputs material) {
|
|
prepareMaterial(material);
|
|
material.baseColor.rgb = materialParams.baseColor;
|
|
material.roughness = materialParams.roughness;
|
|
material.sheenColor = materialParams.sheenColor;
|
|
material.subsurfaceColor = materialParams.subsurfaceColor;
|
|
}
|
|
}
|