|
|
|
@ -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;
|
|
|
|
|