} // GBufferShader

        #endregion

        #region Get Parameters Handles

        /// <summary>
        /// Get the handles of the parameters from the shader.
        /// </summary>
        /// <remarks>
        /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
        /// </remarks>
        protected override void GetParametersHandles()
        {
            try
            {
                // Matrices //
                spWorldViewProj = new ShaderParameterMatrix("worldViewProj", this);
                spWorldView     = new ShaderParameterMatrix("worldView", this);
                spWorldViewIT   = new ShaderParameterMatrix("worldViewIT", this);
                // Floats //
                spFarPlane       = new ShaderParameterFloat("farPlane", this);
                spSpecularPower  = new ShaderParameterFloat("specularPower", this);
                spHeightMapScale = new ShaderParameterFloat("heightMapScale", this);
                // Bool //
                spSpecularTextured = new ShaderParameterBool("specularTextured", this);
                // Ints //
                spLODThreshold         = new ShaderParameterInt("LODThreshold", this);
                spMinimumNumberSamples = new ShaderParameterInt("minimumNumberSamples", this);
                spMaximumNumberSamples = new ShaderParameterInt("maximumNumberSamples", this);
                // Vector2 //
                spObjectNormalTextureSize = new ShaderParameterVector2("objectNormalTextureSize", this);
                // Textures //
                spObjectNormalTexture   = new ShaderParameterTexture("objectNormalTexture", this, SamplerState.AnisotropicWrap, 0);
                spObjectSpecularTexture = new ShaderParameterTexture("objectSpecularTexture", this, SamplerState.LinearWrap, 1);
                spNormalsFittingTexture = new ShaderParameterTexture("normalsFittingTexture", this, SamplerState.LinearClamp, 7);
                // Skinning //
                spBones = new ShaderParameterMatrixArray("Bones", this, ModelAnimationClip.MaxBones);
            }
            catch
            {
                throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
            }
        } // GetParameters
        } // AnamorphicLensFlareShader

        #endregion

        #region Get Parameters Handles

        /// <summary>
        /// Get the handles of the parameters from the shader.
        /// </summary>
        /// <remarks>
        /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
        /// </remarks>
        protected override void GetParametersHandles()
        {
            try
            {
                spHalfPixel             = new ShaderParameterVector2("halfPixel", this);
                spSunPosProj            = new ShaderParameterVector2("sunPosProj", this);
                spDistortion            = new ShaderParameterVector3("distortion", this);
                spDepthTexture          = new ShaderParameterTexture("depthTexture", this, SamplerState.PointClamp, 0);
                spSceneTexture          = new ShaderParameterTexture("sceneTexture", this, SamplerState.PointClamp, 9);
                spHighBlurredSunTexture = new ShaderParameterTexture("highBlurredSunTexture", this, SamplerState.PointClamp, 7);
                spDirtTexture           = new ShaderParameterTexture("dirtTexture", this, SamplerState.PointClamp, 8);
                spFarPlane                = new ShaderParameterFloat("farPlane", this);
                spDispersal               = new ShaderParameterFloat("dispersal", this);
                spHaloWidth               = new ShaderParameterFloat("haloWidth", this);
                spIntensity               = new ShaderParameterFloat("intensity", this);
                spWorldViewProj           = new ShaderParameterMatrix("worldViewProj", this);
                spWorldView               = new ShaderParameterMatrix("worldView", this);
                spSunColor                = new ShaderParameterColor("sunColor", this);
                Resource.CurrentTechnique = Resource.Techniques["LensFlare"];
            }
            catch
            {
                throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
            }
        } // GetParameters
