private void BuildShadersAndInputLayout()
        {
            ShaderMacro[] alphaTestDefines =
            {
                new ShaderMacro("ALPHA_TEST", "1")
            };

            _shaders["standardVS"] = D3DUtil.CompileShader("Shaders\\Default.hlsl", "VS", "vs_5_1");
            _shaders["opaquePS"]   = D3DUtil.CompileShader("Shaders\\Default.hlsl", "PS", "ps_5_1");

            _shaders["shadowVS"]            = D3DUtil.CompileShader("Shaders\\Shadows.hlsl", "VS", "vs_5_1");
            _shaders["shadowOpaquePS"]      = D3DUtil.CompileShader("Shaders\\Shadows.hlsl", "PS", "ps_5_1");
            _shaders["shadowAlphaTestedPS"] = D3DUtil.CompileShader("Shaders\\Shadows.hlsl", "PS", "ps_5_1", alphaTestDefines);

            _shaders["debugVS"] = D3DUtil.CompileShader("Shaders\\ShadowDebug.hlsl", "VS", "vs_5_1");
            _shaders["debugPS"] = D3DUtil.CompileShader("Shaders\\ShadowDebug.hlsl", "PS", "ps_5_1");

            _shaders["skyVS"] = D3DUtil.CompileShader("Shaders\\Sky.hlsl", "VS", "vs_5_1");
            _shaders["skyPS"] = D3DUtil.CompileShader("Shaders\\Sky.hlsl", "PS", "ps_5_1");

            _inputLayout = new InputLayoutDescription(new[]
            {
                new InputElement("POSITION", 0, Format.R32G32B32_Float, 0, 0),
                new InputElement("NORMAL", 0, Format.R32G32B32_Float, 12, 0),
                new InputElement("TEXCOORD", 0, Format.R32G32_Float, 24, 0),
                new InputElement("TANGENT", 0, Format.R32G32B32_Float, 32, 0)
            });
        }
        private void BuildShadersAndInputLayout()
        {
            ShaderMacro[] defines =
            {
                new ShaderMacro("FOG", "1")
            };

            ShaderMacro[] alphaTestDefines =
            {
                new ShaderMacro("FOG",        "1"),
                new ShaderMacro("ALPHA_TEST", "1")
            };

            ShaderMacro[] waveDefines =
            {
                new ShaderMacro("DISPLACEMENT_MAP", "1")
            };

            _shaders["standardVS"]     = D3DUtil.CompileShader("Shaders\\Default.hlsl", "VS", "vs_5_0");
            _shaders["wavesVS"]        = D3DUtil.CompileShader("Shaders\\Default.hlsl", "VS", "vs_5_0", waveDefines);
            _shaders["opaquePS"]       = D3DUtil.CompileShader("Shaders\\Default.hlsl", "PS", "ps_5_0", defines);
            _shaders["alphaTestedPS"]  = D3DUtil.CompileShader("Shaders\\Default.hlsl", "PS", "ps_5_0", alphaTestDefines);
            _shaders["wavesUpdateCS"]  = D3DUtil.CompileShader("Shaders\\WaveSim.hlsl", "UpdateWavesCS", "cs_5_0");
            _shaders["wavesDisturbCS"] = D3DUtil.CompileShader("Shaders\\WaveSim.hlsl", "DisturbWavesCS", "cs_5_0");
            _shaders["compositeVS"]    = D3DUtil.CompileShader("Shaders\\composite.hlsl", "VS", "vs_5_0");
            _shaders["compositePS"]    = D3DUtil.CompileShader("Shaders\\composite.hlsl", "PS", "ps_5_0");
            _shaders["sobelCS"]        = D3DUtil.CompileShader("Shaders\\Sobel.hlsl", "SobelCS", "cs_5_0");

            _inputLayout = new InputLayoutDescription(new[]
            {
                new InputElement("POSITION", 0, Format.R32G32B32_Float, 0, 0),
                new InputElement("NORMAL", 0, Format.R32G32B32_Float, 12, 0),
                new InputElement("TEXCOORD", 0, Format.R32G32_Float, 24, 0)
            });
        }
