mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-10 07:04:36 +00:00
BFLYT Editor: Rendering fixes
This commit is contained in:
parent
a2a9f21035
commit
aab84f91e6
2 changed files with 9 additions and 7 deletions
|
@ -45,12 +45,12 @@ namespace LayoutBXLYT
|
|||
get
|
||||
{
|
||||
StringBuilder vert = new StringBuilder();
|
||||
vert.AppendLine("uniform mat4 globalTransform;");
|
||||
vert.AppendLine("uniform mat4 rotationMatrix;");
|
||||
vert.AppendLine("void main()");
|
||||
vert.AppendLine("{");
|
||||
{
|
||||
vert.AppendLine("gl_FrontColor = gl_Color;");
|
||||
vert.AppendLine("gl_Position = gl_ModelViewProjectionMatrix * globalTransform * gl_Vertex;");
|
||||
vert.AppendLine("gl_Position = gl_ModelViewProjectionMatrix * rotationMatrix * gl_Vertex;");
|
||||
}
|
||||
vert.AppendLine("}");
|
||||
return vert.ToString();
|
||||
|
@ -61,10 +61,11 @@ namespace LayoutBXLYT
|
|||
get
|
||||
{
|
||||
StringBuilder vert = new StringBuilder();
|
||||
vert.AppendLine("uniform vec4 color");
|
||||
vert.AppendLine("void main()");
|
||||
vert.AppendLine("{");
|
||||
{
|
||||
vert.AppendLine("gl_FragColor = gl_Color;");
|
||||
vert.AppendLine("gl_FragColor = gl_Color * color;");
|
||||
}
|
||||
vert.AppendLine("}");
|
||||
return vert.ToString();
|
||||
|
@ -72,10 +73,11 @@ namespace LayoutBXLYT
|
|||
}
|
||||
|
||||
//For non material panes
|
||||
public void SetBasic(BasePane pane)
|
||||
public void SetBasic(BasePane pane, Color color)
|
||||
{
|
||||
var rotationMatrix = pane.GetRotationMatrix();
|
||||
SetMatrix("rotationMatrix", ref rotationMatrix);
|
||||
SetColor("color", color);
|
||||
}
|
||||
|
||||
public void SetVec4(string name, Vector4 value)
|
||||
|
|
|
@ -471,7 +471,7 @@ namespace LayoutBXLYT
|
|||
else if (pane is IBoundryPane)
|
||||
{
|
||||
shader.Enable();
|
||||
shader.SetBasic(pane);
|
||||
shader.SetBasic(pane, Color.White);
|
||||
BxlytToGL.DrawBoundryPane(pane, GameWindow, effectiveAlpha, isSelected);
|
||||
shader.Disable();
|
||||
}
|
||||
|
@ -549,7 +549,7 @@ namespace LayoutBXLYT
|
|||
return;
|
||||
|
||||
shader.Enable();
|
||||
shader.SetBasic(pane);
|
||||
shader.SetBasic(pane, Color.Black);
|
||||
|
||||
Vector2[] TexCoords = new Vector2[] {
|
||||
new Vector2(1,1),
|
||||
|
@ -558,7 +558,7 @@ namespace LayoutBXLYT
|
|||
new Vector2(1,0)
|
||||
};
|
||||
|
||||
Color color = Color.White;
|
||||
Color color = Color.Black;
|
||||
if (SelectedPanes.Contains(pane))
|
||||
color = Color.Red;
|
||||
|
||||
|
|
Loading…
Reference in a new issue