Пример #1
0
        public HLSLSprites2(Device device, bool withAlphaClip, string shaderFilePath)
            : base(device, shaderFilePath, VertexSprite2.VertexDeclaration, null)
        {
            if (!withAlphaClip)
            {
                _shadersEntryPoint.PixelShader_EntryPoint = "SpritePSNoClip";
            }

            //Create Constant Buffers interfaces ==================================================
            CBPerDraw = ToDispose(new CBuffer <CBPerDraw_Struct>(device, "PerDraw"));
            CBuffers.Add(CBPerDraw);

            CBTextureTransform = ToDispose(new CBuffer <CBTextureTransform_Struct>(device, "TextureTransform"));
            CBuffers.Add(CBTextureTransform);

            //Create the resource interfaces ==================================================
            SpriteTexture = new ShaderResource("SpriteTexture");
            ShaderResources.Add(SpriteTexture);

            //Create the Sampler interface ==================================================
            SpriteSampler = new ShaderSampler("SpriteSampler");
            ShaderSamplers.Add(SpriteSampler);

            //Load the shaders
            base.LoadShaders(_shadersEntryPoint);
        }
Пример #2
0
        public HLSLStaticEntitySprite(Device device, string shaderPath, VertexDeclaration VertexDeclaration, iCBuffer CBPerFrame = null, EntryPoints shadersEntryPoint = null)
            : base(device, shaderPath, VertexDeclaration, new UtopiaIncludeHandler())
        {
            //Create Constant Buffers interfaces ==================================================
            CBPerFrameLocal = ToDispose(new CBuffer <CBPerFrame_Struct>(device, "PerFrameLocal"));
            CBuffers.Add(CBPerFrameLocal);

            if (CBPerFrame != null)
            {
                CBuffers.Add(CBPerFrame.Clone());
            }

            //Create the resource interfaces ==================================================
            DiffuseTexture = new ShaderResource("DiffuseTexture");
            ShaderResources.Add(DiffuseTexture);

            BiomesColors = new ShaderResource("BiomesColors");
            ShaderResources.Add(BiomesColors);

            //Create the Sampler interface ==================================================
            SamplerDiffuse = new ShaderSampler("SamplerDiffuse");
            ShaderSamplers.Add(SamplerDiffuse);

            //Load the shaders
            base.LoadShaders(shadersEntryPoint == null ? _shadersEntryPoint : shadersEntryPoint);
        }
Пример #3
0
        public HLSLTerran(Device device, string shaderPath, VertexDeclaration VertexDeclaration, iCBuffer CBPerFrame = null, EntryPoints shadersEntryPoint = null)
            : base(device, shaderPath, VertexDeclaration, new UtopiaIncludeHandler())
        {
            //Create Contstant Buffers interfaces ==================================================
            CBPerDraw = ToDispose(new CBuffer <CBPerDraw_Struct>(device, "PerDraw"));
            CBuffers.Add(CBPerDraw);

            if (CBPerFrame != null)
            {
                CBuffers.Add(CBPerFrame.Clone());
            }

            //Create the resource interfaces ==================================================
            TerraTexture = new ShaderResource("TerraTexture");
            ShaderResources.Add(TerraTexture);

            SkyBackBuffer = new ShaderResource("SkyBackBuffer");
            ShaderResources.Add(SkyBackBuffer);

            BiomesColors = new ShaderResource("BiomesColors");
            ShaderResources.Add(BiomesColors);

            ShadowMap = new ShaderResource("ShadowMap");
            ShaderResources.Add(ShadowMap);

            //Create the Sampler interface ==================================================
            SamplerDiffuse = new ShaderSampler("SamplerDiffuse");
            ShaderSamplers.Add(SamplerDiffuse);

            SamplerBackBuffer = new ShaderSampler("SamplerBackBuffer");
            ShaderSamplers.Add(SamplerBackBuffer);

            //Load the shaders
            base.LoadShaders(shadersEntryPoint == null ? _shadersEntryPoint : shadersEntryPoint);
        }
