Since dali's world matrix use left-hand-coordinate,
the constrainted world matrix value in uBone need to be multiply negative Y.
To apply this information, let we use uYDirection value if we use skin.
Also, we need to use same precision if we use same uniform both vertex and
fragment shaders. To specify the precision, make uYDirection as mediump.
Change-Id: Ibf6ca7ee0cc88fba1214b4a68a0eea7a4805f7e5
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
uniform samplerCube sDiffuseEnvSampler;
uniform samplerCube sSpecularEnvSampler;
uniform float uIblIntensity;
uniform samplerCube sDiffuseEnvSampler;
uniform samplerCube sSpecularEnvSampler;
uniform float uIblIntensity;
-uniform vec3 uYDirection;
+uniform mediump vec3 uYDirection;
uniform float uMaxLOD;
// For Alpha Mode.
uniform float uMaxLOD;
// For Alpha Mode.
in vec4 aWeights;
#define MAX_BONES 64
uniform mat4 uBone[MAX_BONES];
in vec4 aWeights;
#define MAX_BONES 64
uniform mat4 uBone[MAX_BONES];
+ uniform mediump vec3 uYDirection;
uBone[int(aJoints.z)] * aWeights.z +
uBone[int(aJoints.w)] * aWeights.w;
position = bone * position;
uBone[int(aJoints.z)] * aWeights.z +
uBone[int(aJoints.w)] * aWeights.w;
position = bone * position;
- normal = (bone * vec4(normal, 0.0)).xyz;
- tangent = (bone * vec4(tangent, 0.0)).xyz;
- normal = normalize(normal);
- tangent = normalize(tangent);
+ normal = uYDirection * (bone * vec4(normal, 0.0)).xyz;
+ tangent = uYDirection * (bone * vec4(tangent, 0.0)).xyz;
highp vec4 positionW = position;
#else
highp vec4 positionW = position;
#else
vPositionToCamera = transpose(mat3(uViewMatrix)) * -vec3(positionV.xyz / positionV.w);
vPositionToCamera = transpose(mat3(uViewMatrix)) * -vec3(positionV.xyz / positionV.w);
+ normal = normalize(normal);
+ tangent = normalize(tangent);
vec3 bitangent = cross(normal, tangent);
#ifdef VEC4_TANGENT
bitangent *= aTangent.w;
vec3 bitangent = cross(normal, tangent);
#ifdef VEC4_TANGENT
bitangent *= aTangent.w;