Example #3
0
        } // CarPaintShader

        #endregion

        #region Get Parameters Handles

        /// <summary>
        /// Get the handles of the parameters from the shader.
        /// </summary>
        /// <remarks>
        /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
        /// </remarks>
        protected override sealed void GetParametersHandles()
        {
            try
            {
                spSpecularIntensity       = new ShaderParameterFloat("specularIntensity", this);
                spMicroflakePerturbation  = new ShaderParameterFloat("microflakePerturbation", this);
                spMicroflakePerturbationA = new ShaderParameterFloat("microflakePerturbationA", this);
                spNormalPerturbation      = new ShaderParameterFloat("normalPerturbation", this);
                spFlakeScale                  = new ShaderParameterFloat("flakesScale", this);
                spFlakesExponent              = new ShaderParameterFloat("flakesExponent", this);
                spMaxRange                    = new ShaderParameterFloat("maxRange", this);
                spHalfPixel                   = new ShaderParameterVector2("halfPixel", this);
                spCameraPosition              = new ShaderParameterVector3("cameraPosition", this);
                spWorldMatrix                 = new ShaderParameterMatrix("world", this);
                spWorldITMatrix               = new ShaderParameterMatrix("worldIT", this);
                spWorldViewProjMatrix         = new ShaderParameterMatrix("worldViewProj", this);
                spViewInverseMatrix           = new ShaderParameterMatrix("viewI", this);
                spBasePaintColor              = new ShaderParameterColor("basePaintColor1", this);
                spSecondBasePaintColor        = new ShaderParameterColor("basePaintColor2", this);
                spThridBasePaintColor         = new ShaderParameterColor("basePaintColor3", this);
                spFlakeLayerColor             = new ShaderParameterColor("flakeLayerColor", this);
                spNormalTexture               = new ShaderParameterTexture("normalTexture", this, SamplerState.PointClamp, 1);
                spDiffuseAccumulationTexture  = new ShaderParameterTexture("diffuseAccumulationTexture", this, SamplerState.PointClamp, 4);
                spSpecularAccumulationTexture = new ShaderParameterTexture("specularAccumulationTexture", this, SamplerState.PointClamp, 5);
                spReflectionTexture           = new ShaderParameterTextureCube("reflectionTexture", this, SamplerState.LinearClamp, 3);
                spSparkleNoiseTexture         = new ShaderParameterTexture("microflakeMap", this, SamplerState.LinearWrap, 0);
                spIsRGBM = new ShaderParameterBool("isRGBM", this);
            }
            catch
            {
                throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
            }
        }         // GetParametersHandles