Пример #4
0
        public HLSLCubeColorParticule(Device device, string shaderPath, VertexDeclaration VertexDeclaration, iCBuffer CBPerFrame, Include includeHandler, EntryPoints shadersEntryPoint = null)
            : base(device, shaderPath, VertexDeclaration, includeHandler)
        {
            //Create Constant Buffers interfaces ==================================================
            CBuffers.Add(CBPerFrame.Clone());

            //Load the shaders
            base.LoadShaders(shadersEntryPoint == null ? _shadersEntryPoint : shadersEntryPoint);
        }
        public HLSLVoxelModelInstancedShadow(Device device, string shaderPath, VertexDeclaration VertexDeclaration, EntryPoints shadersEntryPoint = null)
            : base(device, shaderPath, VertexDeclaration, null)
        {
            //Create Constant Buffers interfaces ==================================================
            CBPerDraw = ToDispose(new CBuffer <CBPerDraw_Struct>(device, "PerDrawShadow"));
            CBuffers.Add(CBPerDraw);

            //Load the shaders
            base.LoadShaders(shadersEntryPoint == null ? _shadersEntryPoint : shadersEntryPoint);
        }
Пример #6
0
        public HLSLColumnChart(Device device)
            : base(device, @"Effects\Debug\ColumnChart.hlsl", VertexColumnChart.VertexDeclaration, null)
        {
            //Create Constant Buffers interfaces ==================================================
            CBPerDraw = ToDispose(new CBuffer <CBPerBatch_Struct>(device, "CBPerDraw"));
            CBuffers.Add(CBPerDraw);

            //Load the shaders
            base.LoadShaders(_shadersEntryPoint);
        }
Пример #7
0
        public HLSLTerranShadow(Device device, string shaderPath, VertexDeclaration VertexDeclaration, iCBuffer CBPerFrame = null, EntryPoints shadersEntryPoint = null)
            : base(device, shaderPath, VertexDeclaration, new UtopiaIncludeHandler())
        {
            //Create Contstant Buffers interfaces ==================================================
            CBPerDraw = ToDispose(new CBuffer <CBPerDraw_Struct>(device, "PerDrawShadow"));
            CBuffers.Add(CBPerDraw);

            //Load the shaders
            base.LoadShaders(shadersEntryPoint == null ? _shadersEntryPoint : shadersEntryPoint);
        }
Пример #8
0
        public HLSLColorLine(Device engine, string shaderPath, VertexDeclaration VertexDeclaration, EntryPoints shadersEntryPoint = null)
            : base(engine, shaderPath, VertexDeclaration, null)
        {
            //Create Constant Buffers interfaces ==================================================
            CBPerDraw = new CBuffer <CBPerDrawStructure>(engine, "PerDraw");
            CBuffers.Add(CBPerDraw);

            //Load the shaders
            base.LoadShaders(shadersEntryPoint == null ? _shadersEntryPoint : shadersEntryPoint);
        }
Пример #9
0
        public HLSLScreenSpaceRect(Device device)
            : base(device, @"Effects\Basics\ScreenSpaceRect.hlsl", VertexPosition2.VertexDeclaration, null)
        {
            //Create Constant Buffers interfaces
            CBPerDraw = ToDispose(new CBuffer <CBPerDraw_Struct>(device, "PerDraw"));
            CBuffers.Add(CBPerDraw);

            //Load the shaders only after the CBuffer have been defined
            base.LoadShaders(_shadersEntryPoint);
        }
Пример #10
0
        public HLSLPointSpriteColor3DBillBoard(Device device, string shaderPath, VertexDeclaration VertexDeclaration, iCBuffer CBPerFrame, Include includeHandler, EntryPoints shadersEntryPoint = null)
            : base(device, shaderPath, VertexDeclaration, includeHandler)
        {
            //Create Constant Buffers interfaces ==================================================
            CBuffers.Add(CBPerFrame.Clone());

            PerFrame = ToDispose(new CBuffer <CBPerFrame_Struct>(device, "PerFrame"));
            CBuffers.Add(PerFrame);

            //Load the shaders
            base.LoadShaders(shadersEntryPoint == null ? _shadersEntryPoint : shadersEntryPoint);
        }
