Files
filament/samples/materials/aoPreview.mat
Philip Rideout ce4a3edf7b gltf_baker: visualizers now use fp32 textures.
This allows us to skip the CPU-side vector-to-color conversion that
occured at the end, and makes the real-time visualization consistent
with the final visualization.
2019-06-03 13:03:14 -07:00

33 lines
718 B
Plaintext

material {
name : aoPreview,
parameters : [
{
type : sampler2d,
name : luma
},
{
type : bool,
name : grayscale
}
],
requires : [
uv0
],
shadingModel : unlit,
culling : none,
depthCulling: false
}
fragment {
void material(inout MaterialInputs material) {
prepareMaterial(material);
if (materialParams.grayscale) {
float L = texture(materialParams_luma, getUV0()).r;
material.baseColor.rgb = vec3(L);
} else {
float3 v = texture(materialParams_luma, getUV0()).rgb;
material.baseColor.rgb = v * 0.5 + 0.5;
}
}
}