73 lines
1.9 KiB
Plaintext
73 lines
1.9 KiB
Plaintext
material {
|
|
name : Lit,
|
|
requires : [
|
|
uv0
|
|
],
|
|
shadingModel : lit,
|
|
blending : transparent,
|
|
transparency : default,
|
|
parameters : [
|
|
{
|
|
type : sampler2d,
|
|
name : baseColorMap
|
|
},
|
|
{
|
|
type : float4,
|
|
name : baseColorFactor
|
|
},
|
|
{
|
|
type : sampler2d,
|
|
name : metallicRoughnessMap
|
|
},
|
|
{
|
|
type : float,
|
|
name : metallicFactor
|
|
},
|
|
{
|
|
type : float,
|
|
name : roughnessFactor
|
|
},
|
|
{
|
|
type : sampler2d,
|
|
name : normalMap
|
|
},
|
|
{
|
|
type : float,
|
|
name : normalScale
|
|
},
|
|
{
|
|
type : sampler2d,
|
|
name : aoMap
|
|
},
|
|
{
|
|
type : float,
|
|
name : aoStrength
|
|
},
|
|
{
|
|
type : sampler2d,
|
|
name : emissiveMap
|
|
},
|
|
{
|
|
type : float3,
|
|
name : emissiveFactor
|
|
}
|
|
],
|
|
}
|
|
|
|
fragment {
|
|
void material(inout MaterialInputs material) {
|
|
material.normal = texture(materialParams_normalMap, getUV0()).xyz * 2.0 - 1.0;
|
|
material.normal.y = -material.normal.y;
|
|
prepareMaterial(material);
|
|
|
|
material.baseColor = texture(materialParams_baseColorMap, getUV0());
|
|
material.baseColor.rgb *= materialParams.baseColorFactor.xyz;
|
|
material.baseColor.rgb *= material.baseColor.a;
|
|
|
|
material.roughness = materialParams.roughnessFactor * texture(materialParams_metallicRoughnessMap, getUV0()).g;
|
|
material.metallic = materialParams.metallicFactor * texture(materialParams_metallicRoughnessMap, getUV0()).b;
|
|
material.ambientOcclusion = texture(materialParams_aoMap, getUV0()).r;
|
|
material.emissive = texture(materialParams_emissiveMap, getUV0());
|
|
material.emissive.rgb *= materialParams.emissiveFactor.rgb;
|
|
}
|
|
} |