示例#1
0
        public void Render(Camera Camera, RSkeleton Skeleton = null)
        {
            Shader shader = GetCurrentShader();

            if (!shader.LinkStatusIsOk)
            {
                return;
            }

            shader.UseProgram();

            SetUniforms(shader);
            SetCameraUniforms(Camera, shader);

            shader.EnableVertexAttributes();

            // Bones
            int blockIndex = GL.GetUniformBlockIndex(shader.Id, "Bones");

            boneUniformBuffer.BindBase(BufferRangeTarget.UniformBuffer, blockIndex);
            if (Skeleton != null)
            {
                boneBinds = Skeleton.GetAnimationTransforms();
            }
            boneUniformBuffer.SetData(boneBinds, BufferUsageHint.DynamicDraw);

            DrawMeshes(Camera, Skeleton, shader);

            shader.DisableVertexAttributes();
        }
示例#2
0
        public void Render(Camera camera, RSkeleton Skeleton = null)
        {
            Shader shader = ShaderContainer.GetCurrentRModelShader();

            if (!shader.LinkStatusIsOk)
            {
                return;
            }

            shader.UseProgram();

            SetRenderSettingsUniforms(shader);
            SetCameraUniforms(camera, shader);

            // Bones
            if (boneUniformBuffer != null)
            {
                boneUniformBuffer.BindBlock(shader);
                if (Skeleton != null)
                {
                    boneBinds = Skeleton.GetAnimationTransforms();
                }
                boneUniformBuffer.SetValues("transforms", boneBinds);
            }

            DrawMeshes(Skeleton, shader);
        }
示例#3
0
        public void Render(Camera Camera, RSkeleton Skeleton = null)
        {
            Shader shader = GetCurrentShader();

            if (!shader.LinkStatusIsOk)
            {
                return;
            }

            shader.UseProgram();

            SetUniforms(shader);
            SetCameraUniforms(Camera, shader);

            // Bones
            boneUniformBuffer.BindBlock(shader);
            if (Skeleton != null)
            {
                boneBinds = Skeleton.GetAnimationTransforms();
            }
            boneUniformBuffer.SetValues("transforms", boneBinds);

            DrawMeshes(Camera, Skeleton, shader);
        }