Beispiel #1
0
        public OGLPipeline(
            OGLConstBuffer Buffer,
            OGLRenderTarget RenderTarget,
            OGLRasterizer Rasterizer,
            OGLShader Shader)
        {
            this.Buffer       = Buffer;
            this.RenderTarget = RenderTarget;
            this.Rasterizer   = Rasterizer;
            this.Shader       = Shader;

            //These values match OpenGL's defaults
            Old = new GalPipelineState
            {
                FrontFace = GalFrontFace.CCW,

                CullFaceEnabled = false,
                CullFace        = GalCullFace.Back,

                DepthTestEnabled  = false,
                DepthWriteEnabled = true,
                DepthFunc         = GalComparisonOp.Less,
                DepthRangeNear    = 0,
                DepthRangeFar     = 1,

                StencilTestEnabled = false,

                StencilBackFuncFunc = GalComparisonOp.Always,
                StencilBackFuncRef  = 0,
                StencilBackFuncMask = UInt32.MaxValue,
                StencilBackOpFail   = GalStencilOp.Keep,
                StencilBackOpZFail  = GalStencilOp.Keep,
                StencilBackOpZPass  = GalStencilOp.Keep,
                StencilBackMask     = UInt32.MaxValue,

                StencilFrontFuncFunc = GalComparisonOp.Always,
                StencilFrontFuncRef  = 0,
                StencilFrontFuncMask = UInt32.MaxValue,
                StencilFrontOpFail   = GalStencilOp.Keep,
                StencilFrontOpZFail  = GalStencilOp.Keep,
                StencilFrontOpZPass  = GalStencilOp.Keep,
                StencilFrontMask     = UInt32.MaxValue,

                BlendIndependent = false,

                PrimitiveRestartEnabled = false,
                PrimitiveRestartIndex   = 0
            };

            for (int Index = 0; Index < GalPipelineState.RenderTargetsCount; Index++)
            {
                Old.Blends[Index] = BlendState.Default;

                Old.ColorMasks[Index] = ColorMaskState.Default;
            }
        }
Beispiel #2
0
        public OGLRenderer()
        {
            Buffer = new OGLConstBuffer();

            Texture = new OGLTexture();

            RenderTarget = new OGLRenderTarget(Texture as OGLTexture);

            Rasterizer = new OGLRasterizer();

            Shader = new OGLShader(Buffer as OGLConstBuffer);

            Pipeline = new OGLPipeline(Buffer as OGLConstBuffer, Rasterizer as OGLRasterizer, Shader as OGLShader);

            ActionsQueue = new ConcurrentQueue <Action>();
        }