Example #4
0
        } // SpotLightShader

        #endregion

        #region Get Parameters Handles

        /// <summary>
        /// Get the handles of the parameters from the shader.
        /// </summary>
        /// <remarks>
        /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
        /// </remarks>
        protected override void GetParametersHandles()
        {
            try
            {
                spHalfPixel                 = new ShaderParameterVector2("halfPixel", this);
                spLightIntensity            = new ShaderParameterFloat("lightIntensity", this);
                spInvLightRadius            = new ShaderParameterFloat("invLightRadius", this);
                spFarPlane                  = new ShaderParameterFloat("farPlane", this);
                spLightOuterConeAngle       = new ShaderParameterFloat("lightOuterAngle", this);
                spLightInnerConeAngle       = new ShaderParameterFloat("lightInnerAngle", this);
                spLightColor                = new ShaderParameterColor("lightColor", this);
                spDepthTexture              = new ShaderParameterTexture("depthTexture", this, SamplerState.PointClamp, 0);
                spNormalTexture             = new ShaderParameterTexture("normalTexture", this, SamplerState.PointClamp, 1);
                spShadowTexture             = new ShaderParameterTexture("shadowTexture", this, SamplerState.PointClamp, 3);
                spLightMaskTexture          = new ShaderParameterTexture("lightMaskTexture", this, SamplerState.LinearClamp, 4);
                spLightPosition             = new ShaderParameterVector3("lightPosition", this);
                spLightDirection            = new ShaderParameterVector3("lightDirection", this);
                spWorldViewMatrix           = new ShaderParameterMatrix("worldView", this);
                spWorldViewProjMatrix       = new ShaderParameterMatrix("worldViewProj", this);
                spViewToLightViewProjMatrix = new ShaderParameterMatrix("viewToLightViewProj", this);
            }
            catch
            {
                throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
            }
        } // GetParameters
 /// <summary>
 /// Get the handles of the parameters from the shader.
 /// </summary>
 /// <remarks>
 /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
 /// </remarks>
 protected override sealed void GetParametersHandles()
 {
     try
     {
         spLODThreshold         = new ShaderParameterInt("LODThreshold", this);
         spMinimumNumberSamples = new ShaderParameterInt("minimumNumberSamples", this);
         spMaximumNumberSamples = new ShaderParameterInt("maximumNumberSamples", this);
         spSpecularIntensity    = new ShaderParameterFloat("specularIntensity", this);
         spMaxRange             = new ShaderParameterFloat("maxRange", this);
         spHeightMapScale       = new ShaderParameterFloat("heightMapScale", this);
         spHalfPixel            = new ShaderParameterVector2("halfPixel", this);
         spNormalTextureSize    = new ShaderParameterVector2("objectNormalTextureSize", this);
         spCameraPosition       = new ShaderParameterVector3("cameraPosition", this);
         spWorldMatrix          = new ShaderParameterMatrix("world", this);
         spWorldITMatrix        = new ShaderParameterMatrix("worldIT", this);
         spWorldViewProjMatrix  = new ShaderParameterMatrix("worldViewProj", this);
         spViewInverseMatrix    = new ShaderParameterMatrix("viewI", this);
         spBones                       = new ShaderParameterMatrixArray("Bones", this, ModelAnimationClip.MaxBones);
         spDiffuseColor                = new ShaderParameterColor("diffuseColor", this);
         spDiffuseTexture              = new ShaderParameterTexture("diffuseTexture", this, SamplerState.AnisotropicWrap, 0);
         spNormalTexture               = new ShaderParameterTexture("normalTexture", this, SamplerState.PointClamp, 1); // SamplerState.AnisotropicWrap;
         spSpecularTexture             = new ShaderParameterTexture("specularTexture", this, SamplerState.AnisotropicWrap, 2);
         spDiffuseAccumulationTexture  = new ShaderParameterTexture("diffuseAccumulationTexture", this, SamplerState.PointClamp, 4);
         spSpecularAccumulationTexture = new ShaderParameterTexture("specularAccumulationTexture", this, SamplerState.PointClamp, 5);
         spReflectionTexture           = new ShaderParameterTextureCube("reflectionTexture", this, SamplerState.LinearClamp, 3);
         spReflectionTextured          = new ShaderParameterBool("reflectionTextured", this);
         spIsRGBM                      = new ShaderParameterBool("isRGBM", this);
     }
     catch
     {
         throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
     }
 }         // GetParametersHandles
Example #6
0
 /// <summary>
 /// Get the handles of the parameters from the shader.
 /// </summary>
 /// <remarks>
 /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
 /// </remarks>
 protected override sealed void GetParametersHandles()
 {
     try
     {
         spViewProjection      = new ShaderParameterMatrix("viewProjection", this);
         spProjection          = new ShaderParameterMatrix("Projection", this);
         spProjectionInvert    = new ShaderParameterMatrix("ProjI", this);
         spCurrentTime         = new ShaderParameterFloat("CurrentTime", this);
         spDuration            = new ShaderParameterFloat("Duration", this);
         spDurationRandomness  = new ShaderParameterFloat("DurationRandomness", this);
         spEndVelocity         = new ShaderParameterFloat("EndVelocity", this);
         spFarPlane            = new ShaderParameterFloat("farPlane", this);
         spFadeDistance        = new ShaderParameterFloat("fadeDistance", this);
         spAnimationRepetition = new ShaderParameterFloat("animationRepetition", this);
         spViewportScale       = new ShaderParameterVector2("ViewportScale", this);
         spRotateSpeed         = new ShaderParameterVector2("RotateSpeed", this);
         spStartSize           = new ShaderParameterVector2("StartSize", this);
         spEndSize             = new ShaderParameterVector2("EndSize", this);
         spHalfPixel           = new ShaderParameterVector2("halfPixel", this);
         spTiles        = new ShaderParameterVector2("tiles", this);
         spGravity      = new ShaderParameterVector3("Gravity", this);
         spMinColor     = new ShaderParameterColorWithAlpha("MinColor", this);
         spMaxColor     = new ShaderParameterColorWithAlpha("MaxColor", this);
         spTexture      = new ShaderParameterTexture("particleTexture", this, SamplerState.LinearClamp, 3);
         spDepthTexture = new ShaderParameterTexture("depthTexture", this, SamplerState.PointClamp, 0);
     }
     catch
     {
         throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
     }
 } // GetParametersHandles
