public void LoadGraph(string file) { FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read); BinaryReader r = new BinaryReader(fs); Help.IOHelp.r = r; int cc = r.ReadInt32(); for (int i = 0; i < cc; i++) { Cam3D nc = new Cam3D(); nc.Read(); Cams.Add(nc); } int lc = r.ReadInt32(); for (int i = 0; i < lc; i++) { Light3D nl = new Light3D(); nl.Read(); Lights.Add(nl); } //Entity3D re = new Entity3D(); Node3D new_e = null; Root = ReadNode(); //re.Read(); fs.Close(); Root.SetMultiPass(); }
public void PresentNormalMap(Cam3D c) { SetMats(c); Bind(); PreRender(); RenderNormalMap(); PostRender(); Release(); }
public void PresentPositionMap(Cam3D c) { SetMats(c); Bind(); PreRender(); RenderPositionMap(); PostRender(); Release(); }
public void PresentSSRExtrasMap(Cam3D c) { SetMats(c); Bind(); PreRender(); RenderSSRExtrasMap(); PostRender(); Release(); }
public void RenderNodeSSRExtrasMap(Node3D node, Cam3D c) { var e3 = node as Entity3D; e3.PresentSSRExtrasMap(c); foreach (var node2 in node.Sub) { RenderNodeSSRExtrasMap(node2, c); } }
public void RenderNodeNormalMap(Node3D node, Cam3D c) { var e3 = node as Entity3D; e3.PresentNormalMap(c); foreach (var snode in node.Sub) { RenderNodeNormalMap(snode, c); } }
public override void Present(Cam3D c) { // GL.MatrixMode(MatrixMode.Projection); GL.LoadMatrix(ref c.ProjMat); SetMats(c); Bind(); PreRender(); Render(); PostRender(); Release(); // foreach (var s in Sub) { s.Present(c); } }
public virtual void Render() { LastCam = Cams[0]; SubGraph?.Render(); List <string> defTags = new List <string> { "All" }; RenderNodeByTags(defTags, Root); }
public virtual void RenderNodeDepth(Node3D node, Cam3D c) { var e3 = node as Entity3D; if (node.CastDepth) { node.PresentDepth(c); } foreach (Node3D snode in node.Sub) { RenderNodeDepth(snode, c); } }
public override void PresentDepth(Cam3D c) { SetMats(c); Bind(); PreRender(); RenderDepth(); PostRender(); Release(); foreach (Node3D s in Sub) { // s.PresentDepth ( c ); } }
public void SetMats(Cam3D c) { int w = App.AppInfo.RW; int h = App.AppInfo.RH; int aw = App.AppInfo.W; int ah = App.AppInfo.H; Effect.FXG.Proj = c.ProjMat; Effect.FXG.Cam = c; // GL.MatrixMode(MatrixMode.Modelview); Matrix4 mm = Matrix4.Identity; // mm = c.CamWorld; //mm = mm * Matrix4.Invert(Matrix4.CreateTranslation(c.WorldPos)); mm = World; //var wp = LocalPos; //mm = mm*Matrix4.CreateTranslation(wp); //GL.LoadMatrix(ref mm); Effect.FXG.Local = mm; Effect.FXG.PrevLocal = PrevWorld; }
public virtual void Add(Cam3D c) { Cams.Add(c); }