本文整理汇总了C#中SharpDX.Direct3D9.EffectHandle类的典型用法代码示例。如果您正苦于以下问题:C# EffectHandle类的具体用法?C# EffectHandle怎么用?C# EffectHandle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EffectHandle类属于SharpDX.Direct3D9命名空间,在下文中一共展示了EffectHandle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
private void Init()
{
m_dynamicLightsCount = m_D3DEffect.GetParameter(null, "DynamicLightsCount");
m_sunColor = m_D3DEffect.GetParameter(null, "SunColor");
m_sunIntensity = m_D3DEffect.GetParameter(null, "SunIntensity");
m_directionToSun = m_D3DEffect.GetParameter(null, "DirectionToSun");
m_ambientColor = m_D3DEffect.GetParameter(null, "AmbientColor");
// Dynamic lights array
EffectHandle dynamicLights = m_D3DEffect.GetParameter(null, "DynamicLights");
if (dynamicLights != null)
{
DynamicLightsPosition = new EffectHandle[MyLightsConstants.MAX_LIGHTS_FOR_EFFECT];
DynamicLightsColor = new EffectHandle[MyLightsConstants.MAX_LIGHTS_FOR_EFFECT];
DynamicLightsFalloff = new EffectHandle[MyLightsConstants.MAX_LIGHTS_FOR_EFFECT];
DynamicLightsRange = new EffectHandle[MyLightsConstants.MAX_LIGHTS_FOR_EFFECT];
for (int i = 0; i < MyLightsConstants.MAX_LIGHTS_FOR_EFFECT; i++)
{
DynamicLightsPosition[i] = m_D3DEffect.GetParameter(m_D3DEffect.GetParameterElement(dynamicLights, i), "Position");
DynamicLightsColor[i] = m_D3DEffect.GetParameter(m_D3DEffect.GetParameterElement(dynamicLights, i), "Color");
DynamicLightsFalloff[i] = m_D3DEffect.GetParameter(m_D3DEffect.GetParameterElement(dynamicLights, i), "Falloff");
DynamicLightsRange[i] = m_D3DEffect.GetParameter(m_D3DEffect.GetParameterElement(dynamicLights, i), "Range");
}
}
}
示例2: CompileShader
/// <summary>
/// Compiles a shader from an effect that contains one or more functions.
/// </summary>
/// <param name="functionHandle">The function handle.</param>
/// <param name="target">The target.</param>
/// <param name="flags">The flags.</param>
/// <exception cref="CompilationException">If a compilation errors occurs</exception>
/// <returns>The bytecode of the effect.</returns>
/// <unmanaged>HRESULT ID3DXEffectCompiler::CompileShader([In] D3DXHANDLE hFunction,[In] const char* pTarget,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable)</unmanaged>
public ShaderBytecode CompileShader(EffectHandle functionHandle, string target, ShaderFlags flags)
{
ConstantTable constantTable;
var result = CompileShader(functionHandle, target, flags, out constantTable);
constantTable.Dispose();
return result;
}
示例3: MyEffectShadowMap
public MyEffectShadowMap()
: base("Effects2\\Shadows\\MyEffectShadowMap")
{
m_bias = m_D3DEffect.GetParameter(null, "ShadowBias");
m_invViewMatrix = m_D3DEffect.GetParameter(null, "InvViewMatrix");
m_lightViewProjMatrices = m_D3DEffect.GetParameter(null, "LightViewProjMatrices");
m_frustumCornersVS = m_D3DEffect.GetParameter(null, "FrustumCornersVS");
m_clipPlanes = m_D3DEffect.GetParameter(null, "ClipPlanes");
m_shadowMap = m_D3DEffect.GetParameter(null, "ShadowMap");
m_depthTexture = m_D3DEffect.GetParameter(null, "DepthTexture");
m_shadowTermHalfPixel = m_D3DEffect.GetParameter(null, "ShadowTermHalfPixel");
m_shadowMapSize = m_D3DEffect.GetParameter(null, "ShadowMapSize");
m_showSplitColors = m_D3DEffect.GetParameter(null, "ShowSplitColors");
m_halfPixel = m_D3DEffect.GetParameter(null, "HalfPixel");
m_worldMatrix = m_D3DEffect.GetParameter(null, "WorldMatrix");
m_viewProjMatrix = m_D3DEffect.GetParameter(null, "ViewProjMatrix");
m_bones = m_D3DEffect.GetParameter(null, "Bones");
m_dithering = m_D3DEffect.GetParameter(null, "Dithering");
m_ditheringTexture = m_D3DEffect.GetParameter(null, "TextureDithering");
m_ditheringTextureSize = m_D3DEffect.GetParameter(null, "TextureDitheringSize");
m_createShadowTerm2x2 = m_D3DEffect.GetTechnique("CreateShadowTerm2x2PCF");
m_createShadowTerm3x3 = m_D3DEffect.GetTechnique("CreateShadowTerm3x3PCF");
m_createShadowTerm5x5 = m_D3DEffect.GetTechnique("CreateShadowTerm5x5PCF");
m_createShadowTerm7x7 = m_D3DEffect.GetTechnique("CreateShadowTerm7x7PCF");
m_generateShadowMap = m_D3DEffect.GetTechnique("GenerateShadowMap");
m_generateVoxelShadowMap = m_D3DEffect.GetTechnique("GenerateVoxelShadowMap");
m_generateShadowSkinned = m_D3DEffect.GetTechnique("GenerateShadowMapSkinned");
m_clearTechnique = m_D3DEffect.GetTechnique("Clear");
m_generateShadowMapInstanced = m_D3DEffect.GetTechnique("GenerateShadowMapInstanced");
m_generateShadowMapInstancedGeneric = m_D3DEffect.GetTechnique("GenerateShadowMapInstancedGeneric");
}
示例4: MyEffectThreshold
public MyEffectThreshold()
: base("Effects2\\HDR\\MyEffectThreshold")
{
m_threshold = m_D3DEffect.GetParameter(null, "Threshold");
m_bloomIntensity = m_D3DEffect.GetParameter(null, "BloomIntensity");
m_bloomIntensityBackground = m_D3DEffect.GetParameter(null, "BloomIntensityBackground");
}
示例5: MyEffectAtmosphere
public MyEffectAtmosphere()
: base("Effects2\\Models\\MyEffectAtmosphere")
{
m_viewMatrix = m_D3DEffect.GetParameter(null, "ViewMatrix");
m_worldMatrix = m_D3DEffect.GetParameter(null, "WorldMatrix");
m_projectionMatrix = m_D3DEffect.GetParameter(null, "ProjectionMatrix");
m_normalTechnique = m_D3DEffect.GetTechnique("Technique_RenderQualityNormal");
m_cameraHeight2 = m_D3DEffect.GetParameter(null, "CameraHeight2");
m_cameraHeight = m_D3DEffect.GetParameter(null, "CameraHeight");
m_cameraPos = m_D3DEffect.GetParameter(null, "CameraPos");
m_outerRadius = m_D3DEffect.GetParameter(null, "OuterRadius");
m_outerRadius2 = m_D3DEffect.GetParameter(null, "OuterRadius2");
m_innerRadius = m_D3DEffect.GetParameter(null, "InnerRadius");
m_innerRadius2 = m_D3DEffect.GetParameter(null, "InnerRadius2");
m_scaleAtmosphere = m_D3DEffect.GetParameter(null, "ScaleAtmosphere");
m_scaleDepth = m_D3DEffect.GetParameter(null, "ScaleDepth");
m_scaleOverScaleDepth = m_D3DEffect.GetParameter(null, "ScaleOverScaleDepth");
m_lightPosition = m_D3DEffect.GetParameter(null, "LightPosition");
m_isInside = m_D3DEffect.GetParameter(null, "IsInAtmosphere");
}
示例6: MyEffectBackgroundCube
public MyEffectBackgroundCube()
: base("Effects2\\BackgroundCube\\MyBackgroundCube")
{
m_backgroundTexture = m_D3DEffect.GetParameter(null, "BackgroundTexture");
m_backgroundColor = m_D3DEffect.GetParameter(null, "BackgroundColor");
m_viewProjectionMatrix = m_D3DEffect.GetParameter(null, "ViewProjectionMatrix");
}
示例7: MyEffectAtmosphereBase
public MyEffectAtmosphereBase(string effectPath)
: base(effectPath)
{
m_cameraHeight2 = m_D3DEffect.GetParameter(null, "CameraHeight2");
m_cameraHeight = m_D3DEffect.GetParameter(null, "CameraHeight");
m_cameraPos = m_D3DEffect.GetParameter(null, "CameraPos");
m_outerRadius = m_D3DEffect.GetParameter(null, "OuterRadius");
m_outerRadius2 = m_D3DEffect.GetParameter(null, "OuterRadius2");
m_innerRadius = m_D3DEffect.GetParameter(null, "InnerRadius");
m_innerRadius2 = m_D3DEffect.GetParameter(null, "InnerRadius2");
m_scaleAtmosphere = m_D3DEffect.GetParameter(null, "ScaleAtmosphere");
m_scaleDepth = m_D3DEffect.GetParameter(null, "ScaleDepth");
m_scaleOverScaleDepth = m_D3DEffect.GetParameter(null, "ScaleOverScaleDepth");
m_lightPosition = m_D3DEffect.GetParameter(null, "LightPosition");
m_isInside = m_D3DEffect.GetParameter(null, "IsInAtmosphere");
m_invWavelength = m_D3DEffect.GetParameter(null, "InvWavelength");
}
示例8: MyEffectSpriteBatchShader
public MyEffectSpriteBatchShader()
: base("Effects2\\Sprites\\MyEffectSpriteBatchShader")
{
m_Texture1 = m_D3DEffect.GetParameter(null, "Texture1");
m_Texture2 = m_D3DEffect.GetParameter(null, "Texture2");
m_TextureTiling = m_D3DEffect.GetParameter(null, "Texture2Tiling");
}
示例9: MyEffectTransparentGeometry
public MyEffectTransparentGeometry()
: base("Effects2\\TransparentGeometry\\MyEffectTransparentGeometry")
{
m_worldMatrix = m_D3DEffect.GetParameter(null, "WorldMatrix");
m_projectionMatrix = m_D3DEffect.GetParameter(null, "ProjectionMatrix");
m_viewMatrix = m_D3DEffect.GetParameter(null, "ViewMatrix");
m_worldViewMatrix = m_D3DEffect.GetParameter(null, "WorldViewMatrix");
m_worldViewProjectionMatrix = m_D3DEffect.GetParameter(null, "WorldViewProjectionMatrix");
m_billboardTexture = m_D3DEffect.GetParameter(null, "BillboardTexture");
m_billboardBlendTexture = m_D3DEffect.GetParameter(null, "BillboardBlendTexture");
m_billboardBlendRatio = m_D3DEffect.GetParameter(null, "BillboardBlendRatio");
m_depthsRT = m_D3DEffect.GetParameter(null, "DepthsRT");
m_halfPixel = m_D3DEffect.GetParameter(null, "HalfPixel");
m_scale = m_D3DEffect.GetParameter(null, "Scale");
m_softParticleDistanceScale = m_D3DEffect.GetParameter(null, "SoftParticleDistanceScale");
m_colorizeColor = m_D3DEffect.GetParameter(null, "ColorizeColor");
m_colorizePlaneNormal = m_D3DEffect.GetParameter(null, "ColorizePlaneNormal");
m_colorizePlaneDistance = m_D3DEffect.GetParameter(null, "ColorizePlaneDistance");
m_colorizeSoftDistance = m_D3DEffect.GetParameter(null, "ColorizeSoftDistance");
m_alphaMultiplier = m_D3DEffect.GetParameter(null, "AlphaMultiplierSaturation");
m_litBasicTechnique = m_D3DEffect.GetTechnique("Technique_LitBasic");
m_unlitBasicTechnique = m_D3DEffect.GetTechnique("Technique_UnlitBasic");
m_unlitBasicForwardTechnique = m_D3DEffect.GetTechnique("Technique_UnlitBasic_Forward");
m_ignoreDepthBasicTechnique = m_D3DEffect.GetTechnique("Technique_IgnoreDepthBasic");
m_colorizeTechnique = m_D3DEffect.GetTechnique("Technique_ColorizeHeight");
m_visualizeOverdrawTechnique = m_D3DEffect.GetTechnique("Technique_VisualizeOverdraw");
Reflector = new MyEffectReflectorBase(m_D3DEffect);
}
示例10: MyEffectVoxelsBase
public MyEffectVoxelsBase(string asset)
: base(asset)
{
m_projectionMatrix = m_D3DEffect.GetParameter(null, "ProjectionMatrix");
m_textureDiffuseForAxisXZ = m_D3DEffect.GetParameter(null, "TextureDiffuseForAxisXZ");
m_textureDiffuseForAxisY = m_D3DEffect.GetParameter(null, "TextureDiffuseForAxisY");
m_textureNormalMapForAxisXZ = m_D3DEffect.GetParameter(null, "TextureNormalMapForAxisXZ");
m_textureNormalMapForAxisY = m_D3DEffect.GetParameter(null, "TextureNormalMapForAxisY");
m_textureDiffuseForAxisXZ2 = m_D3DEffect.GetParameter(null, "TextureDiffuseForAxisXZ2");
m_textureDiffuseForAxisY2 = m_D3DEffect.GetParameter(null, "TextureDiffuseForAxisY2");
m_textureNormalMapForAxisXZ2 = m_D3DEffect.GetParameter(null, "TextureNormalMapForAxisXZ2");
m_textureNormalMapForAxisY2 = m_D3DEffect.GetParameter(null, "TextureNormalMapForAxisY2");
m_textureDiffuseForAxisXZ3 = m_D3DEffect.GetParameter(null, "TextureDiffuseForAxisXZ3");
m_textureDiffuseForAxisY3 = m_D3DEffect.GetParameter(null, "TextureDiffuseForAxisY3");
m_textureNormalMapForAxisXZ3 = m_D3DEffect.GetParameter(null, "TextureNormalMapForAxisXZ3");
m_textureNormalMapForAxisY3 = m_D3DEffect.GetParameter(null, "TextureNormalMapForAxisY3");
m_specularIntensity = m_D3DEffect.GetParameter(null, "SpecularIntensity");
m_specularPower = m_D3DEffect.GetParameter(null, "SpecularPower");
m_specularIntensity2 = m_D3DEffect.GetParameter(null, "SpecularIntensity2");
m_specularPower2 = m_D3DEffect.GetParameter(null, "SpecularPower2");
m_specularIntensity3 = m_D3DEffect.GetParameter(null, "SpecularIntensity3");
m_specularPower3 = m_D3DEffect.GetParameter(null, "SpecularPower3");
m_textureDistances = m_D3DEffect.GetParameter(null, "TEXTURE_DISTANCE");
m_textureScales = m_D3DEffect.GetParameter(null, "TEXTURE_SCALE");
m_lowTechnique = m_D3DEffect.GetTechnique("Technique_RenderQualityLow");
m_normalTechnique = m_D3DEffect.GetTechnique("Technique_RenderQualityNormal");
m_highTechnique = m_D3DEffect.GetTechnique("Technique_RenderQualityHigh");
m_extremeTechnique = m_D3DEffect.GetTechnique("Technique_RenderQualityExtreme");
m_normalMultimaterialTechnique = m_D3DEffect.GetTechnique("Technique_RenderQualityNormal_Multimaterial");
m_highMultimaterialTechnique = m_D3DEffect.GetTechnique("Technique_RenderQualityHigh_Multimaterial");
m_extremeMultimaterialTechnique = m_D3DEffect.GetTechnique("Technique_RenderQualityExtreme_Multimaterial");
m_normalFarTechnique = m_D3DEffect.GetTechnique("Technique_RenderQualityNormal_Far");
m_normalMultimaterialFarTechnique = D3DEffect.GetTechnique("Technique_RenderQualityNormal_Mulitmaterial_Far");
m_highFarTechnique = m_D3DEffect.GetTechnique("Technique_RenderQualityHigh_Far");
m_highMultimaterialFarTechnique = D3DEffect.GetTechnique("Technique_RenderQualityHigh_Mulitmaterial_Far");
m_extremeFarTechnique = m_D3DEffect.GetTechnique("Technique_RenderQualityExtreme_Far");
m_extremeMultimaterialFarTechnique = D3DEffect.GetTechnique("Technique_RenderQualityExtreme_Mulitmaterial_Far");
m_lowInstancedTechnique = m_D3DEffect.GetTechnique("Technique_RenderQualityLow_Instanced");
m_normalInstancedTechnique = m_D3DEffect.GetTechnique("Technique_RenderQualityNormal_Instanced");
m_highInstancedTechnique = m_D3DEffect.GetTechnique("Technique_RenderQualityHigh_Instanced");
m_extremeInstancedTechnique = m_D3DEffect.GetTechnique("Technique_RenderQualityExtreme_Instanced");
DynamicLights = new MyEffectDynamicLightingBase(m_D3DEffect);
Reflector = new MyEffectReflectorBase(m_D3DEffect);
}
示例11: MyEffectBlendLights
public MyEffectBlendLights()
: base("Effects2\\Lights\\MyEffectBlendLights")
{
m_Diffuse = m_D3DEffect.GetParameter(null, "DiffuseTexture");
m_Lights = m_D3DEffect.GetParameter(null, "LightTexture");
m_LightsMod = m_D3DEffect.GetParameter(null, "LightTextureMod");
m_LightsDiv = m_D3DEffect.GetParameter(null, "LightTextureDiv");
m_Depth = m_D3DEffect.GetParameter(null, "DepthTexture");
m_Normal = m_D3DEffect.GetParameter(null, "NormalsTexture");
m_backgroundTexture = m_D3DEffect.GetParameter(null, "BackgroundTexture");
m_halfPixel = m_D3DEffect.GetParameter(null, "HalfPixel");
m_scale = m_D3DEffect.GetParameter(null, "Scale");
m_AmbientColor = m_D3DEffect.GetParameter(null, "AmbientColor");
m_basicTechnique = m_D3DEffect.GetTechnique("BasicTechnique");
m_disableLightsTechnique = m_D3DEffect.GetTechnique("DisableLightsTechnique");
m_onlyLightsTechnique = m_D3DEffect.GetTechnique("OnlyLightsTechnique");
m_onlySpecularIntensityTechnique = m_D3DEffect.GetTechnique("OnlySpecularIntensity");
m_onlySpecularPowerTechnique = m_D3DEffect.GetTechnique("OnlySpecularPower");
m_onlyEmissivityTechnique = m_D3DEffect.GetTechnique("OnlyEmissivity");
m_onlyReflectivityTechnique = m_D3DEffect.GetTechnique("OnlyReflectivity");
m_copyEmissivity = m_D3DEffect.GetTechnique("CopyEmissivity");
DefaultTechnique = Technique.LightsEnabled;
CopyEmissivityTechnique = Technique.CopyEmissivity;
SetTechnique(DefaultTechnique);
}
示例12: Init
public override void Init(Effect effect)
{
_gTexture = effect.GetParameter(null, "gTexture");
SetTexture(_gTexture, _texture);
base.Init(effect);
}
示例13: MyEffectRenderGizmo
public MyEffectRenderGizmo()
: base("Effects2\\Models\\MyEffectRenderGizmo")
{
m_worldViewProjectionMatrix = m_D3DEffect.GetParameter(null, "WorldViewProjectionMatrix");
m_textureDiffuse = m_D3DEffect.GetParameter(null, "TextureDiffuse");
m_diffuseColor = m_D3DEffect.GetParameter(null, "DiffuseColor");
m_technique_RenderGizmo = m_D3DEffect.GetTechnique("Technique_RenderGizmo");
}
示例14: MyEffectColorMapping
public MyEffectColorMapping() :
base("Effects2\\Fullscreen\\MyEffectColorMapping")
{
m_inputTexture = m_D3DEffect.GetParameter(null, "InputTexture");
m_halfPixel = m_D3DEffect.GetParameter(null, "HalfPixel");
m_techniqueEnabled = m_D3DEffect.GetTechnique("ColorMappingEnabled");
m_techniqueDisabled = m_D3DEffect.GetTechnique("ColorMappingDisabled");
}
示例15: MyEffectVoxelsDebris
public MyEffectVoxelsDebris()
: base("Effects2\\Voxels\\MyEffectVoxelsDebris")
{
m_worldMatrix = m_D3DEffect.GetParameter(null, "WorldMatrix");
m_viewWorldScaleMatrix = m_D3DEffect.GetParameter(null, "ViewWorldScaleMatrix");
m_textureCoordRandomPositionOffset = m_D3DEffect.GetParameter(null, "TextureCoordRandomPositionOffset");
m_textureCoordScale = m_D3DEffect.GetParameter(null, "TextureCoordScale");
m_diffuseTextureColorMultiplier = m_D3DEffect.GetParameter(null, "DiffuseTextureColorMultiplier");
}