Example #7
0
 /// <summary>
 /// Get the handles of the parameters from the shader.
 /// </summary>
 /// <remarks>
 /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
 /// </remarks>
 protected override sealed void GetParametersHandles()
 {
     try
     {
         spHalfPixel           = new ShaderParameterVector2("halfPixel", this);
         spSpecularIntensity   = new ShaderParameterFloat("specularIntensity", this);
         spSpecularPower       = new ShaderParameterFloat("specularPower", this);
         spAlphaBlending       = new ShaderParameterFloat("alphaBlending", this);
         spMaxRange            = new ShaderParameterFloat("maxRange", this);
         spCameraPosition      = new ShaderParameterVector3("cameraPosition", this);
         spWorldMatrix         = new ShaderParameterMatrix("world", this);
         spWorldITMatrix       = new ShaderParameterMatrix("worldIT", this);
         spWorldViewProjMatrix = new ShaderParameterMatrix("worldViewProj", this);
         spDiffuseColor        = new ShaderParameterColor("diffuseColor", this);
         spDiffuseTexture      = new ShaderParameterTexture("diffuseTexture", this, SamplerState.AnisotropicWrap, 0);
         spReflectionTexture   = new ShaderParameterTextureCube("reflectionTexture", this, SamplerState.LinearClamp, 4);
         spReflectionTextured  = new ShaderParameterBool("reflectionTextured", this);
         spIsRGBM = new ShaderParameterBool("isRGBM", this);
         // Ambient Light //
         spSphericalHarmonicBase        = new ShaderParameterVector3Array("sphericalHarmonicBase", this, 9);
         spAmbientIntensity             = new ShaderParameterFloat("ambientIntensity", this);
         spAmbientColor                 = new ShaderParameterColor("ambientColor", this);
         spHasAmbientSphericalHarmonics = new ShaderParameterBool("hasAmbientSphericalHarmonics", this);
         // Directional Light //
         spDirectionalLightDirection = new ShaderParameterVector3("directionalLightDirection", this);
         spDirectionalLightColor     = new ShaderParameterColor("directionalLightColor", this);
         spDirectionalLightIntensity = new ShaderParameterFloat("directionalLightIntensity", this);
         spShadowTexture             = new ShaderParameterTexture("shadowTexture", this, SamplerState.PointClamp, 3);
         spHasShadows = new ShaderParameterBool("hasShadows", this);
         // Spot //
         spSpotLightDirection        = new ShaderParameterVector3("spotLightDirection", this);
         spSpotLightPosition         = new ShaderParameterVector3("spotLightPos", this);
         spSpotLightColor            = new ShaderParameterColor("spotLightColor", this);
         spDirectionalLightIntensity = new ShaderParameterFloat("directionalLightIntensity", this);
         spSpotLightIntensity        = new ShaderParameterFloat("spotLightIntensity", this);
         spSpotLightInnerAngle       = new ShaderParameterFloat("spotLightInnerAngle", this);
         spSpotLightOuterAngle       = new ShaderParameterFloat("spotLightOuterAngle", this);
         spInvSpotLightRadius        = new ShaderParameterFloat("invSpotLightRadius", this);
         // Point
         spPointLightIntensity1 = new ShaderParameterFloat("pointLightIntensity", this);
         spInvPointLightRadius1 = new ShaderParameterFloat("invPointLightRadius", this);
         spPointLightIntensity2 = new ShaderParameterFloat("pointLightIntensity2", this);
         spInvPointLightRadius2 = new ShaderParameterFloat("invPointLightRadius2", this);
         spPointLightPos1       = new ShaderParameterVector3("pointLightPos", this);
         spPointLightPos2       = new ShaderParameterVector3("pointLightPos2", this);
         spPointLightColor1     = new ShaderParameterColor("pointLightColor", this);
         spPointLightColor2     = new ShaderParameterColor("pointLightColor2", this);
     }
     catch
     {
         throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
     }
 }         // GetParametersHandles
