diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index 08d0ce2b..c04e7255 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 b48de3c1..283f98bd 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 0df4ebdf..b2a2fe35 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/FileFormats/BMD/BMDMaterialWrapper.cs b/Switch_FileFormatsMain/FileFormats/BMD/BMDMaterialWrapper.cs index bcfe3230..23e9ad57 100644 --- a/Switch_FileFormatsMain/FileFormats/BMD/BMDMaterialWrapper.cs +++ b/Switch_FileFormatsMain/FileFormats/BMD/BMDMaterialWrapper.cs @@ -12,7 +12,7 @@ namespace FirstPlugin { public class BMDMaterialWrapper : STGenericMaterial { - Material Material; + public Material Material; SuperBMDLib.Model ParentModel; public BMDMaterialWrapper(Material mat, SuperBMDLib.Model model) diff --git a/Switch_FileFormatsMain/GL/BMD_Renderer.cs b/Switch_FileFormatsMain/GL/BMD_Renderer.cs index 31a3079a..b209e887 100644 --- a/Switch_FileFormatsMain/GL/BMD_Renderer.cs +++ b/Switch_FileFormatsMain/GL/BMD_Renderer.cs @@ -9,6 +9,7 @@ using GL_EditorFramework.GL_Core; using GL_EditorFramework.Interfaces; using OpenTK; using OpenTK.Graphics.OpenGL; +using SuperBMDLib.Materials.Enums; namespace FirstPlugin { @@ -21,6 +22,27 @@ namespace FirstPlugin } + public override void SetRenderData(STGenericMaterial mat, ShaderProgram shader, STGenericObject m) + { + var bmdMaterial = (BMDMaterialWrapper)mat; + + switch (bmdMaterial.Material.CullMode) + { + case CullMode.None: + GL.Disable(EnableCap.CullFace); + break; + case CullMode.Back: + GL.CullFace(CullFaceMode.Back); + break; + case CullMode.Front: + GL.CullFace(CullFaceMode.Front); + break; + case CullMode.All: + GL.CullFace(CullFaceMode.FrontAndBack); + break; + } + } + public override int BindTexture(STGenericMatTexture tex, ShaderProgram shader) { GL.ActiveTexture(TextureUnit.Texture0 + tex.textureUnit + 1); diff --git a/Switch_Toolbox_Library/Rendering/GenericModelRenderer/GenericModelRenderer.cs b/Switch_Toolbox_Library/Rendering/GenericModelRenderer/GenericModelRenderer.cs index acc6358d..0cffed3e 100644 --- a/Switch_Toolbox_Library/Rendering/GenericModelRenderer/GenericModelRenderer.cs +++ b/Switch_Toolbox_Library/Rendering/GenericModelRenderer/GenericModelRenderer.cs @@ -233,6 +233,11 @@ namespace Switch_Toolbox.Library.Rendering } + public virtual void SetRenderData(STGenericMaterial mat, ShaderProgram shader, STGenericObject m) + { + + } + private static void SetUniforms(STGenericMaterial mat, ShaderProgram shader, STGenericObject m) { //UV Scale @@ -409,6 +414,7 @@ namespace Switch_Toolbox.Library.Rendering if (group.faces.Count <= 3) return; + SetRenderData(Material, shader, m); SetUniforms(Material, shader, m); SetUniformBlocks(Material, shader, m); SetBoneUniforms(control, shader, Skeleton, m);