Пример #11
0
        public HLSLLTree(Device device, string shaderPath, VertexDeclaration VertexDeclaration)
            : base(device, shaderPath, VertexDeclaration, null)
        {
            //Create Constant Buffers interfaces
            CBPerDraw = ToDispose(new CBuffer <CBPerDraw_Struct>(device, "PerDraw"));
            CBuffers.Add(CBPerDraw);

            CBPerFrame = ToDispose(new CBuffer <CBPerFrame_Struct>(device, "PerFrame"));
            CBuffers.Add(CBPerFrame);

            //Load the shaders
            base.LoadShaders(_shadersEntryPoint);
        }
Пример #12
0
        public HLSLStars(Device device, string shaderPath, VertexDeclaration VertexDeclaration, EntryPoints shadersEntryPoint = null)
            : base(device, shaderPath, VertexDeclaration, null)
        {
            //Create Constant Buffers interfaces ==================================================
            CBPerDraw = ToDispose(new CBuffer <CBPerDraw_Struct>(device, "PerDraw"));
            CBuffers.Add(CBPerDraw);

            //Create the resource interfaces ==================================================

            //Create the Sampler interface ==================================================

            //Load the shaders
            base.LoadShaders(shadersEntryPoint == null ? _shadersEntryPoint : shadersEntryPoint);
        }
Пример #13
0
        public NoiseShader(Device device, iCBuffer PerFrameShared)
            : base(device, @"Visualisator3D\CustomShaders\NoiseShader.hlsl", VertexPosition4Color.VertexDeclaration, PerFrameShared)
        {
            //Create Constant Buffers interfaces ==================================================
            CBPerDraw = ToDispose(new CBuffer <CBPerDraw_Struct>(device, "PerDraw"));
            CBuffers.Add(CBPerDraw);

            //Create the resource interfaces (Textures, ...) ==================================================

            //Create the Sampler interface (Texture samplers, ...) ==================================================

            //Load the shaders only after the CBuffer have been defined
            base.LoadShaders(_shadersEntryPoint);
        }
Пример #14
0
        public HLSLVoxelModel(Device device, string shaderPath, VertexDeclaration VertexDeclaration, EntryPoints shadersEntryPoint = null)
            : base(device, shaderPath, VertexDeclaration, null)
        {
            //Create Constant Buffers interfaces ==================================================
            CBPerFrame = ToDispose(new CBuffer <CBPerFrameStructure>(device, "VoxelModelPerFrame"));
            CBuffers.Add(CBPerFrame);

            CBPerModel = ToDispose(new CBuffer <CBPerModelStructure>(device, "VoxelModel", true));
            CBuffers.Add(CBPerModel);

            CBPerPart = ToDispose(new CBuffer <CBPerPartStructure>(device, "VoxelModelPerPart"));
            CBuffers.Add(CBPerPart);

            //Load the shaders
            base.LoadShaders(shadersEntryPoint == null ? _shadersEntryPoint : shadersEntryPoint);
        }
Пример #15
0
        public HLSLUtopiaPointSprite3DText(Device device, string shaderPath, VertexDeclaration VertexDeclaration, iCBuffer CBPerFrame, Include includeHandler, EntryPoints shadersEntryPoint = null)
            : base(device, shaderPath, VertexDeclaration, includeHandler)
        {
            //Create Constant Buffers interfaces ==================================================
            CBuffers.Add(CBPerFrame.Clone());

            //Create the resource interfaces ==================================================
            DiffuseTexture = new ShaderResource("DiffuseTexture");
            ShaderResources.Add(DiffuseTexture);

            //Create the Sampler interface ==================================================
            SamplerDiffuse = new ShaderSampler("SamplerDiffuse");
            ShaderSamplers.Add(SamplerDiffuse);

            //Load the shaders
            base.LoadShaders(shadersEntryPoint == null ? _shadersEntryPoint : shadersEntryPoint);
        }