Example #8
0
 /// <summary>
 /// Get the handles of the parameters from the shader.
 /// </summary>
 /// <remarks>
 /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
 /// </remarks>
 protected override void GetParametersHandles()
 {
     try
     {
         spTextureResolution = new ShaderParameterVector2("textureResolution", this);
         spHalfPixel         = new ShaderParameterVector2("halfPixel", this);
         spBlurWidth         = new ShaderParameterFloat("blurWidth", this);
         spTexture           = new ShaderParameterTexture("sceneTexture", this, SamplerState.PointClamp, 5);
     }
     catch
     {
         throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
     }
 } // GetParametersHandles
 /// <summary>
 /// Get the handles of the parameters from the shader.
 /// </summary>
 /// <remarks>
 /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
 /// </remarks>
 protected override void GetParametersHandles()
 {
     try
     {
         spHalfPixel     = new ShaderParameterVector2("halfPixel", this);
         spQuarterTexel  = new ShaderParameterVector2("quarterTexel", this);
         spDepthTexture  = new ShaderParameterTexture("depthTexture", this, SamplerState.PointClamp, 0);
         spNormalTexture = new ShaderParameterTexture("normalTexture", this, SamplerState.LinearClamp, 2);
     }
     catch
     {
         throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
     }
 } // GetParameters
 /// <summary>
 /// Get the handles of the parameters from the shader.
 /// </summary>
 /// <remarks>
 /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
 /// </remarks>
 protected override sealed void GetParametersHandles()
 {
     try
     {
         spFarPlane          = new ShaderParameterFloat("farPlane", this);
         spWorldViewProj     = new ShaderParameterMatrix("worldViewProj", this);
         spProjectionInverse = new ShaderParameterMatrix("projectionInverse", this);
         spDepthTexture      = new ShaderParameterTexture("depthTexture", this, SamplerState.PointClamp, 1);
         spHalfPixel         = new ShaderParameterVector2("halfPixel", this);
     }
     catch
     {
         throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
     }
 }         // GetParametersHandles
Example #11
0
 /// <summary>
 /// Get the handles of the parameters from the shader.
 /// </summary>
 /// <remarks>
 /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
 /// </remarks>
 protected override sealed void GetParametersHandles()
 {
     try
     {
         spAlphaBlending       = new ShaderParameterFloat("alphaBlending", this);
         spWorldViewProjMatrix = new ShaderParameterMatrix("worldViewProj", this);
         spDiffuseColor        = new ShaderParameterColor("diffuseColor", this);
         spDiffuseTexture      = new ShaderParameterTexture("diffuseTexture", this, SamplerState.AnisotropicWrap, 0);
         spBones = new ShaderParameterMatrixArray("Bones", this, ModelAnimationClip.MaxBones);
     }
     catch
     {
         throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
     }
 }         // GetParametersHandles
        } // DirectionalLightShader

        #endregion

        #region Get Parameters Handles

        /// <summary>
        /// Get the handles of the parameters from the shader.
        /// </summary>
        /// <remarks>
        /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
        /// </remarks>
        protected override void GetParametersHandles()
        {
            try
            {
                spHalfPixel = new ShaderParameterVector2("halfPixel", this);
                spLightIntensity = new ShaderParameterFloat("lightIntensity", this);
                spLightColor = new ShaderParameterColor("lightColor", this);
                spDepthTexture = new ShaderParameterTexture("depthTexture", this, SamplerState.PointClamp, 0);
                spNormalTexture = new ShaderParameterTexture("normalTexture", this, SamplerState.PointClamp, 1);
                spShadowTexture = new ShaderParameterTexture("shadowTexture", this, SamplerState.PointClamp, 3);
                spLightDirection = new ShaderParameterVector3("lightDirection", this);
                spFrustumCorners = new ShaderParameterVector3Array("frustumCorners", this, 4);
            }
            catch
            {
                throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
            }
        } // GetParameters
