Beispiel #1
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);
                SetRenderState();
            }

            GL.Enable(EnableCap.PrimitiveRestart);
            GL.PrimitiveRestartIndex(0xFFFFFFFF);

            RenderMesh?.Draw(shader);
        }
Beispiel #2
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);
        }
Beispiel #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);
        }