mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-23 21:13:19 +00:00
Fix ligting for bcres
This commit is contained in:
parent
4e230a914e
commit
9714556c3b
4 changed files with 10 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -124,6 +124,16 @@ namespace FirstPlugin
|
|||
control.CurrentShader = shader;
|
||||
control.UpdateModelMatrix(Matrix4.CreateScale(Runtime.previewScale) * ModelTransform);
|
||||
|
||||
Matrix4 camMat = control.ModelMatrix * control.CameraMatrix * control.ProjectionMatrix;
|
||||
|
||||
Matrix4 invertedCamera = Matrix4.Identity;
|
||||
if (invertedCamera.Determinant != 0)
|
||||
invertedCamera = camMat.Inverted();
|
||||
|
||||
Vector3 lightDirection = new Vector3(0f, 0f, -1f);
|
||||
|
||||
shader.SetVector3("difLightDirection", Vector3.TransformNormal(lightDirection, invertedCamera).Normalized());
|
||||
|
||||
SetRenderSettings(shader);
|
||||
|
||||
DrawModels(shader, control);
|
||||
|
|
Loading…
Reference in a new issue