Example #13
0
        /// <summary>
        /// Get the handles of the parameters from the shader.
        /// </summary>
        /// <remarks>
        /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
        /// </remarks>
        protected override void GetParametersHandles()
        {
            try
            {
                spBloomThreshold       = new ShaderParameterFloat("bloomThreshold", this);
                spLensExposure         = new ShaderParameterFloat("lensExposure", this);
                spHalfPixel            = new ShaderParameterVector2("halfPixel", this);
                spAutoExposure         = new ShaderParameterBool("autoExposure", this);
                spSceneTexture         = new ShaderParameterTexture("sceneTexture", this, SamplerState.PointClamp, 8);
                spLastLuminanceTexture = new ShaderParameterTexture("lastLuminanceTexture", this, SamplerState.PointClamp, 12);

                Resource.CurrentTechnique = Resource.Techniques["Bloom"];
            }
            catch
            {
                throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
            }
        } // GetParameters
Example #14
0
 /// <summary>
 /// Get the handles of the parameters from the shader.
 /// </summary>
 /// <remarks>
 /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
 /// </remarks>
 protected override void GetParametersHandles()
 {
     try
     {
         spDepthBias                 = new ShaderParameterFloat("depthBias", this);
         spHalfPixel                 = new ShaderParameterVector2("halfPixel", this);
         spShadowMapSize             = new ShaderParameterVector2("shadowMapSize", this);
         spInvShadowMapSize          = new ShaderParameterVector2("invShadowMapSize", this);
         spFrustumCorners            = new ShaderParameterVector3Array("frustumCorners", this, 4);
         spDepthTexture              = new ShaderParameterTexture("depthTexture", this, SamplerState.PointClamp, 0);
         spShadowMapTexture          = new ShaderParameterTexture("shadowMap", this, SamplerState.PointClamp, 3);
         spViewToLightViewProjMatrix = new ShaderParameterMatrix("viewToLightViewProj", this);
     }
     catch
     {
         throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
     }
 } // GetParameters
        } // SkyboxShader

        #endregion

        #region Get Parameters Handles

        /// <summary>
        /// Get the handles of the parameters from the shader.
        /// </summary>
        /// <remarks>
        /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
        /// </remarks>
        protected override sealed void GetParametersHandles()
        {
            try
            {
                spViewProjectionMatrix = new ShaderParameterMatrix("ViewITProj", this);
                spWorldMatrix          = new ShaderParameterMatrix("World", this);
                spViewInverseMatrix    = new ShaderParameterMatrix("ViewInv", this);
                spLightDirection       = new ShaderParameterVector3("LightDirection", this);
                spTexture          = new ShaderParameterTexture("diffuseTexture", this, SamplerState.AnisotropicClamp, 0);
                spSkyNightTexture  = new ShaderParameterTexture("SkyTextureNight", this, SamplerState.AnisotropicClamp, 5);
                spSkySunsetTexture = new ShaderParameterTexture("SkyTextureSunset", this, SamplerState.AnisotropicClamp, 6);
                spSkyDayTexture    = new ShaderParameterTexture("SkyTextureDay", this, SamplerState.AnisotropicClamp, 7);
            }
            catch
            {
                throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
            }
        }         // GetParametersHandles