Exemple #3
0
        private void BuildShadersAndInputLayout()
        {
            ShaderMacro[] defines =
            {
                new ShaderMacro("FOG", "1")
            };

            ShaderMacro[] alphaTestDefines =
            {
                new ShaderMacro("FOG",        "1"),
                new ShaderMacro("ALPHA_TEST", "1")
            };

            _shaders["standardVS"]    = D3DUtil.CompileShader("Shaders\\Default.hlsl", "VS", "vs_5_0");
            _shaders["opaquePS"]      = D3DUtil.CompileShader("Shaders\\Default.hlsl", "PS", "ps_5_0", defines);
            _shaders["alphaTestedPS"] = D3DUtil.CompileShader("Shaders\\Default.hlsl", "PS", "ps_5_0", alphaTestDefines);
            _shaders["horzBlurCS"]    = D3DUtil.CompileShader("Shaders\\Blur.hlsl", "HorzBlurCS", "cs_5_0");
            _shaders["vertBlurCS"]    = D3DUtil.CompileShader("Shaders\\Blur.hlsl", "VertBlurCS", "cs_5_0");

            _inputLayout = new InputLayoutDescription(new[]
            {
                new InputElement("POSITION", 0, Format.R32G32B32_Float, 0, 0),
                new InputElement("NORMAL", 0, Format.R32G32B32_Float, 12, 0),
                new InputElement("TEXCOORD", 0, Format.R32G32_Float, 24, 0)
            });
        }
        private void BuildShadersAndInputLayout()
        {
            _shaders["standardVS"] = D3DUtil.CompileShader("Shaders\\Default.hlsl", "VS", "vs_5_0");
            _shaders["opaquePS"]   = D3DUtil.CompileShader("Shaders\\Default.hlsl", "PS", "ps_5_0");

            _inputLayout = new InputLayoutDescription(new[]
            {
                new InputElement("POSITION", 0, Format.R32G32B32_Float, 0, 0),
                new InputElement("NORMAL", 0, Format.R32G32B32_Float, 12, 0)
            });
        }
Exemple #5
0
        private void BuildShadersAndInputLayout()
        {
            _mvsByteCode = D3DUtil.CompileShader("Shaders\\Color.hlsl", "VS", "vs_5_0");
            _mpsByteCode = D3DUtil.CompileShader("Shaders\\Color.hlsl", "PS", "ps_5_0");

            _inputLayout = new InputLayoutDescription(new [] // TODO: API suggestion: Add params overload
            {
                new InputElement("POSITION", 0, Format.R32G32B32_Float, 0, 0),
                new InputElement("COLOR", 0, Format.R32G32B32A32_Float, 12, 0)
            });
        }
        private void BuildShadersAndInputLayout()
        {
            _shaders["tessVS"] = D3DUtil.CompileShader("Shaders\\BezierTessellation.hlsl", "VS", "vs_5_0");
            _shaders["tessHS"] = D3DUtil.CompileShader("Shaders\\BezierTessellation.hlsl", "HS", "hs_5_0");
            _shaders["tessDS"] = D3DUtil.CompileShader("Shaders\\BezierTessellation.hlsl", "DS", "ds_5_0");
            _shaders["tessPS"] = D3DUtil.CompileShader("Shaders\\BezierTessellation.hlsl", "PS", "ps_5_0");

            _inputLayout = new InputLayoutDescription(new[]
            {
                new InputElement("POSITION", 0, Format.R32G32B32_Float, 0, 0)
            });
        }
 private void BuildShadersAndInputLayout()
 {
     _shaders["vecAddCS"] = D3DUtil.CompileShader("Shaders\\VecAdd.hlsl", "CS", "cs_5_0");
 }