/// <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
} // 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
/// <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
} // 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); spCubeTexture = new ShaderParameterTextureCube("CubeMapTexture", this, SamplerState.LinearClamp, 0); spIntensity = new ShaderParameterFloat("intensity", this); spMaxRange = new ShaderParameterFloat("maxRange", this); spAlphaBlending = new ShaderParameterFloat("alphaBlending", this); } catch { throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved."); } } // GetParametersHandles
} // PointLightShader #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); spLightColor = new ShaderParameterColor("lightColor", this); spDepthTexture = new ShaderParameterTexture("depthTexture", this, SamplerState.PointClamp, 0); spNormalTexture = new ShaderParameterTexture("normalTexture", this, SamplerState.PointClamp, 1); spShadowTexture = new ShaderParameterTextureCube("cubeShadowTexture", this, SamplerState.PointClamp, 3); spLightPosition = new ShaderParameterVector3("lightPosition", this); spTextureSize = new ShaderParameterVector3("textureSize", this); spTextureSizeInv = new ShaderParameterVector3("textureSizeInv", this); spWorldView = new ShaderParameterMatrix("worldView", this); spWorldViewProj = new ShaderParameterMatrix("worldViewProj", this); spViewInverse = new ShaderParameterMatrix("viewI", this); } catch { throw new InvalidOperationException("The parameter's handles from the " + Name + " shader could not be retrieved."); } } // GetParameters