Exemplo n.º 1
0
        public void RenderFinal()
        {
            FinalFB.Bind();

            foreach (var light in Graph.Lights)
            {
                FinalFx.Light = light;

                Draw.IntelliDraw.BeginDraw();

                Draw.IntelliDraw.DrawImg(0, H, W, -H);

                Draw.IntelliDraw.Binder bind = () =>
                {
                    PositionFB.BB.Bind(0);
                    NormalFB.BB.Bind(1);
                    NormalsFB.BB.Bind(2);
                    DiffuseFB.BB.Bind(3);
                };

                Draw.IntelliDraw.EndDraw(FinalFx, bind);

                PositionFB.BB.Release(0);
                NormalFB.BB.Release(1);
                NormalsFB.BB.Release(2);
                DiffuseFB.BB.Release(3);
            }

            FinalFB.Release();
        }
Exemplo n.º 2
0
        public void RenderFinal()
        {
            FinalFB.Bind();

            bool first  = true;
            bool second = true;

            foreach (var light in Graph.Lights)
            {
                if (first)
                {
                    GL.Enable(EnableCap.Blend);
                    GL.BlendFunc(BlendingFactor.One, BlendingFactor.Zero);
                    first = false;
                }
                else if (second)
                {
                    GL.BlendFunc(BlendingFactor.One, BlendingFactor.One);
                    second = false;
                }
                FinalFX.Light = light;

                Draw.IntelliDraw.BeginDraw();

                Draw.IntelliDraw.DrawImg(0, H, W, -H);

                Draw.IntelliDraw.Binder bind = () =>
                {
                    for (int i = 0; i < FB.Targets.Count; i++)
                    {
                        FB.Targets[i].Bind(i);
                    }
                    //PositionFB.BB.Bind(0);
                    //NormalFB.BB.Bind(1);
                    //NormalsFB.BB.Bind(2);
                    //DiffuseFB.BB.Bind(3);
                };

                Draw.IntelliDraw.EndDraw(FinalFX, bind);

                for (int i = 0; i < FB.Targets.Count; i++)
                {
                    FB.Targets[i].Release(i);
                }
            }

            FinalFB.Release();
        }