本文整理汇总了C#中IGraphicsService.GetDownsampleFilter方法的典型用法代码示例。如果您正苦于以下问题:C# IGraphicsService.GetDownsampleFilter方法的具体用法?C# IGraphicsService.GetDownsampleFilter怎么用?C# IGraphicsService.GetDownsampleFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGraphicsService
的用法示例。
在下文中一共展示了IGraphicsService.GetDownsampleFilter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GodRayFilter
//--------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="GodRayFilter"/> class.
/// </summary>
/// <param name="graphicsService">The graphics service.</param>
/// <exception cref="ArgumentNullException">
/// <paramref name="graphicsService"/> is <see langword="null"/>.
/// </exception>
public GodRayFilter(IGraphicsService graphicsService)
: base(graphicsService)
{
Effect effect = GraphicsService.Content.Load<Effect>("DigitalRune/PostProcessing/GodRayFilter");
_viewportSizeParameter = effect.Parameters["ViewportSize"];
_parameters0Parameter = effect.Parameters["Parameters0"];
_parameters1Parameter = effect.Parameters["Parameters1"];
_intensityParameter = effect.Parameters["Intensity"];
_numberOfSamplesParameter = effect.Parameters["NumberOfSamples"];
_sourceTextureParameter = effect.Parameters["SourceTexture"];
_gBuffer0Parameter = effect.Parameters["GBuffer0"];
_rayTextureParameter = effect.Parameters["RayTexture"];
_createMaskPass = effect.CurrentTechnique.Passes["CreateMask"];
_blurPass = effect.CurrentTechnique.Passes["Blur"];
_combinePass = effect.CurrentTechnique.Passes["Combine"];
_downsampleFilter = graphicsService.GetDownsampleFilter();
Scale = 1;
LightDirection = new Vector3F(0, -1, 0);
LightRadius = 0.2f;
Intensity = new Vector3F(1, 1, 1);
DownsampleFactor = 4;
NumberOfSamples = 8;
NumberOfPasses = 2;
Softness = 1;
}