diff --git a/QtMeshViewer/Resources/fshader.glsl b/QtMeshViewer/Resources/fshader.glsl index 12256d7..6af05f3 100644 --- a/QtMeshViewer/Resources/fshader.glsl +++ b/QtMeshViewer/Resources/fshader.glsl @@ -70,8 +70,8 @@ void main() mat3 tbn = transpose(mat3(surfaceTangent, surfaceBitangent, surfaceNormal)); normal = texture2D(tx1, v_surfaceUV).rgb; normal = normalize(normal * 2.0 -1.0); - surfaceToLight = tbn * surfaceToLight; - surfaceToCamera = tbn * surfaceToCamera; + surfaceToLight = normalize(tbn * surfaceToLight); + surfaceToCamera = normalize(tbn * surfaceToCamera); } @@ -98,7 +98,7 @@ void main() float specularWeight = 1; if(material.hasSpecularmap) specularWeight = surfaceColor.a; - vec3 specColor = specularWeight * material.specularColor; + vec3 specColor = specularWeight * 1/255 * material.specularColor; vec3 specular = specularCoefficient * specColor * light.intensities; diff --git a/preview.jpg b/preview.jpg index 3dd55da..42a3ad7 100644 Binary files a/preview.jpg and b/preview.jpg differ