Пример #1
0
        public LightSource()
        {
            shadowBuffer = GL.GenFramebuffer();
            GL.BindFramebuffer(FramebufferTarget.Framebuffer, shadowBuffer);
            shadowMap = Texture2D.CreateShadowMap(width, heigth);
            //shadowMap.BindTexture();
            GL.DrawBuffer(DrawBufferMode.None);
            GL.ReadBuffer(ReadBufferMode.None);
            GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);

            //load shader
            shdr = ShaderManager.GetInstance.GetShader("shadow");

            //locate source
            pos  = new Vector3(-1f, 2f, 1f);
            look = new Vector3(0f, 0f, 0f);


            projection = Matrix4.CreateOrthographic(5f, 5f, 0.1f, 5f);
            direction  = Matrix4.LookAt(pos, look, new Vector3(0f, 1f, 0f));

            UniformBufferManager ubm = UniformBufferManager.GetInstance;

            ubo = (UniformBufferSkeleton)ubm.GetBuffer("skeleton");
            ubs = (UniformBufferSpace)ubm.GetBuffer("space");
            ubl = (UniformBufferLight)ubm.GetBuffer("light");
        }
Пример #2
0
        internal MainRenderer()
        {
            UniformBufferManager ubm = UniformBufferManager.GetInstance;

            skeleton = (UniformBufferSkeleton)ubm.GetBuffer("skeleton");

            ubs = (UniformBufferSpace)ubm.GetBuffer("space");
            ubl = (UniformBufferLight)ubm.GetBuffer("light");
            ubl.SetNearPlane(0.1f);
            ubl.SetFarPlane(10.0f);
            renderer = new ModelRenderer();
        }
Пример #3
0
 public ModelRenderer()
 {
     outline = ShaderManager.GetInstance.GetShader("outline");
     ubs     = (UniformBufferSpace)UniformBufferManager.GetInstance.GetBuffer("space");
 }