generic mat/shader names
This commit is contained in:
parent
dd6206c5a0
commit
104617e55e
2 changed files with 10 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
|||
#include "stereokit.hlsli"
|
||||
|
||||
//--name = dofdev/backbox
|
||||
//--name = dofdev/backface
|
||||
//--color:color = 1, 1, 1, 1
|
||||
|
||||
float4 color;
|
18
src/Arts.cs
18
src/Arts.cs
|
@ -9,8 +9,8 @@ static class Arts
|
|||
static Dictionary<string, Mesh> meshes = new();
|
||||
static Material mat_mono = new Material("mono.hlsl");
|
||||
static Material mat_unlit = new Material("unlit.hlsl");
|
||||
static Material mat_box = new Material("unlit.hlsl");
|
||||
static Material mat_backbox = new Material("backbox.hlsl");
|
||||
static Material mat_both = new Material("unlit.hlsl");
|
||||
static Material mat_backface = new Material("backface.hlsl");
|
||||
static Material mat_justcolor = new Material("justcolor.hlsl");
|
||||
|
||||
public static Vec3 box_shake = new(0, 0, 0);
|
||||
|
@ -39,12 +39,12 @@ static class Arts
|
|||
Color.White
|
||||
);
|
||||
|
||||
mat_backbox.FaceCull = Cull.Front;
|
||||
mat_backbox.Transparency = Transparency.Add;
|
||||
mat_backbox.DepthTest = DepthTest.LessOrEq;
|
||||
mat_backbox.DepthWrite = false;
|
||||
mat_backface.FaceCull = Cull.Front;
|
||||
mat_backface.Transparency = Transparency.Add;
|
||||
mat_backface.DepthTest = DepthTest.LessOrEq;
|
||||
mat_backface.DepthWrite = false;
|
||||
|
||||
mat_box.Chain = mat_backbox;
|
||||
mat_both.Chain = mat_backface;
|
||||
}
|
||||
|
||||
public static void Frame()
|
||||
|
@ -106,7 +106,7 @@ static class Arts
|
|||
Hierarchy.Push(box_m4);
|
||||
// meshes["InsideOut"].Draw(mat_unlit, Matrix.Identity);
|
||||
meshes["InsideOut"].Draw(
|
||||
mat_box,
|
||||
mat_both,
|
||||
Matrix.Identity
|
||||
);
|
||||
meshes["Corrugation"].Draw(
|
||||
|
@ -227,7 +227,7 @@ static class Arts
|
|||
bool hole_flip = Vec3.Dot(hole_normal, hole.Value.ToVec3) < 0.0;
|
||||
|
||||
meshes[hole_flip ? "Hole" : "HoleFlip"].Draw(
|
||||
mat_box,
|
||||
mat_both,
|
||||
Matrix.TRS(
|
||||
hole.Key.ToVec3,
|
||||
Quat.LookDir(hole.Value.ToVec3),
|
||||
|
|
Loading…
Add table
Reference in a new issue