Fix displaying normals as lines if enabled
This commit is contained in:
parent
d5622e4046
commit
2299a61cb3
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -335,11 +335,12 @@ namespace FirstPlugin
|
||||
shader = OpenTKSharedResources.shaders["BFRES_Normals"];
|
||||
shader.UseProgram();
|
||||
|
||||
Matrix4 projection = control.ProjectionMatrix;
|
||||
Matrix4 camMtx = control.CameraMatrix;
|
||||
|
||||
shader.SetMatrix4x4("mtxProj", ref projection);
|
||||
shader.SetMatrix4x4("camMtx", ref camMtx);
|
||||
shader.SetMatrix4x4("camMtx", ref camMat);
|
||||
shader.SetMatrix4x4("mtxProj", ref projMat);
|
||||
shader.SetMatrix4x4("mtxCam", ref computedCamMtx);
|
||||
shader.SetMatrix4x4("mtxMdl", ref mdlMat);
|
||||
|
||||
shader.SetFloat("normalsLength", Runtime.normalsLineLength);
|
||||
|
||||
DrawModels(shader, control);
|
||||
|
Binary file not shown.
Binary file not shown.
@ -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)
|
||||
|
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user