diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index 4aa45941..f7cade42 100644 Binary files a/.vs/Switch_Toolbox/v15/.suo and b/.vs/Switch_Toolbox/v15/.suo differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide index 7d0aa3d0..f53d1626 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal index 8c7ff586..1e2ff95f 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Switch_FileFormatsMain/GL/BCRES_Render.cs b/Switch_FileFormatsMain/GL/BCRES_Render.cs index 0fdbb10c..f985db94 100644 --- a/Switch_FileFormatsMain/GL/BCRES_Render.cs +++ b/Switch_FileFormatsMain/GL/BCRES_Render.cs @@ -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);