Let we make PBR shader use our world color system.
TODO : We should change DepthWrite & AlphaBlend properties on coreside.
Since the model might has 32bit image as texture, we cannot make
DepthWrite / BlendMode as AUTO.
Change-Id: I89c3ce4d144150cac72e01eadbc86c2f4eb5f8d3
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
#endif //GLTF_CHANNELS
#endif //THREE_TEX
-uniform lowp vec4 uColorFactor;
+uniform lowp vec4 uColor; // Color from SceneGraph
+uniform lowp vec4 uColorFactor; // Color from material
uniform lowp float uMetallicFactor;
uniform lowp float uRoughnessFactor;
color += emissive;
#endif // EMISSIVE
- FragColor = vec4(pow(color, vec3(1.0 / 2.2)), baseColor.a);
+ FragColor = vec4(pow(color, vec3(1.0 / 2.2)), baseColor.a) * uColor;
}
#version 300 es
precision mediump float;
+uniform lowp vec4 uColor;
flat in float vColor;
out vec4 FragColor;
void main()
{
vec3 rgb = vec3(fract(vColor), fract(vColor * 0.00390625), fract(vColor * 0.00390625 * 0.00390625));
- FragColor = vec4(rgb, 1.);
+ FragColor = vec4(rgb, 1.) * uColor;
}
\ No newline at end of file
uniform samplerCube uSkyBoxTexture;
+uniform lowp vec4 uColor;
uniform mediump float uIntensity;
varying mediump vec3 vTexCoord;
void main()
{
mediump vec4 texColor = textureCube(uSkyBoxTexture, vTexCoord) * uIntensity;
- gl_FragColor = texColor;
+ gl_FragColor = texColor * uColor;
}
\ No newline at end of file