Esempio n. 1
0
        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();
        }
Esempio n. 2
0
 public void PresentNormalMap(Cam3D c)
 {
     SetMats(c);
     Bind();
     PreRender();
     RenderNormalMap();
     PostRender();
     Release();
 }
Esempio n. 3
0
 public void PresentPositionMap(Cam3D c)
 {
     SetMats(c);
     Bind();
     PreRender();
     RenderPositionMap();
     PostRender();
     Release();
 }
Esempio n. 4
0
 public void PresentSSRExtrasMap(Cam3D c)
 {
     SetMats(c);
     Bind();
     PreRender();
     RenderSSRExtrasMap();
     PostRender();
     Release();
 }
Esempio n. 5
0
        public void RenderNodeSSRExtrasMap(Node3D node, Cam3D c)
        {
            var e3 = node as Entity3D;

            e3.PresentSSRExtrasMap(c);
            foreach (var node2 in node.Sub)
            {
                RenderNodeSSRExtrasMap(node2, c);
            }
        }
Esempio n. 6
0
        public void RenderNodeNormalMap(Node3D node, Cam3D c)
        {
            var e3 = node as Entity3D;

            e3.PresentNormalMap(c);

            foreach (var snode in node.Sub)
            {
                RenderNodeNormalMap(snode, c);
            }
        }
Esempio n. 7
0
 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); }
 }
Esempio n. 8
0
        public virtual void Render()
        {
            LastCam = Cams[0];

            SubGraph?.Render();
            List <string> defTags = new List <string>
            {
                "All"
            };

            RenderNodeByTags(defTags, Root);
        }
Esempio n. 9
0
        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);
            }
        }
Esempio n. 10
0
 public override void PresentDepth(Cam3D c)
 {
     SetMats(c);
     Bind();
     PreRender();
     RenderDepth();
     PostRender();
     Release();
     foreach (Node3D s in Sub)
     {
         //     s.PresentDepth ( c );
     }
 }
Esempio n. 11
0
        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;
        }
Esempio n. 12
0
 public virtual void Add(Cam3D c)
 {
     Cams.Add(c);
 }