Пример #16
0
        public HLSLClouds(Device device, string effectPath, VertexDeclaration vertexDeclaration, params iCBuffer[] externalCBuffers)
            : base(device, effectPath, vertexDeclaration, new UtopiaIncludeHandler(), externalCBuffers)
        {
            //Create Constant Buffers interfaces
            CBPerDraw = ToDispose(new CBuffer <CBPerDrawStruct>(device, "PerDraw"));
            CBuffers.Add(CBPerDraw);

            //Create the resource interfaces ==================================================
            SamplerBackBuffer = new ShaderSampler("SamplerBackBuffer");
            ShaderSamplers.Add(SamplerBackBuffer);

            SolidBackBuffer = new ShaderResource("SkyBackBuffer");
            ShaderResources.Add(SolidBackBuffer);

            //Load the shaders only after the CBuffer have been defined
            base.LoadShaders(_shadersEntryPoint);
        }
Пример #17
0
        public HLSLGhost(Device device, string shaderPath, VertexDeclaration VertexDeclaration, EntryPoints shadersEntryPoint = null)
            : base(device, shaderPath, VertexDeclaration, new UtopiaIncludeHandler())
        {
            //Create Contstant Buffers interfaces ==================================================
            CBPerDraw = ToDispose(new CBuffer <CBPerDrawStructure>(device, "PerDraw"));
            CBuffers.Add(CBPerDraw);

            //Create the resource interfaces ==================================================
            PostEffectBackBuffer = new ShaderResource("PostEffectBackBuffer");
            ShaderResources.Add(PostEffectBackBuffer);

            //Create the Sampler interface ==================================================
            SamplerPostEffectBackBuffer = new ShaderSampler("SamplerPostEffectBackBuffer");
            ShaderSamplers.Add(SamplerPostEffectBackBuffer);

            //Load the shaders
            base.LoadShaders(shadersEntryPoint == null ? _shadersEntryPoint : shadersEntryPoint);
        }