Example #16
0
        } // AmbientLightShader

        #endregion

        #region Get Parameters Handles

        /// <summary>
        /// Get the handles of the parameters from the shader.
        /// </summary>
        /// <remarks>
        /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
        /// </remarks>
        protected override void GetParametersHandles()
        {
            try
            {
                spIntensity = new ShaderParameterFloat("intensity", this);
                spAmbientOcclusionStrength = new ShaderParameterFloat("ambientOcclusionStrength", this);
                spHalfPixel = new ShaderParameterVector2("halfPixel", this);
                spColor = new ShaderParameterColor("color", this);
                spAmbientOcclusionTexture = new ShaderParameterTexture("ambientOcclusionTexture", this, SamplerState.PointClamp, 3);
                spNormalTexture = new ShaderParameterTexture("normalTexture", this, SamplerState.PointClamp, 1);
                spViewInverseMatrix = new ShaderParameterMatrix("viewI", this);
                spSphericalHarmonicBase = new ShaderParameterVector3Array("sphericalHarmonicBase", this, 9);
            }
            catch
            {
                throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
            }
        } // GetParameters
Example #17
0
        } // MLAAShader

        #endregion

        #region Get Parameters Handles

        /// <summary>
        /// Get the handles of the parameters from the shader.
        /// </summary>
        /// <remarks>
        /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
        /// </remarks>
        protected override void GetParametersHandles()
        {
            try
            {
                spHalfPixel             = new ShaderParameterVector2("halfPixel", this);
                spPixelSize             = new ShaderParameterVector2("pixelSize", this);
                spThresholdColor        = new ShaderParameterFloat("thresholdColor", this);
                spThresholdDepth        = new ShaderParameterFloat("thresholdDepth", this);
                spSceneTexture          = new ShaderParameterTexture("sceneTexture", this, SamplerState.PointClamp, 10);
                spDepthTexture          = new ShaderParameterTexture("depthTexture", this, SamplerState.PointClamp, 14);
                spEdgeTexture           = new ShaderParameterTexture("edgeTexture", this, SamplerState.LinearClamp, 12);
                spBlendedWeightsTexture = new ShaderParameterTexture("blendedWeightsTexture", this, SamplerState.PointClamp, 13);
                spAreaTexture           = new ShaderParameterTexture("areaTexture", this, SamplerState.PointClamp, 15);
            }
            catch
            {
                throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
            }
        } // GetParameters
