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 FusionEngine.Lighting.Light3D(); nl.Read( ); Lights.Add(nl); } Entity3D re = new Entity3D(); Root = re; re.Read( ); fs.Close( ); }
public void DrawShadowMap(SceneGraph3D graph) { Active = this; Cam3D cam = new Cam3D(); Effect.FXG.Cam = cam; cam.FOV = 90; cam.MaxZ = Quality.ShadowDepth; Effect.FXG.Proj = cam.ProjMat; graph.CamOverride = cam; cam.LocalPos = LocalPos; cam.MaxZ = Quality.ShadowDepth; // cam.LocalTurn = LocalTurn; int fn = 0; TextureTarget f = ShadowFB.SetFace(fn); SetCam(f, cam); graph.RenderDepth( ); SetCam(ShadowFB.SetFace(1), cam); graph.RenderDepth( ); // ShadowFB.Release(); graph.CamOverride = null; SetCam(ShadowFB.SetFace(2), cam); graph.RenderDepth( ); SetCam(ShadowFB.SetFace(3), cam); graph.RenderDepth( ); SetCam(ShadowFB.SetFace(4), cam); graph.RenderDepth( ); SetCam(ShadowFB.SetFace(5), cam); graph.RenderDepth( ); ShadowFB.Release( ); graph.CamOverride = null; }