• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Graphics.EffectPass类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Microsoft.Xna.Framework.Graphics.EffectPass的典型用法代码示例。如果您正苦于以下问题:C# EffectPass类的具体用法?C# EffectPass怎么用?C# EffectPass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EffectPass类属于Microsoft.Xna.Framework.Graphics命名空间,在下文中一共展示了EffectPass类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Render

        public override void Render(GraphicsDevice myDevice, EffectPass pass)
        {
            pass.Apply();

            myDevice.Textures[0] = Texture;
            myDevice.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, Vertices, 0, 4, Indexes, 0, 2);
        }
开发者ID:mikeschuld,项目名称:HMEngineXNA,代码行数:7,代码来源:HMQuad.cs


示例2: Draw

        internal void Draw(Texture2D[] textures, GraphicsDevice device, BasicEffect effect, EffectPass pass)
        {
            effect.World = displayObject.WorldTransform;
            effect.Texture = textures[displayObject.TextureIndex];
            device.SetVertexBuffer(vertexBuffer);
            device.Indices = indexBuffer;
            pass.Apply();

            device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, vertices.Length, 0, indices.Length / 3);
        }
开发者ID:Jamedjo,项目名称:BeatShiftLib,代码行数:10,代码来源:BruteDisplayObjectEntry.cs


示例3: Render

        public override void Render(GraphicsDevice myDevice, EffectPass pass)
        {
            myDevice.DepthStencilState = DepthStencilState.None;
            for (int i = 0; i < 6; i++) {
                mySides[i].Position = HMCameraManager.ActiveCamera.Position + myOffsets[i];
                HMEffectManager.ActiveShader.SetParameters(mySides[i]);

                mySides[i].Render(myDevice, pass);
            }

            myDevice.DepthStencilState = DepthStencilState.Default;
        }
开发者ID:mikeschuld,项目名称:HMEngineXNA,代码行数:12,代码来源:HMSkybox.cs


示例4: RenderSky

		private void RenderSky(EffectWrapper pEffect, EffectPass pEffectPass)
		{
			ModelMeshPart meshPart = m_pSkyDomeModel.Meshes[0].MeshParts[0];

			pEffect.GraphicsDevice.Indices = meshPart.IndexBuffer;
			pEffect.GraphicsDevice.SetVertexBuffer(meshPart.VertexBuffer, meshPart.VertexOffset);

			pEffect.GraphicsDevice.DrawIndexedPrimitives(PrimitiveType.TriangleList,
				meshPart.VertexOffset,
				0,
				meshPart.NumVertices,
				meshPart.StartIndex,
				meshPart.PrimitiveCount);
		}
开发者ID:modulexcite,项目名称:torq2,代码行数:14,代码来源:Sky.cs


示例5: ProjectorLightRenderer

        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectorLightRenderer"/> class.
        /// </summary>
        /// <param name="graphicsService">The graphics service.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="graphicsService"/> is <see langword="null"/>.
        /// </exception>
        public ProjectorLightRenderer(IGraphicsService graphicsService)
        {
            if (graphicsService == null)
            throw new ArgumentNullException("graphicsService");

              _effect = graphicsService.Content.Load<Effect>("DigitalRune/Deferred/ProjectorLight");
              _parameterWorldViewProjection = _effect.Parameters["WorldViewProjection"];
              _parameterViewportSize = _effect.Parameters["ViewportSize"];
              _parameterFrustumCorners = _effect.Parameters["FrustumCorners"];
              _parameterDiffuseColor = _effect.Parameters["ProjectorLightDiffuse"];
              _parameterSpecularColor = _effect.Parameters["ProjectorLightSpecular"];
              _parameterPosition = _effect.Parameters["ProjectorLightPosition"];
              _parameterRange = _effect.Parameters["ProjectorLightRange"];
              _parameterAttenuation = _effect.Parameters["ProjectorLightAttenuation"];
              _parameterTexture = _effect.Parameters["ProjectorLightTexture"];
              _parameterTextureMatrix = _effect.Parameters["ProjectorLightTextureMatrix"];
              _parameterGBuffer0 = _effect.Parameters["GBuffer0"];
              _parameterGBuffer1 = _effect.Parameters["GBuffer1"];
              _parameterShadowMaskChannel = _effect.Parameters["ShadowMaskChannel"];
              _parameterShadowMask = _effect.Parameters["ShadowMask"];
              _passClip = _effect.CurrentTechnique.Passes["Clip"];
              _passDefaultRgb = _effect.CurrentTechnique.Passes["DefaultRgb"];
              _passDefaultAlpha = _effect.CurrentTechnique.Passes["DefaultAlpha"];
              _passShadowedRgb = _effect.CurrentTechnique.Passes["ShadowedRgb"];
              _passShadowedAlpha = _effect.CurrentTechnique.Passes["ShadowedAlpha"];
        }
