Use bmd cull modes
This commit is contained in:
parent
d74988583f
commit
530c86e672
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user