Files
filament/web/samples/materials/helmet.mat
Philip Rideout 8228deb209 Add a multi-material model and JS demo.
This is a more complex test than suzanne because it has multiple
materials and exercises the named materials functionality in
loadFilamesh.

This also exercises our glTF-to-Filamesh pipeline at build time.

See issue #663
2019-01-11 09:18:41 +05:30

35 lines
846 B
Plaintext

material {
name : helmet,
requires : [
uv0
],
shadingModel : lit,
parameters : [
{
type : sampler2d,
name : baseColor
},
{
type : sampler2d,
name : occlusionRoughnessMetallic
},
{
type : sampler2d,
name : normalMap
}
],
}
fragment {
void material(inout MaterialInputs material) {
vec2 uv = getUV0();
material.normal = texture(materialParams_normalMap, uv).xyz * 2.0 - 1.0;
prepareMaterial(material);
material.baseColor = texture(materialParams_baseColor, uv);
vec4 orm = texture(materialParams_occlusionRoughnessMetallic, uv);
material.ambientOcclusion = orm.r;
material.roughness = orm.g;
material.metallic = orm.b;
}
}