1
0
mirror of synced 2024-11-30 18:24:39 +01:00

Fix displaying normals as lines if enabled

This commit is contained in:
KillzXGaming 2019-05-30 19:34:23 -04:00
parent d5622e4046
commit 2299a61cb3
8 changed files with 6 additions and 6 deletions

Binary file not shown.

View File

@ -335,11 +335,12 @@ namespace FirstPlugin
shader = OpenTKSharedResources.shaders["BFRES_Normals"];
shader.UseProgram();
Matrix4 projection = control.ProjectionMatrix;
Matrix4 camMtx = control.CameraMatrix;
shader.SetMatrix4x4("camMtx", ref camMat);
shader.SetMatrix4x4("mtxProj", ref projMat);
shader.SetMatrix4x4("mtxCam", ref computedCamMtx);
shader.SetMatrix4x4("mtxMdl", ref mdlMat);
shader.SetMatrix4x4("mtxProj", ref projection);
shader.SetMatrix4x4("camMtx", ref camMtx);
shader.SetFloat("normalsLength", Runtime.normalsLineLength);
DrawModels(shader, control);

View File

@ -306,7 +306,7 @@ void main()
}
}
vec3 I = vec3(0,0,-1) * mat3(mtxMdl * mtxCam);
vec3 I = vec3(0,0,-1) * mat3(mtxCam);
vec3 N = normal;
if (HasNormalMap == 1 && useNormalMap == 1)

View File

@ -366,7 +366,6 @@ void main()
{
fragColor.rgb = specularTerm;
fragColor.rgb += emissionTerm;
fragColor.rgb *= 2.5;
fragColor.rgb = fragColor.rgb / (fragColor.rgb + vec3(1.0));
fragColor.rgb = pow(fragColor.rgb, vec3(1 / gamma));
}