Пример #1
0
        public StensilTest_TriangleColoredVertexRenderTechnique()
        {
            layconst = new VertexLayoutConstructor(Vertex.Size)
                       .AddPositionElementAsVector3()
                       .AddNormalElementAsVector3();

            var d = new CombinedShadersLoader(new ManifestResourceLoader(typeof(TriangleColoredVertexRenderTechnique <>)));

            pass            = new D3DShaderTechniquePass(d.Load(path, "CV_"));
            flatShadingPass = new D3DShaderTechniquePass(d.Load(gs_flat_shading, "FCV_"));
            wireframePass   = new D3DShaderTechniquePass(d.Load(wireframe, "WCV_"));

            //debug1 = new ShaderDebugMode(new DirectoryInfo(@"D:\Storage_D\trash\archive\shaders\"), pass);
            //debug1.Activate();
            //debug2 = new ShaderDebugMode(new DirectoryInfo(@"D:\Storage_D\trash\archive\shaders\"), flatShadingPass);
            //debug2.Activate();

            depthStencilStateDesc = D3DDepthStencilDefinition.DepthEnabled;
            blendStateDesc        = D3DBlendStateDescriptions.BlendStateEnabled;
            // blendStateDesc.AlphaToCoverageEnable = true;

            vertexShader  = new DisposableSetter <VertexShader>(disposer);
            pixelShader   = new DisposableSetter <PixelShader>(disposer);
            flatShadingGS = new DisposableSetter <GeometryShader>(disposer);
            inputLayout   = new DisposableSetter <InputLayout>(disposer);

            wireframePS = new DisposableSetter <PixelShader>(disposer);
            wireframeGS = new DisposableSetter <GeometryShader>(disposer);
        }
Пример #2
0
        public OneFrameFlatWhiteRenderTechnique()
        {
            var d = new CombinedShadersLoader(new ManifestResourceLoader(typeof(OneFrameFlatWhiteRenderTechnique <>)));

            pass = new D3DShaderTechniquePass(d.Load(path, "BW_"));

            layconst = new VertexLayoutConstructor(Vertex.Size)
                       .AddPositionElementAsVector3();

            vertexShader = new DisposableSetter <VertexShader>(disposer);
            pixelShader  = new DisposableSetter <PixelShader>(disposer);
            inputLayout  = new DisposableSetter <InputLayout>(disposer);

            rasterizerStateDescription = new RasterizerStateDescription2()
            {
                CullMode             = CullMode.Front,
                FillMode             = FillMode.Solid,
                IsMultisampleEnabled = false,

                IsFrontCounterClockwise  = false,
                IsScissorEnabled         = false,
                IsAntialiasedLineEnabled = false,
                DepthBias            = 0,
                DepthBiasClamp       = .0f,
                SlopeScaledDepthBias = .0f
            };
        }
        public SpherePointRenderTechnique()
        {
            layconst = new VertexLayoutConstructor(Vertex.Size)
                       .AddPositionElementAsVector4()
                       .AddColorElementAsVector4();
            var d = new CombinedShadersLoader(new ManifestResourceLoader(typeof(SpherePointRenderTechnique <>)));

            pass = new D3DShaderTechniquePass(d.Load(path, "SpP_"));

            vertexShader      = new DisposableSetter <VertexShader>(disposer);
            pixelShader       = new DisposableSetter <PixelShader>(disposer);
            geometryShader    = new DisposableSetter <GeometryShader>(disposer);
            depthStencilState = new DisposableSetter <DepthStencilState>(disposer);
            inputLayout       = new DisposableSetter <InputLayout>(disposer);

            rasterizerStateDescription = new RasterizerStateDescription2()
            {
                CullMode             = CullMode.None,
                FillMode             = FillMode.Solid,
                IsMultisampleEnabled = false,

                IsFrontCounterClockwise  = false,
                IsScissorEnabled         = false,
                IsAntialiasedLineEnabled = false,
                DepthBias            = 0,
                DepthBiasClamp       = .0f,
                SlopeScaledDepthBias = .0f
            };
        }
