Change specularAmbientOcclusion from boolean to enum (#2352)

The user can now choose amongst 3 specular AO methods:
- None, specAO is off
- Simple, specAO is inferred from roughness and diffuse AO
- Bent normals, specAO is computed accurately from cone intersections

The last method is more expensive but produces the best results.

This change also fixes a few issues:
- Rename materialRefraction() and materialRefractionType() for
  consistency
- Fixes user time in shaders
This commit is contained in:
Romain Guy
2020-04-07 09:19:48 -07:00
committed by GitHub
parent 887f8e8a1c
commit bf0dc32ee3
18 changed files with 191 additions and 76 deletions
+1 -1
View File
@@ -242,7 +242,7 @@ Material* createMaterial(Engine* engine, const MaterialKey& config, const UvMap&
MaterialBuilder builder = MaterialBuilder()
.name(name)
.flipUV(false)
.specularAmbientOcclusion(true)
.specularAmbientOcclusion(MaterialBuilder::SpecularAmbientOcclusion::SIMPLE)
.material(shader.c_str())
.doubleSided(config.doubleSided)
.targetApi(filamat::targetApiFromBackend(engine->getBackend()));