Merge pull request #2825 from Sisah2/android_fix

Fix parallax and specular for android
pull/2828/head
Alexei Dobrohotov 5 years ago committed by GitHub
commit ab69b65640
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -90,7 +90,7 @@ void main()
vec3 cameraPos = (gl_ModelViewMatrixInverse * vec4(0,0,0,1)).xyz;
vec3 objectPos = (gl_ModelViewMatrixInverse * vec4(passViewPos, 1)).xyz;
vec3 eyeDir = normalize(cameraPos - objectPos);
vec2 offset = getParallaxOffset(eyeDir, tbnTranspose, normalTex.a, (passTangent.w > 0) ? -1.f : 1.f);
vec2 offset = getParallaxOffset(eyeDir, tbnTranspose, normalTex.a, (passTangent.w > 0.0) ? -1.f : 1.f);
adjustedDiffuseUV += offset; // only offset diffuse for now, other textures are more likely to be using a completely different UV set
// TODO: check not working as the same UV buffer is being bound to different targets
@ -171,7 +171,7 @@ void main()
#if @specularMap
vec4 specTex = texture2D(specularMap, specularMapUV);
float shininess = specTex.a * 255;
float shininess = specTex.a * 255.0;
vec3 matSpec = specTex.xyz;
#else
float shininess = gl_FrontMaterial.shininess;

@ -82,7 +82,7 @@ void main()
#endif
#if @specularMap
float shininess = 128; // TODO: make configurable
float shininess = 128.0; // TODO: make configurable
vec3 matSpec = vec3(diffuseTex.a, diffuseTex.a, diffuseTex.a);
#else
float shininess = gl_FrontMaterial.shininess;

Loading…
Cancel
Save