Пример #18
0
        public HLSLSprites(Device device, string FileName)
            : base(device, @"Effects\Sprites\" + FileName, VertexSprite2.VertexDeclaration, null)
        {
            //Create Constant Buffers interfaces ==================================================
            CBPerDraw = ToDispose(new CBuffer <CBPerDraw_Struct>(device, "PerDraw"));
            CBuffers.Add(CBPerDraw);

            //Create the resource interfaces ==================================================
            SpriteTexture = new ShaderResource("SpriteTexture");
            ShaderResources.Add(SpriteTexture);

            //Create the Sampler interface ==================================================
            SpriteSampler = new ShaderSampler("SpriteSampler");
            ShaderSamplers.Add(SpriteSampler);

            //Load the shaders
            base.LoadShaders(_shadersEntryPoint);
        }
Пример #19
0
        public HLSLCubeTool(Device device, string shaderPath, VertexDeclaration VertexDeclaration, EntryPoints shadersEntryPoint = null)
            : base(device, shaderPath, VertexDeclaration, null)
        {
            //Create Constant Buffers interfaces ==================================================
            CBPerDraw = ToDispose(new CBuffer <CBPerDraw_Struct>(device, "PerDraw"));
            CBuffers.Add(CBPerDraw);

            //Create the resource interfaces ==================================================
            DiffuseTexture = new ShaderResource("DiffuseTexture");
            ShaderResources.Add(DiffuseTexture);

            //Create the Sampler interface ==================================================
            SamplerDiffuse = new ShaderSampler("SamplerDiffuse");
            ShaderSamplers.Add(SamplerDiffuse);

            //Load the shaders
            base.LoadShaders(shadersEntryPoint == null ? _shadersEntryPoint : shadersEntryPoint);
        }
Пример #20
0
        public HLSLColorOverlay(Device device, string shaderFilePath)
            : base(device, shaderFilePath, VertexPosition2Texture.VertexDeclaration, null)
        {
            //Create Constant Buffers interfaces
            CBPerDraw = ToDispose(new CBuffer <CBPerDraw_Struct>(device, "PerDraw"));
            CBuffers.Add(CBPerDraw);

            //Create the resource interfaces ==================================================
            SpriteTexture = new ShaderResource("SpriteTexture");
            ShaderResources.Add(SpriteTexture);

            //Create the Sampler interface ==================================================
            SpriteSampler = new ShaderSampler("SpriteSampler");
            ShaderSamplers.Add(SpriteSampler);

            //Load the shaders
            LoadShaders(_shadersEntryPoint);
        }
Пример #21
0
        public HLSLVoxelModelInstanced(Device device, string shaderPath, VertexDeclaration VertexDeclaration, EntryPoints shadersEntryPoint = null)
            : base(device, shaderPath, VertexDeclaration, null)
        {
            //Create Constant Buffers interfaces ==================================================
            CBPerFrame = ToDispose(new CBuffer <CBPerFrameStructure>(device, "VoxelModelPerFrame"));
            CBuffers.Add(CBPerFrame);

            CBPerModel = ToDispose(new CBuffer <CBPerModelStructure>(device, "VoxelModel", true));
            CBuffers.Add(CBPerModel);

            ShadowMap = new ShaderResource("ShadowMap");
            ShaderResources.Add(ShadowMap);

            SamplerBackBuffer = new ShaderSampler("SamplerBackBuffer");
            ShaderSamplers.Add(SamplerBackBuffer);

            //Load the shaders
            base.LoadShaders(shadersEntryPoint == null ? _shadersEntryPoint : shadersEntryPoint);
        }
        public HLSLVertexPositionColorTexture(Device device)
            : base(device, @"Effects\Basics\VertexPositionColorTexture.hlsl", VertexPositionColorTexture.VertexDeclaration, null)
        {
            //Create Constant Buffers interfaces ==================================================
            CBPerDraw = ToDispose(new CBuffer <CBPerDraw_Struct>(device, "PerDraw"));
            CBuffers.Add(CBPerDraw);

            CBPerFrame = ToDispose(new CBuffer <CBPerFrame_Struct>(device, "PerFrame"));
            CBuffers.Add(CBPerFrame);

            //Create the resource interfaces ==================================================
            DiffuseTexture = new ShaderResource("DiffuseTexture");
            ShaderResources.Add(DiffuseTexture);

            //Create the Sampler interface ==================================================
            SamplerDiffuse = new ShaderSampler("SamplerDiffuse");
            ShaderSamplers.Add(SamplerDiffuse);

            //Load the shaders
            base.LoadShaders(_shadersEntryPoint);
        }
Пример #23
0
        public HLSLBlur(Device device, BlurPass pass, string effectFilePath)
            : base(device, effectFilePath, VertexPosition2Texture.VertexDeclaration, null)
        {
            //Create Constant Buffers interfaces
            CBPerDraw = ToDispose(new CBuffer <CBPerDraw_Struct>(device, "PerDraw"));
            CBuffers.Add(CBPerDraw);

            //Create the resource interfaces ==================================================
            SpriteTexture = new ShaderResource("SpriteTexture");
            ShaderResources.Add(SpriteTexture);

            //Create the Sampler interface ==================================================
            SpriteSampler = new ShaderSampler("SpriteSampler");
            ShaderSamplers.Add(SpriteSampler);

            //Load the shaders
            switch (pass)
            {
            case BlurPass.Horizontal:
                _shadersEntryPoint = new EntryPoints()
                {
                    VertexShader_EntryPoint = "VS",
                    PixelShader_EntryPoint  = "PS_BlurHorizontal"
                };
                break;

            case BlurPass.Vertical:
                _shadersEntryPoint = new EntryPoints()
                {
                    VertexShader_EntryPoint = "VS",
                    PixelShader_EntryPoint  = "PS_BlurVertical"
                };
                break;
            }
            base.LoadShaders(_shadersEntryPoint);
        }