开发者ID:Zolniu,项目名称:DigitalRune,代码行数:34,代码来源:ProjectorLightRenderer.cs


示例6: ScatteringSkyRenderer

        public ScatteringSkyRenderer(IGraphicsService graphicsService)
        {
            if (graphicsService == null)
            throw new ArgumentNullException("graphicsService");

              if (graphicsService.GraphicsDevice.GraphicsProfile == GraphicsProfile.Reach)
            throw new NotSupportedException("The ScatteringSkyRenderer does not support the Reach profile.");

              _effect = graphicsService.Content.Load<Effect>("DigitalRune/Sky/ScatteringSky");
              _parameterView = _effect.Parameters["View"];
              _parameterProjection = _effect.Parameters["Projection"];
              _parameterSunDirection = _effect.Parameters["SunDirection"];
              _parameterRadii = _effect.Parameters["Radii"];
              _parameterNumberOfSamples = _effect.Parameters["NumberOfSamples"];
              _parameterBetaRayleigh = _effect.Parameters["BetaRayleigh"];
              _parameterBetaMie = _effect.Parameters["BetaMie"];
              _parameterGMie = _effect.Parameters["GMie"];
              _parameterSunIntensity = _effect.Parameters["SunIntensity"];
              _parameterTransmittance = _effect.Parameters["Transmittance"];
              _parameterBaseHorizonColor = _effect.Parameters["BaseHorizonColor"];
              _parameterBaseZenithColor = _effect.Parameters["BaseZenithColor"];
              _passLinear = _effect.Techniques[0].Passes["Linear"];
              _passGamma = _effect.Techniques[0].Passes["Gamma"];
              _passLinearWithBaseColor = _effect.Techniques[0].Passes["LinearWithBaseColor"];
              _passGammaWithBaseColor = _effect.Techniques[0].Passes["GammaWithBaseColor"];

              _submesh = MeshHelper.GetBox(graphicsService);
        }
开发者ID:Zolniu,项目名称:DigitalRune,代码行数:28,代码来源:ScatteringSkyRenderer.cs


示例7: GradientTextureSkyRenderer

        public GradientTextureSkyRenderer(IGraphicsService graphicsService)
        {
            if (graphicsService == null)
            throw new ArgumentNullException("graphicsService");

              if (graphicsService.GraphicsDevice.GraphicsProfile == GraphicsProfile.Reach)
            throw new NotSupportedException("The GradientTextureSkyRenderer does not support the Reach profile.");

              _effect = graphicsService.Content.Load<Effect>("DigitalRune/Sky/GradientTextureSky");
              _parameterView = _effect.Parameters["View"];
              _parameterProjection = _effect.Parameters["Projection"];
              _parameterSunDirection = _effect.Parameters["SunDirection"];
              _parameterTime = _effect.Parameters["Time"];
              _parameterColor = _effect.Parameters["Color"];
              _parameterFrontTexture = _effect.Parameters["FrontTexture"];
              _parameterBackTexture = _effect.Parameters["BackTexture"];
              _parameterAbcd = _effect.Parameters["Abcd"];
              _parameterEAndStrength = _effect.Parameters["EAndStrength"];
              _passLinear = _effect.Techniques[0].Passes["Linear"];
              _passGamma = _effect.Techniques[0].Passes["Gamma"];
              _passCieLinear = _effect.Techniques[0].Passes["CieLinear"];
              _passCieGamma = _effect.Techniques[0].Passes["CieGamma"];

              _submesh = MeshHelper.GetBox(graphicsService);
        }
开发者ID:Zolniu,项目名称:DigitalRune,代码行数:25,代码来源:GradientTextureSkyRenderer.cs


