Exemple #1
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
        } // 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
Exemple #3
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
Exemple #4
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
Exemple #5
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