Example #18
0
        } // PostProcessingShader

        #endregion

        #region Get Parameters Handles

        /// <summary>
        /// Get the handles of the parameters from the shader.
        /// </summary>
        /// <remarks>
        /// Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
        /// </remarks>
        protected override void GetParametersHandles()
        {
            //try
            {
                // Bool
                spAutoExposureEnabled = new ShaderParameterBool("autoExposure", this);
                spBloomEnabled = new ShaderParameterBool("bloomEnabled", this);
                spAdjustLevelsEnabled = new ShaderParameterBool("adjustLevelsEnabled", this);
                spAdjustLevelsIndividualChannelsEnabled = new ShaderParameterBool("adjustLevelsIndividualChannelsEnabled", this);
                spColorCorrectOneLutEnabled = new ShaderParameterBool("colorCorrectOneLutEnabled", this);
                spColorCorrectTwoLutEnabled = new ShaderParameterBool("colorCorrectTwoLutEnabled", this);
                spFilmGrainEnabled = new ShaderParameterBool("filmGrainEnabled", this);
                // Exposure
                spLensExposure = new ShaderParameterFloat("lensExposure", this);
                spTimeDelta = new ShaderParameterFloat("timeDelta", this);
                spExposureAdjustTimeMultiplier = new ShaderParameterFloat("tau", this);
                spLuminanceLowThreshold = new ShaderParameterFloat("luminanceLowThreshold", this);
                spLuminanceHighThreshold = new ShaderParameterFloat("luminanceHighThreshold", this);
                // Tone Mapping
                spWhiteLevel = new ShaderParameterFloat("whiteLevel", this);
                spLuminanceSaturation = new ShaderParameterFloat("luminanceSaturation", this);
                spBias = new ShaderParameterFloat("bias", this);
                spShoulderStrength = new ShaderParameterFloat("shoulderStrength", this);
                spLinearStrength = new ShaderParameterFloat("linearStrength", this);
                spLinearAngle = new ShaderParameterFloat("linearAngle", this);
                spToeStrength = new ShaderParameterFloat("toeStrength", this);
                spToeNumerator = new ShaderParameterFloat("toeNumerator", this);
                spToeDenominator = new ShaderParameterFloat("toeDenominator", this);
                spLinearWhite = new ShaderParameterFloat("linearWhite", this);
                // Bloom
                spBloomScale = new ShaderParameterFloat("bloomScale", this);
                // Levels
                spInputBlack = new ShaderParameterFloat("inputBlack", this);
                spInputWhite = new ShaderParameterFloat("inputWhite", this);
                spInputGamma = new ShaderParameterFloat("inputGamma", this);
                spOutputBlack = new ShaderParameterFloat("outputBlack", this);
                spOutputWhite = new ShaderParameterFloat("outputWhite", this);
                // Color Correction
                spLookupTableScale = new ShaderParameterFloat("scale", this);
                spLookupTableOffset = new ShaderParameterFloat("offset", this);
                spLerpOriginalColorAmount = new ShaderParameterFloat("lerpOriginalColorAmount", this);
                spLerpLookupTablesAmount = new ShaderParameterFloat("lerpLookupTablesAmount", this);
                // Film Grain
                spFilmGrainStrength = new ShaderParameterFloat("filmGrainStrength", this);
                spAccentuateDarkNoisePower = new ShaderParameterFloat("accentuateDarkNoisePower", this);
                spRandomNoiseStrength = new ShaderParameterFloat("randomNoiseStrength", this);
                spRandomValue = new ShaderParameterFloat("randomValue", this);

                spHalfPixel = new ShaderParameterVector2("halfPixel", this);
                spFrustumCorners = new ShaderParameterVector3Array("frustumCorners", this, 4);

                // Leves Individual Channels
                spInputBlackRgb = new ShaderParameterVector3("inputBlackRGB", this);
                spInputWhiteRgb = new ShaderParameterVector3("inputWhiteRGB", this);
                spInputGammaRgb = new ShaderParameterVector3("inputGammaRGB", this);
                spOutputBlackRgb = new ShaderParameterVector3("outputBlackRGB", this);
                spOutputWhiteRgb = new ShaderParameterVector3("outputWhiteRGB", this);

                // Fog
                spCameraPosition = new ShaderParameterVector3("cameraPosition", this);

                spSceneTexture = new ShaderParameterTexture("sceneTexture", this, SamplerState.PointClamp, 9);
                spLastLuminanceTexture = new ShaderParameterTexture("lastLuminanceTexture", this, SamplerState.PointClamp, 12);
                spBloomTexture = new ShaderParameterTexture("bloomTexture", this, SamplerState.AnisotropicClamp, 10);
                spLensFlareTexture = new ShaderParameterTexture("lensFlareTexture", this, SamplerState.AnisotropicClamp, 8);
                spFilmLutTexture = new ShaderParameterTexture("filmLutTexture", this, SamplerState.AnisotropicClamp, 8);
                spDepthTexture = new ShaderParameterTexture("depthTexture", this, SamplerState.PointClamp, 0);

                spFirstlookupTable = new ShaderParameterLookupTable("firstlookupTableTexture", this, SamplerState.LinearClamp, 6);
                spSecondlookupTable = new ShaderParameterLookupTable("secondlookupTableTexture", this, SamplerState.LinearClamp, 7);
            }
            /*catch
            {
                throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved.");
            }*/
        } // GetParametersHandles