示例8: GdxSpriteBatch

        public GdxSpriteBatch(GraphicsDevice graphicsDevice)
        {
            if (graphicsDevice == null)
                throw new ArgumentNullException("graphicsDevice");

            _device = graphicsDevice;

            _spriteEffect = new LocalSpriteEffect(graphicsDevice);
            _matrixTransform = _spriteEffect.Parameters["MatrixTransform"];
            _spritePass = _spriteEffect.CurrentTechnique.Passes[0];

            _transformMatrix = Matrix.Identity;
            //_projectionMatrix = Matrix.CreateOrthographicOffCenter(0, graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height, 0, 0, 1);
            _projectionMatrix = XnaExt.Matrix.CreateOrthographic2D(0, 0, graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height, -1, 0);

            Color = Color.White;

            CalculateIndexBuffer();

            _rasterizerScissorState = new RasterizerState() {
                CullMode = CullMode.None,
                ScissorTestEnable = true,
            };

            // projection uses CreateOrthographicOffCenter to create 2d projection
            // matrix with 0,0 in the upper left.
            /*_basicEffect.Projection = Matrix.CreateOrthographicOffCenter
                (0, graphicsDevice.Viewport.Width,
                graphicsDevice.Viewport.Height, 0,
                0, 1);
            this._basicEffect.World = Matrix.Identity;
            this._basicEffect.View = Matrix.CreateLookAt(Vector3.Zero, Vector3.Forward,
                Vector3.Up);*/
        }
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:34,代码来源:GdxSpriteBatch.cs


示例9: DepthOfFieldFilter

        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="DepthOfFieldFilter"/> class.
        /// </summary>
        /// <param name="graphicsService">The graphics service.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="graphicsService"/> is <see langword="null"/>.
        /// </exception>
        public DepthOfFieldFilter(IGraphicsService graphicsService)
            : base(graphicsService)
        {
            _effect = GraphicsService.Content.Load<Effect>("DigitalRune/PostProcessing/DepthOfFieldFilter");
              _screenSizeParameter = _effect.Parameters["ScreenSize"];
              _depthTextureParameter = _effect.Parameters["DepthTexture"];
              _nearBlurDistanceParameter = _effect.Parameters["NearBlurDistance"];
              _nearFocusDistanceParameter = _effect.Parameters["NearFocusDistance"];
              _farFocusDistanceParameter = _effect.Parameters["FarFocusDistance"];
              _farBlurDistanceParameter = _effect.Parameters["FarBlurDistance"];
              _farParameter = _effect.Parameters["Far"];
              _blurTextureParameter = _effect.Parameters["BlurTexture"];
              _downsampledDepthTextureParameter = _effect.Parameters["DownsampledDepthTexture"];
              _downsampledCocTextureParameter = _effect.Parameters["DownsampledCocTexture"];
              _offsetsParameter = _effect.Parameters["Offsets"];
              _weightsParameter = _effect.Parameters["Weights"];
              _sceneTextureParameter = _effect.Parameters["SceneTexture"];
              _circleOfConfusionPass = _effect.CurrentTechnique.Passes["CircleOfConfusion"];
              _blurPass = _effect.CurrentTechnique.Passes["Blur"];
              _depthOfFieldPass = _effect.CurrentTechnique.Passes["DepthOfField"];

              _downsampleFilter = PostProcessHelper.GetDownsampleFilter(graphicsService);

              _cocBlur = new Blur(graphicsService);
              _cocBlur.InitializeBoxBlur(5, false);

              NearBlurDistance = 2;
              NearFocusDistance = 5;
              FarFocusDistance = 6;
              FarBlurDistance = 10;
              _downsampleFactor = 2;
              BlurStrength = 1;
        }
开发者ID:Zolniu,项目名称:DigitalRune,代码行数:41,代码来源:DepthOfFieldFilter.cs


