Exemplo n.º 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");
        }
Exemplo n.º 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();
        }
Exemplo n.º 3
0
        public MeshDrawerRigged(Mesh mesh, BoneController skelet, List <Morph> mor = null) : base(mesh, null, mor)
        {
            skeleton = skelet;
            UniformBufferManager ubm = UniformBufferManager.GetInstance;

            uniformBufferSkeleton = (UniformBufferSkeleton)ubm.GetBuffer("skeleton");
        }
Exemplo n.º 4
0
        public MeshDrawerRigged(Mesh mesh, Material[] mats, BoneController skelet, List <Morph> mor = null) : base(mesh, mats, mor)
        {
            skeleton = skelet;
            UniformBufferManager ubm = UniformBufferManager.GetInstance;

            uniformBufferSkeleton = (UniformBufferSkeleton)ubm.GetBuffer("skeleton");
            modelSkinner          = new ModelSkinning(mesh);
        }
Exemplo n.º 5
0
        public void OnLoad()
        {
            CoreEngine.MainScene.OnLoad();
            if (CoreEngine.vrSystem != null)
            {
                MainRender = new VR.VRRenderer();
            }
            else
            {
                MainRender = new MainRenderer();
            }

            TextRender = new TextRenderer();
            CoreEngine.MainScene.GetLight.BindShadowMap();

            UniformBufferManager ubm = UniformBufferManager.GetInstance;

            system = (UniformBufferSystem)ubm.GetBuffer("system");
            //TestTriangle();
        }