Пример #4
0
        //readonly ShaderDebugMode debug1;

        public BackgroundRenderTechnique()
        {
            var d = new CombinedShadersLoader(new ManifestResourceLoader(typeof(BackgroundRenderTechnique <>)));

            pass = new D3DShaderTechniquePass(d.Load(path, "BG_"));

            vertexShader      = new DisposableSetter <VertexShader>(disposer);
            pixelShader       = new DisposableSetter <PixelShader>(disposer);
            depthStencilState = new DisposableSetter <DepthStencilState>(disposer);

            rasterizerStateDescription = new RasterizerStateDescription2()
            {
                CullMode             = CullMode.None,
                FillMode             = FillMode.Solid,
                IsMultisampleEnabled = false,

                IsFrontCounterClockwise  = false,
                IsScissorEnabled         = false,
                IsAntialiasedLineEnabled = false,
                DepthBias            = 0,
                DepthBiasClamp       = .0f,
                SlopeScaledDepthBias = .0f
            };

            //debug1 = new ShaderDebugMode(new System.IO.DirectoryInfo(@"D:\Storage_D\trash\archive\shaders\"), pass);
            //debug1.Activate();
        }
Пример #5
0
        static SkyGradientColoringRenderTechnique()
        {
            layconst = new VertexLayoutConstructor()
                       .AddPositionElementAsVector3();

            var d = new CombinedShadersLoader(typeof(SkyGradientColoringRenderTechnique));

            pass = new D3DShaderTechniquePass(d.Load(path, "SKY_"));
        }
Пример #6
0
        static TerrainClipmapsRenderTechnique()
        {
            layconst = new VertexLayoutConstructor()
                       .AddTexCoorElementAsVector2();

            var d = new CombinedShadersLoader(typeof(TerrainClipmapsRenderTechnique));

            pass = new D3DShaderTechniquePass(d.Load(path, "TRR_"));
        }
Пример #7
0
        public BillboardRenderTechnique()
        {
            layconst = new VertexLayoutConstructor(Vertex.Size)
                       .AddPositionElementAsVector4()
                       .AddColorElementAsVector3()
            ;

            var d = new CombinedShadersLoader(new ManifestResourceLoader(this.GetType()));

            VS_FS          = new D3DShaderTechniquePass(d.Load(path_VS_FS, "BILL_"));
            GS_ScreenFixed = new D3DShaderTechniquePass(d.Load(path_GS_ScreenFixed, "BILL_"));
            GS_SizeFixed   = new D3DShaderTechniquePass(d.Load(path_GS_SizeFixed, "BILL_"));

            vertexShader  = new DisposableSetter <VertexShader>(disposer);
            pixelShader   = new DisposableSetter <PixelShader>(disposer);
            gsScreenFixed = new DisposableSetter <GeometryShader>(disposer);
            inputLayout   = new DisposableSetter <InputLayout>(disposer);
            gsSizeFixed   = new DisposableSetter <GeometryShader>(disposer);
        }
Пример #8
0
        static SpherePointRenderStrategy()
        {
            layconst = new VertexLayoutConstructor()
                       .AddPositionElementAsVector3()
                       .AddColorElementAsVector4();

            var d = new CombinedShadersLoader(typeof(SpherePointRenderStrategy));

            pass = new D3DShaderTechniquePass(d.Load(path, "SPH_"));
        }
Пример #9
0
        static LineVertexRenderTechnique()
        {
            layconst = new VertexLayoutConstructor()
                       .AddPositionElementAsVector3()
                       .AddColorElementAsVector4();

            var d = new CombinedShadersLoader(typeof(LineVertexRenderTechnique));

            pass = new D3DShaderTechniquePass(d.Load(path, "LV_"));
        }
Пример #10
0
        static SkyPlaneWithParallaxRenderTechnique()
        {
            layconst = new VertexLayoutConstructor()
                       .AddPositionElementAsVector3()
                       .AddTexCoorElementAsVector2();

            var d = new CombinedShadersLoader(typeof(SkyPlaneWithParallaxRenderTechnique));

            pass = new D3DShaderTechniquePass(d.Load(path, "SKYPL_"));
        }
Пример #11
0
        static CameraViewsRenderTechnique()
        {
            layconst = new VertexLayoutConstructor(Vertex.Size)
                       .AddPositionElementAsVector3()
                       .AddNormalElementAsVector3()
                       .AddColorElementAsVector4();

            var d = new CombinedShadersLoader(new ECS.Common.ManifestResourceLoader(typeof(CameraViewsRenderTechnique <>)));

            pass = new D3DShaderTechniquePass(d.Load(path, "CameraViews_"));
        }