示例10: ParticleEffect

        public ParticleEffect(Effect _fx, ParticleEffectConfig conf)
        {
            fx = _fx;
            fx.CurrentTechnique = fx.Techniques[0];

            fxPassSimple = fx.CurrentTechnique.Passes[conf.PassSimple];
            fxpVP = fx.Parameters[conf.ParamVP];
            fxpTime = fx.Parameters[conf.ParamTime];
            fxpMapSize = fx.Parameters[conf.ParamMapSize];

            fxPassLightning = fx.CurrentTechnique.Passes[conf.PassLightning];
            fxpLSplits = fx.Parameters[conf.ParamSplits];

            fxPassFire = fx.CurrentTechnique.Passes[conf.PassFire];
            fxpFRates = fx.Parameters[conf.ParamRates];
            fxpFScales = fx.Parameters[conf.ParamScales];
            fxpFOff1 = fx.Parameters[conf.ParamOffset1];
            fxpFOff2 = fx.Parameters[conf.ParamOffset2];
            fxpFOff3 = fx.Parameters[conf.ParamOffset3];
            fxpFDistortScale = fx.Parameters[conf.ParamDistortScale];
            fxpFDistortBias = fx.Parameters[conf.ParamDistortBias];

            fxPassAlert = fx.CurrentTechnique.Passes[conf.PassAlert];

            // Set Default Values
            LightningSplits = DEFAULT_SPLITS;
            FireDistortScale = DEFAULT_DISTORT_SCALE;
            FireDistortBias = DEFAULT_DISTORT_BIAS;
            FireOffset1 = DEFAULT_OFFSET;
            FireOffset2 = DEFAULT_OFFSET;
            FireOffset3 = DEFAULT_OFFSET;
            FireRates = DEFAULT_RATES;
            FireScales = DEFAULT_SCALES;
        }
开发者ID:RegrowthStudios,项目名称:VoxelRTS,代码行数:34,代码来源:ParticleEffect.cs


示例11: EdgeFilter

        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="EdgeFilter"/> class.
        /// </summary>
        /// <param name="graphicsService">The graphics service.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="graphicsService"/> is <see langword="null"/>.
        /// </exception>
        public EdgeFilter(IGraphicsService graphicsService)
            : base(graphicsService)
        {
            _effect = GraphicsService.Content.Load<Effect>("DigitalRune/PostProcessing/EdgeFilter");
              _parameterViewportSize = _effect.Parameters["ViewportSize"];
              _parameterHalfEdgeWidth = _effect.Parameters["HalfEdgeWidth"];
              _parameterDepthThreshold = _effect.Parameters["DepthThreshold"];
              _parameterDepthSensitivity = _effect.Parameters["DepthSensitivity"];
              _parameterNormalThreshold = _effect.Parameters["NormalThreshold"];
              _parameterNormalSensitivity = _effect.Parameters["NormalSensitivity"];
              _parameterCameraBackward = _effect.Parameters["CameraBackward"];
              _parameterSourceTexture = _effect.Parameters["SourceTexture"];
              _parameterSilhouetteColor = _effect.Parameters["SilhouetteColor"];
              _parameterCreaseColor = _effect.Parameters["CreaseColor"];
              _parameterGBuffer0 = _effect.Parameters["GBuffer0"];
              _parameterGBuffer1 = _effect.Parameters["GBuffer1"];
              _passEdge = _effect.Techniques[0].Passes["Edge"];
              _passOnePixelEdge = _effect.Techniques[0].Passes["OnePixelEdge"];

              EdgeWidth = 2.0f;
              DepthThreshold = 0.001f;  // = minDistance / farPlaneDistance
              DepthSensitivity = 1000;  // = farPlaneDistance / (maxDistance - minDistance)
              NormalThreshold = 0.1f;
              NormalSensitivity = 2f;
              SilhouetteColor = new Vector4F(0, 0, 0, 1);
              CreaseColor = new Vector4F(0, 0, 0, 1);
        }
开发者ID:Zolniu,项目名称:DigitalRune,代码行数:35,代码来源:EdgeFilter.cs


示例12: StencilSolidEffect

 public StencilSolidEffect(Effect effect)
 {
     _effect = effect;
     _pass = _effect.CurrentTechnique.Passes[0];
     _projection = effect.Parameters["Projection"];
     _transformation = effect.Parameters["Transformation"];
 }
开发者ID:liwq-net,项目名称:XnaVG,代码行数:7,代码来源:StencilSolidEffect.cs


