99 lines
No EOL
2.5 KiB
C#
99 lines
No EOL
2.5 KiB
C#
namespace Oriels;
|
|
|
|
public class Compositor {
|
|
|
|
// these are in a weird place,
|
|
// as a process would not be hosted by a compositor...
|
|
Backrooms.Mono backrooms = new Backrooms.Mono();
|
|
Greenyard.Mono greenyard = new Greenyard.Mono();
|
|
bool other = false;
|
|
|
|
public void Init() {
|
|
backrooms.Init();
|
|
greenyard.Init();
|
|
}
|
|
|
|
public void Frame() {
|
|
Mono mono = Mono.inst;
|
|
|
|
// backrooms.oriel.Frame();
|
|
// greenyard.oriel.Frame();
|
|
|
|
// // mono.space.Frame();
|
|
// Glove rGlove = Mono.inst.rGlove;
|
|
// Vec3 cursor = rGlove.virtualGlove.position;
|
|
|
|
// if (other) {
|
|
// greenyard.Frame();
|
|
|
|
// Vec3 localCursor = backrooms.oriel.matrixInv.Transform(cursor);
|
|
// if (backrooms.oriel.bounds.Contains(localCursor + backrooms.oriel.bounds.center)) {
|
|
// Console.WriteLine("in backrooms");
|
|
// other = false;
|
|
// }
|
|
// } else {
|
|
// backrooms.Frame();
|
|
|
|
// Vec3 localCursor = greenyard.oriel.matrixInv.Transform(cursor);
|
|
// if (greenyard.oriel.bounds.Contains(localCursor + greenyard.oriel.bounds.center)) {
|
|
// Console.WriteLine("in greenyard");
|
|
// other = true;
|
|
// }
|
|
// }
|
|
|
|
// render buffers ? or just use the depth buffer?
|
|
|
|
mono.space.Frame();
|
|
// backrooms.oriel.Render(); // -> Frame() by moving Input specific parts to the compositor?
|
|
// backrooms.Render();
|
|
// greenyard.oriel.Render();
|
|
// greenyard.Render();
|
|
|
|
// active oriel
|
|
// how to show this?
|
|
// well popping up a wireframe would get in the way and look bad
|
|
// and a glow would be hard to keep consistent across backgrounds
|
|
// am I bringing the crown back?
|
|
|
|
// matFrame.Wireframe = true;
|
|
// matFrame.DepthTest = DepthTest.Always;
|
|
// matFrame.SetVector("_cursor", cursor);
|
|
// matFrame.SetFloat("_time", Time.Totalf);
|
|
// Mesh.Cube.Draw(matFrame,
|
|
// Matrix.TRS(bounds.center, ori, bounds.dimensions),
|
|
// new Color(0.1f, 0.1f, 0.1f)
|
|
// );
|
|
// Model model = Model.FromFile("oriel.glb");
|
|
// ~ Mesh mesh = model.GetMesh("oriel");
|
|
}
|
|
|
|
void Place() {
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
COMMENTS
|
|
|
|
mono (kernel)
|
|
compositor
|
|
oriel (client)
|
|
app
|
|
|
|
Frame and Render is not a useful distinction
|
|
cycle or loop or step instead of frame?
|
|
draw instead of render?
|
|
|
|
we keep combining the two, and it's not a good idea
|
|
as input can be polled at a higher frequency than rendering can be output?
|
|
|
|
Hertz & Frame
|
|
|
|
does a process ever not have a GUI? *can be hidden &| locked
|
|
we are trying to skip the tty!
|
|
|
|
would be nice to have a dedicated thread(s)
|
|
for essential GUI
|
|
|
|
*/ |