Пример #12
0
        //      ShaderDebugMode debug;
        public TriangleTexturedVertexRenderTechnique()
        {
            layconst = new VertexLayoutConstructor(Vertex.Size)
                       .AddPositionElementAsVector3()
                       .AddNormalElementAsVector3()
                       .AddTexCoorElementAsVector2();

            var d = new CombinedShadersLoader(new ManifestResourceLoader(typeof(TriangleTexturedVertexRenderTechnique <>)));

            pass            = new D3DShaderTechniquePass(d.Load(path, "TV_"));
            flatShadingPass = new D3DShaderTechniquePass(d.Load(gs_flat_shading, "TV_"));
            //debug = new ShaderDebugMode(new DirectoryInfo(@"D:\"), pass);
            //debug.Activate();

            depthStencilStateDesc = D3DDepthStencilDefinition.DepthEnabled;
            blendStateDesc        = D3DBlendStateDescriptions.BlendStateEnabled;

            vertexShader  = new DisposableSetter <VertexShader>(disposer);
            pixelShader   = new DisposableSetter <PixelShader>(disposer);
            inputLayout   = new DisposableSetter <InputLayout>(disposer);
            flatShadingGS = new DisposableSetter <GeometryShader>(disposer);
        }
Пример #13
0
        public LineVertexRenderTechnique()
        {
            layconst = new VertexLayoutConstructor(Vertex.Size)
                       .AddPositionElementAsVector4()
                       .AddColorElementAsVector4();

            var d = new CombinedShadersLoader(new ManifestResourceLoader(typeof(LineVertexRenderTechnique <>)));

            pass = new D3DShaderTechniquePass(d.Load(path, "L_"));

            vertexShader = new DisposableSetter <VertexShader>(disposer);
            pixelShader  = new DisposableSetter <PixelShader>(disposer);
            inputLayout  = new DisposableSetter <InputLayout>(disposer);
        }
Пример #14
0
        static AminRenderTechniqueSystem()
        {
            layconst = new VertexLayoutConstructor()
                       .AddSVPositionElementAsVector4()
                       .AddNormalElementAsVector3()
                       .AddColorElementAsVector4()
                       .AddTexCoorElementAsVector2()
                       .AddBlendIndicesElementAsUInt4()
                       .AddBlendWeightElementAsVector4();

            var d = new CombinedShadersLoader(typeof(AminRenderTechniqueSystem));

            pass = new D3DShaderTechniquePass(d.Load(path, "ANIM_"));
        }
        public OITTriangleColoredVertexRenderTechnique()
        {
            layconst = new VertexLayoutConstructor(Vertex.Size)
                       .AddPositionElementAsVector3()
                       .AddNormalElementAsVector3()
                       .AddColorElementAsVector4();

            var d = new CombinedShadersLoader(new ManifestResourceLoader(typeof(OITTriangleColoredVertexRenderTechnique <>)));

            pass      = new D3DShaderTechniquePass(d.Load(oit, "OIT_"));
            quardPass = new D3DShaderTechniquePass(d.Load(quard, "QOIT_"));

            depthStencilStateDesc = D3DDepthStencilDefinition.DepthEnabled.Description;
            blendStateDesc        = D3DBlendStateDescriptions.BlendStateEnabled;

            vertexShader = new DisposableSetter <VertexShader>(disposer);
            pixelShader  = new DisposableSetter <PixelShader>(disposer);
            inputLayout  = new DisposableSetter <InputLayout>(disposer);

            vertexShaderQuard = new DisposableSetter <VertexShader>(disposer);
            pixelShaderQuard  = new DisposableSetter <PixelShader>(disposer);

            colorTargetTex2D           = new DisposableSetter <Texture2D>(disposer);
            alphaTargetTex2D           = new DisposableSetter <Texture2D>(disposer);
            colorTargetNoMSAATexture2D = new DisposableSetter <Texture2D>(disposer);
            alphaTargetNoMSAATexture2D = new DisposableSetter <Texture2D>(disposer);

            colorTargetNoMSAA = new DisposableSetter <ShaderResourceView>(disposer);
            alphaTargetNoMSAA = new DisposableSetter <ShaderResourceView>(disposer);

            colorTargetView = new DisposableSetter <RenderTargetView>(disposer);
            alphaTargetView = new DisposableSetter <RenderTargetView>(disposer);
            quardTargetView = new DisposableSetter <RenderTargetView>(disposer);

            targetSampler = new DisposableSetter <SamplerState>(disposer);
        }
Пример #16
0
        static TerrainRenderTechnique()
        {
            layconst = new VertexLayoutConstructor()
                       .AddPositionElementAsVector3()
                       .AddNormalElementAsVector3()
                       .AddTexCoorElementAsVector2()
                       .AddTexCoorElementAsVector2()
                       .AddTangentElementAsVector3()
                       .AddBinormalElementAsVector3()
                       .AddColorElementAsVector4()
                       .AddTexCoorElementAsVector4();

            var d = new CombinedShadersLoader(typeof(TerrainRenderTechnique));

            pass = new D3DShaderTechniquePass(d.Load(path, "TRR_"));
        }