Modify default shader according to the gltf pbr spec 75/274275/27
authorseungho <sbsh.baek@samsung.com>
Mon, 25 Apr 2022 14:38:15 +0000 (23:38 +0900)
committerseungho <sbsh.baek@samsung.com>
Mon, 16 May 2022 03:41:59 +0000 (12:41 +0900)
commit0916db4ae20611f2c6d8738882089eaa3e7a5d2d
tree2de374caeb458b358c1fb41f2ca770ebe7019ae1
parent1ca353dc14d04ecc3a36ece4669bfffe35ff4984
Modify default shader according to the gltf pbr spec

 - Add uColorFactor.
   In glTF, color factor can be used as a color when there isn't color texture,
   but it is also used to be multiplied with base color that is sampled from color texture.
   In previous implementation, when there isn't color texture, color factor is converted
   as single pixel texture.
   If the texture is from color factor, we shouldn't multiply color factor again.
   But, we couldn't notify whether the texture is from image file or color factor.

 - Add vertex color

 - Add uMetallicFactor, uRoughnessFactor

 - Use #ifdef instead of single value texture.

 - Use pre-computed brdf texture.

 - Modify alpha mode

Change-Id: I048b793a4481b65da5ce07d0d3e263ae74b2ab59
Signed-off-by: seungho <sbsh.baek@samsung.com>
14 files changed:
automated-tests/resources/AnimatedCube.gltf
automated-tests/src/dali-scene-loader/utc-Dali-Gltf2Loader.cpp
automated-tests/src/dali-scene-loader/utc-Dali-ShaderDefinitionFactory.cpp
dali-scene-loader/internal/graphics/shaders/default-physically-based-shader.frag
dali-scene-loader/internal/graphics/shaders/default-physically-based-shader.vert
dali-scene-loader/public-api/environment-definition.cpp
dali-scene-loader/public-api/environment-definition.h
dali-scene-loader/public-api/gltf2-loader.cpp
dali-scene-loader/public-api/material-definition.cpp
dali-scene-loader/public-api/material-definition.h
dali-scene-loader/public-api/mesh-definition.cpp
dali-scene-loader/public-api/mesh-definition.h
dali-scene-loader/public-api/node-definition.cpp
dali-scene-loader/public-api/shader-definition-factory.cpp