* Expose Java API to control discard flags This change also adds the new sample sample-multi-view that shows how to use discard flags to render multiple views. * Disable clears
54 lines
1.6 KiB
Plaintext
54 lines
1.6 KiB
Plaintext
// Simple lit material that defines 3 parameters:
|
|
// - baseColor
|
|
// - roughness
|
|
// - metallic
|
|
//
|
|
// These parameters can be used by the application to change the appearance of the material.
|
|
//
|
|
// This source material must be compiled to a binary material using the matc tool.
|
|
// The command used to compile this material is:
|
|
// matc -p mobile -a opengl -o app/src/main/assets/lit.filamat app/src/materials/lit.mat
|
|
//
|
|
// See build.gradle for an example of how to compile materials automatically
|
|
// Please refer to the documentation for more information about matc and the materials system.
|
|
|
|
material {
|
|
name : lit,
|
|
|
|
// Dynamic lighting is enabled on this material
|
|
shadingModel : lit,
|
|
|
|
// We don't need to declare a "requires" array, lit materials
|
|
// always requires the "tangents" vertex attribute (the normal
|
|
// is required for lighting, tangent/bitangent for normal mapping
|
|
// and anisotropy)
|
|
|
|
// List of parameters exposed by this material
|
|
parameters : [
|
|
// The color must be passed in linear space, not sRGB
|
|
{
|
|
type : float3,
|
|
name : baseColor
|
|
},
|
|
{
|
|
type : float,
|
|
name : roughness
|
|
},
|
|
{
|
|
type : float,
|
|
name : metallic
|
|
}
|
|
],
|
|
}
|
|
|
|
fragment {
|
|
void material(inout MaterialInputs material) {
|
|
prepareMaterial(material);
|
|
|
|
// Nothing fancy here, we simply copy the parameters
|
|
material.baseColor.rgb = materialParams.baseColor;
|
|
material.roughness = materialParams.roughness;
|
|
material.metallic = materialParams.metallic;
|
|
}
|
|
}
|