示例13: SaoFilter

        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="SsaoFilter"/> class.
        /// </summary>
        /// <param name="graphicsService">The graphics service.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="graphicsService"/> is <see langword="null"/>.
        /// </exception>
        public SaoFilter(IGraphicsService graphicsService)
            : base(graphicsService)
        {
            Effect effect = GraphicsService.Content.Load<Effect>("DigitalRune/PostProcessing/SaoFilter");
              _frustumInfoParameter = effect.Parameters["FrustumInfo"];
              _numberOfAOSamplesParameter = effect.Parameters["NumberOfAOSamples"];
              _aoParameters0 = effect.Parameters["AOParameters0"];
              _aoParameters1 = effect.Parameters["AOParameters1"];
              _aoParameters2 = effect.Parameters["AOParameters2"];
              _sourceTextureParameter = effect.Parameters["SourceTexture"];
              _occlusionTextureParameter = effect.Parameters["OcclusionTexture"];
              _gBuffer0Parameter = effect.Parameters["GBuffer0"];
              //_viewParameter = _effect.Parameters["View"];
              //_gBuffer1Parameter = _effect.Parameters["GBuffer1"];
              _createAOPass = effect.CurrentTechnique.Passes["CreateAO"];
              _blurHorizontalPass = effect.CurrentTechnique.Passes["BlurHorizontal"];
              _blurVerticalPass = effect.CurrentTechnique.Passes["BlurVertical"];
              _blurVerticalAndCombinePass = effect.CurrentTechnique.Passes["BlurVerticalAndCombine"];

              Strength = 1;
              MaxOcclusion = 1;
              Radius = 0.5f;
              MinBias = 0.02f;
              Bias = 0.0004f;
              NumberOfSamples = 11;
              SampleDistribution = 7;
              BlurScale = 2;
              EdgeSoftness = 0.5f;
              CombineWithSource = true;
        }
开发者ID:Zolniu,项目名称:DigitalRune,代码行数:38,代码来源:SaoFilter.cs


示例14: LuminanceFilter

        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="LuminanceFilter"/> class.
        /// </summary>
        /// <param name="graphicsService">The graphics service.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="graphicsService"/> is <see langword="null"/>.
        /// </exception>
        public LuminanceFilter(IGraphicsService graphicsService)
            : base(graphicsService)
        {
            _effect = GraphicsService.Content.Load<Effect>("DigitalRune/PostProcessing/LuminanceFilter");
              _useGeometricMeanParameter = _effect.Parameters["UseGeometricMean"];
              _useAdaptionParameter = _effect.Parameters["UseAdaption"];
              _deltaTimeParameter = _effect.Parameters["DeltaTime"];
              _adaptionSpeedParameter = _effect.Parameters["AdaptionSpeed"];
              _lastLuminanceTextureParameter = _effect.Parameters["LastLuminanceTexture"];
              _textureParameter = _effect.Parameters["SourceTexture"];
              _sourceSizeParameter = _effect.Parameters["SourceSize"];
              _targetSizeParameter = _effect.Parameters["TargetSize"];
              _createPass = _effect.CurrentTechnique.Passes["Create"];
              _downsamplePass = _effect.CurrentTechnique.Passes["Downsample"];
              _finalPass = _effect.CurrentTechnique.Passes["Final"];

              _downsampleFilter = PostProcessHelper.GetDownsampleFilter(graphicsService);
              _copyFilter = PostProcessHelper.GetCopyFilter(graphicsService);

              UseGeometricMean = true;
              UseAdaption = true;
              AdaptionSpeed = 0.02f;

              DefaultTargetFormat = new RenderTargetFormat(1, 1, false, SurfaceFormat.HalfVector4, DepthFormat.None);
        }
开发者ID:Zolniu,项目名称:DigitalRune,代码行数:33,代码来源:LuminanceFilter.cs


