Esempio n. 1
0
        public void Draw(bool shadows)
        {
            // OpenTK.Graphics.OpenGL4.GL.Disable(OpenTK.Graphics.OpenGL4.EnableCap.Blend);

            bool first = true;

            if (Lights.Count == 0)
            {
                Render.Begin();
                DrawNode(Root);
                UnlitImage.Bind();
                Render.End2D();
                UnlitImage.Release();
            }

            foreach (var l in Lights)
            {
                Render.Begin();
                DrawNode(Root);
                LitImage.Light  = l;
                LitImage.Graph  = this;
                LitImage.LightZ = l.Z;
                //  Console.WriteLine("LZ:" + l.Z);
                if (LitImage.Light != null)
                {
                    LitImage.Bind();
                    Render.SetBlend(BlendMode.Alpha);;
                    if (shadows)
                    {
                        l.SB1.BB.Bind(1);
                    }
                    else
                    {
                        White1.Bind(1);
                    }
                    if (first)
                    {
                        Render.SetBlend(BlendMode.Alpha);
                        first = false;
                    }
                    else
                    {
                        Render.SetBlend(BlendMode.Add);
                    }

                    Render.End2D();
                    if (shadows)
                    {
                        l.SB1.BB.Release(1);
                    }
                    else
                    {
                        White1.Release(1);
                    }
                    LitImage.Release();
                }
            }
        }
Esempio n. 2
0
 public void DrawSingleNode(GraphNode node)
 {
     Render.Begin();
     node.SyncCoords();
     DrawNode(node);
     UnlitImage.Bind();
     Render.End2D();
     UnlitImage.Release();
 }