示例#1
0
        public void Draw(Shader shader, RSkeleton skeleton)
        {
            if (!Visible)
            {
                return;
            }

            if (skeleton != null)
            {
                shader.SetMatrix4x4("transform", skeleton.GetAnimationSingleBindsTransform(SingleBindIndex));
            }

            // TODO: When is primitive restart used?
            GL.Enable(EnableCap.PrimitiveRestart);
            GL.PrimitiveRestartIndex(0xFFFFFFFF);

            RenderMesh?.Draw(shader);
        }
示例#2
0
        public void Draw(Shader shader, Camera camera, RSkeleton skeleton)
        {
            if (!Visible)
            {
                return;
            }

            if (skeleton != null)
            {
                var matrix = Matrix4.Identity;
                if (SingleBindIndex >= 0)
                {
                    matrix = skeleton.GetAnimationSingleBindsTransform(SingleBindIndex);
                }
                shader.SetMatrix4x4("transform", ref matrix);
            }

            // TODO: ???
            GL.Enable(EnableCap.PrimitiveRestart);
            GL.PrimitiveRestartIndex(0xFFFFFFFF);

            RenderMesh?.Draw(shader);
        }
示例#3
0
        public void Draw(Shader shader, Camera camera, RSkeleton skeleton)
        {
            if (!Visible)
            {
                return;
            }

            if (skeleton != null)
            {
                var matrix = Matrix4.Identity;
                if (SingleBindIndex >= 0)
                {
                    matrix = skeleton.GetAnimationSingleBindsTransform(SingleBindIndex);
                }
                shader.SetMatrix4x4("transform", ref matrix);
            }

            if (Material != null)
            {
                SetTextureUniforms(shader);
            }

            RenderMesh?.Draw(shader, camera);
        }
示例#4
0
文件: RMesh.cs 项目: itzinvy/SSBHLib
 private void SetRenderState()
 {
     RenderMesh.SetRenderState(Material);
 }