generic mat/shader names

This commit is contained in:
ethan merchant 2024-11-29 13:12:45 -05:00
parent dd6206c5a0
commit 104617e55e
2 changed files with 10 additions and 10 deletions

View file

@ -1,6 +1,6 @@
#include "stereokit.hlsli" #include "stereokit.hlsli"
//--name = dofdev/backbox //--name = dofdev/backface
//--color:color = 1, 1, 1, 1 //--color:color = 1, 1, 1, 1
float4 color; float4 color;

View file

@ -9,8 +9,8 @@ static class Arts
static Dictionary<string, Mesh> meshes = new(); static Dictionary<string, Mesh> meshes = new();
static Material mat_mono = new Material("mono.hlsl"); static Material mat_mono = new Material("mono.hlsl");
static Material mat_unlit = new Material("unlit.hlsl"); static Material mat_unlit = new Material("unlit.hlsl");
static Material mat_box = new Material("unlit.hlsl"); static Material mat_both = new Material("unlit.hlsl");
static Material mat_backbox = new Material("backbox.hlsl"); static Material mat_backface = new Material("backface.hlsl");
static Material mat_justcolor = new Material("justcolor.hlsl"); static Material mat_justcolor = new Material("justcolor.hlsl");
public static Vec3 box_shake = new(0, 0, 0); public static Vec3 box_shake = new(0, 0, 0);
@ -39,12 +39,12 @@ static class Arts
Color.White Color.White
); );
mat_backbox.FaceCull = Cull.Front; mat_backface.FaceCull = Cull.Front;
mat_backbox.Transparency = Transparency.Add; mat_backface.Transparency = Transparency.Add;
mat_backbox.DepthTest = DepthTest.LessOrEq; mat_backface.DepthTest = DepthTest.LessOrEq;
mat_backbox.DepthWrite = false; mat_backface.DepthWrite = false;
mat_box.Chain = mat_backbox; mat_both.Chain = mat_backface;
} }
public static void Frame() public static void Frame()
@ -106,7 +106,7 @@ static class Arts
Hierarchy.Push(box_m4); Hierarchy.Push(box_m4);
// meshes["InsideOut"].Draw(mat_unlit, Matrix.Identity); // meshes["InsideOut"].Draw(mat_unlit, Matrix.Identity);
meshes["InsideOut"].Draw( meshes["InsideOut"].Draw(
mat_box, mat_both,
Matrix.Identity Matrix.Identity
); );
meshes["Corrugation"].Draw( meshes["Corrugation"].Draw(
@ -227,7 +227,7 @@ static class Arts
bool hole_flip = Vec3.Dot(hole_normal, hole.Value.ToVec3) < 0.0; bool hole_flip = Vec3.Dot(hole_normal, hole.Value.ToVec3) < 0.0;
meshes[hole_flip ? "Hole" : "HoleFlip"].Draw( meshes[hole_flip ? "Hole" : "HoleFlip"].Draw(
mat_box, mat_both,
Matrix.TRS( Matrix.TRS(
hole.Key.ToVec3, hole.Key.ToVec3,
Quat.LookDir(hole.Value.ToVec3), Quat.LookDir(hole.Value.ToVec3),