Inheritance: RenderObject
        private void Draw2D([NotNull] RenderDrawContext context, [NotNull] RenderBackground renderBackground)
        {
            var target         = context.CommandList.RenderTarget;
            var graphicsDevice = context.GraphicsDevice;
            var destination    = new RectangleF(0, 0, 1, 1);

            var texture             = renderBackground.Texture;
            var textureIsLoading    = texture.ViewType == ViewType.Full && texture.FullQualitySize.Width != texture.ViewWidth;
            var textureSize         = textureIsLoading ? texture.FullQualitySize : new Size3(texture.ViewWidth, texture.ViewHeight, texture.ViewDepth);
            var imageBufferMinRatio = Math.Min(textureSize.Width / (float)target.ViewWidth, textureSize.Height / (float)target.ViewHeight);
            var sourceSize          = new Vector2(target.ViewWidth * imageBufferMinRatio, target.ViewHeight * imageBufferMinRatio);
            var source = new RectangleF((textureSize.Width - sourceSize.X) / 2, (textureSize.Height - sourceSize.Y) / 2, sourceSize.X, sourceSize.Y);

            if (textureIsLoading)
            {
                var verticalRatio   = texture.ViewHeight / (float)textureSize.Height;
                var horizontalRatio = texture.ViewWidth / (float)textureSize.Width;
                source.X      *= horizontalRatio;
                source.Width  *= horizontalRatio;
                source.Y      *= verticalRatio;
                source.Height *= verticalRatio;
            }

            // Setup the effect depending on the type of texture
            if (renderBackground.Texture.ViewDimension == TextureDimension.Texture2D)
            {
                background2DEffect.UpdateEffect(graphicsDevice);
                spriteBatch.Begin(context.GraphicsContext, SpriteSortMode.FrontToBack, BlendStates.Opaque, graphicsDevice.SamplerStates.LinearClamp, DepthStencilStates.DepthRead, null, background2DEffect);
            }
            else if (renderBackground.Texture.ViewDimension == TextureDimension.TextureCube)
            {
                backgroundCubemapEffect.UpdateEffect(graphicsDevice);
                spriteBatch.Begin(context.GraphicsContext, SpriteSortMode.FrontToBack, BlendStates.Opaque, graphicsDevice.SamplerStates.LinearClamp, DepthStencilStates.DepthRead, null, backgroundCubemapEffect);
                spriteBatch.Parameters.Set(BackgroundCubemapShaderKeys.Cubemap, renderBackground.Texture);
            }
            else
            {
                return; // not supported for the moment.
            }

            spriteBatch.Parameters.Set(BackgroundShaderKeys.Intensity, renderBackground.Intensity);
            spriteBatch.Draw(texture, destination, source, Color.White, 0, Vector2.Zero, layerDepth: -0.5f);
            spriteBatch.End();
        }
        private void Draw3D([NotNull] RenderDrawContext context, [NotNull] RenderView renderView, [NotNull] RenderBackground renderBackground)
        {
            var graphicsDevice = context.GraphicsDevice;
            var destination    = new RectangleF(0, 0, 1, 1);

            var texture = renderBackground.Texture;

            // Setup the effect depending on the type of texture
            if (renderBackground.Texture.ViewDimension == TextureDimension.Texture2D)
            {
                if (renderBackground.IsHorizon)
                {
                    skyboxTextureHorizonEffect.UpdateEffect(graphicsDevice);
                    spriteBatch.Begin(context.GraphicsContext, SpriteSortMode.FrontToBack, BlendStates.Opaque, null, DepthStencilStates.DepthRead, null, skyboxTextureHorizonEffect);
                    spriteBatch.Parameters.Set(SkyboxShaderTextureHorizonKeys.Texture, renderBackground.Texture);
                    spriteBatch.Parameters.Set(SkyboxShaderTextureHorizonKeys.AlphaColor, renderBackground.FullAlpha);
                    spriteBatch.Parameters.Set(SkyboxShaderTextureHorizonKeys.ZeroColor, renderBackground.ZeroAlpha);
                }
                else
                {
                    skyboxTextureEffect.UpdateEffect(graphicsDevice);
                    spriteBatch.Begin(context.GraphicsContext, SpriteSortMode.FrontToBack, BlendStates.Opaque, null, DepthStencilStates.DepthRead, null, skyboxTextureEffect);
                    spriteBatch.Parameters.Set(SkyboxShaderTextureKeys.Texture, renderBackground.Texture);
                }
            }
            else if (renderBackground.Texture.ViewDimension == TextureDimension.TextureCube)
            {
                skyboxCubemapEffect.UpdateEffect(graphicsDevice);
                spriteBatch.Begin(context.GraphicsContext, SpriteSortMode.FrontToBack, BlendStates.Opaque, null, DepthStencilStates.DepthRead, null, skyboxCubemapEffect);
                spriteBatch.Parameters.Set(SkyboxShaderCubemapKeys.CubeMap, renderBackground.Texture);
            }
            else
            {
                return; // not supported for the moment.
            }
            spriteBatch.Parameters.Set(SkyboxShaderBaseKeys.Intensity, renderBackground.Intensity);
            spriteBatch.Parameters.Set(SkyboxShaderBaseKeys.ViewInverse, Matrix.Invert(renderView.View));
            spriteBatch.Parameters.Set(SkyboxShaderBaseKeys.ProjectionInverse, Matrix.Invert(renderView.Projection));
            spriteBatch.Parameters.Set(SkyboxShaderBaseKeys.SkyMatrix, Matrix.Invert(Matrix.RotationQuaternion(renderBackground.Rotation)));
            spriteBatch.Draw(texture, destination, null, Color.White, 0, Vector2.Zero, layerDepth: -0.5f);
            spriteBatch.End();
        }