示例15: ObjectMotionBlur

        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="ObjectMotionBlur"/> class.
        /// </summary>
        /// <param name="graphicsService">The graphics service.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="graphicsService"/> is <see langword="null"/>.
        /// </exception>
        public ObjectMotionBlur(IGraphicsService graphicsService)
            : base(graphicsService)
        {
            _effect = GraphicsService.Content.Load<Effect>("DigitalRune/PostProcessing/ObjectMotionBlur");
              _viewportSizeParameter = _effect.Parameters["ViewportSize"];
              _sourceTextureParameter = _effect.Parameters["SourceTexture"];
              _numberOfSamplesParameter = _effect.Parameters["NumberOfSamples"];
              _velocityTextureParameter = _effect.Parameters["VelocityTexture"];
              _velocityTexture2Parameter = _effect.Parameters["VelocityTexture2"];
              _maxBlurRadiusParameter = _effect.Parameters["MaxBlurRadius"];
              _sourceSizeParameter = _effect.Parameters["SourceSize"];
              _gBuffer0Parameter = _effect.Parameters["GBuffer0"];
              _jitterTextureParameter = _effect.Parameters["JitterTexture"];
              _softZExtentParameter = _effect.Parameters["SoftZExtent"];
              _singlePass = _effect.CurrentTechnique.Passes["Single"];
              _dualPass = _effect.CurrentTechnique.Passes["Dual"];
              _downsampleMaxParameter = _effect.CurrentTechnique.Passes["DownsampleMax"];
              _downsampleMaxFromFloatBufferParameter = _effect.CurrentTechnique.Passes["DownsampleMaxFromFloatBuffer"];
              _neighborMaxPass = _effect.CurrentTechnique.Passes["NeighborMax"];
              _softEdgePass = _effect.CurrentTechnique.Passes["SoftEdge"];
              _jitterTexture = NoiseHelper.GetGrainTexture(GraphicsService, 128);

              NumberOfSamples = 9;
              MaxBlurRadius = 20;
        }
开发者ID:Zolniu,项目名称:DigitalRune,代码行数:33,代码来源:ObjectMotionBlur.cs


示例16: 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;
        }
开发者ID:Zolniu,项目名称:DigitalRune,代码行数:35,代码来源:GodRayFilter.cs


示例17: DrawDebugWorld

        public void DrawDebugWorld(DynamicsWorld world)
        {
            world.DebugDrawWorld();

            if (lines.Count == 0)
                return;

            if (effect == null)
            {
                effect = new BasicEffect(graphics.Device);
                effect.World = Microsoft.Xna.Framework.Matrix.Identity;
                effect.VertexColorEnabled = true;
                pass = effect.CurrentTechnique.Passes[0];
            }

            effect.Projection = graphics.GetEffect().Projection;
            effect.View = graphics.GetEffect().View;
            pass.Apply();

            int pointCount = lines.Count;
            int linesCount = pointCount / 2;
            VertexPositionColor[] linesArray = new VertexPositionColor[pointCount];
            for (int i = 0; i < pointCount; i++)
            {
                int color = lines[i].Color;
                linesArray[i].Color = new Color(color & 0xff, (color & 0xff00) >> 8, (color & 0xff0000) >> 16, 1);
                linesArray[i].Position = MathHelper.Convert(lines[i].Position);
            }
            graphics.Device.DrawUserPrimitives(PrimitiveType.LineList, linesArray, 0, linesCount);
            lines.Clear();
        }
开发者ID:raiker,项目名称:BulletSharp,代码行数:31,代码来源:PhysicsDebugDraw.cs


示例18: SwapProgram

        public void SwapProgram(string passName)
        {
            _passName = passName;
            if (passName == null)
                return;

            _effectPass = _shader.CurrentTechnique.Passes[passName];
        }
开发者ID:EmuDevs,项目名称:EDTerraria,代码行数:8,代码来源:ShaderData.cs


示例19: SwapProgram

		public void SwapProgram(string passName)
		{
			this._passName = passName;
			if (passName != null)
			{
				this._effectPass = this._shader.CurrentTechnique.Passes[passName];
			}
		}
开发者ID:thegamingboffin,项目名称:Ulterraria_Reborn_GitHub,代码行数:8,代码来源:ShaderData.cs


示例20: StencilFillEffect

 public StencilFillEffect(Effect effect)
 {
     _effect = effect;
     _pass = _effect.CurrentTechnique.Passes[0];
     _projection = effect.Parameters["Projection"];
     _transformation = effect.Parameters["Transformation"];
     _offset = effect.Parameters["Offset"];
     _offsetValue = Vector4.Zero;
 }
开发者ID:liwq-net,项目名称:XnaVG,代码行数:9,代码来源:StencilFillEffect.cs



注:本文中的Microsoft.Xna.Framework.Graphics.EffectPass类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Graphics.EffectTechnique类代码示例发布时间:2022-05-26
下一篇:
C# Graphics.EffectParameter类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap