mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-17 01:10:10 +00:00
Fix parallax and specular for android
This commit is contained in:
parent
12833d66af
commit
b19f53aab6
@ -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…
Reference in New Issue
Block a user