当前位置: 首页>>代码示例>>C#>>正文


C# RenderHelper.RenderFullScreenQuadVertexPixel方法代码示例

本文整理汇总了C#中RenderHelper.RenderFullScreenQuadVertexPixel方法的典型用法代码示例。如果您正苦于以下问题:C# RenderHelper.RenderFullScreenQuadVertexPixel方法的具体用法?C# RenderHelper.RenderFullScreenQuadVertexPixel怎么用?C# RenderHelper.RenderFullScreenQuadVertexPixel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RenderHelper的用法示例。


在下文中一共展示了RenderHelper.RenderFullScreenQuadVertexPixel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Draw

        public override void Draw(Microsoft.Xna.Framework.Graphics.Texture2D ImageToProcess, RenderHelper rHelper, Microsoft.Xna.Framework.GameTime gt, PloobsEngine.Engine.GraphicInfo GraphicInfo, IWorld world, bool useFloatBuffer)
        {

            if (firstTime)
            {
                oldViewProjection = world.CameraManager.ActiveCamera.ViewProjection;
                firstTime = false;
            }

            effect.Parameters["attenuation"].SetValue(Attenuation);
            effect.Parameters["halfPixel"].SetValue(GraphicInfo.HalfPixel);
            effect.Parameters["InvertViewProjection"].SetValue(Matrix.Invert(world.CameraManager.ActiveCamera.ViewProjection));
            effect.Parameters["oldViewProjection"].SetValue(oldViewProjection);
            effect.Parameters["numSamples"].SetValue(NumSamples);
            effect.Parameters["depth"].SetValue(rHelper[PrincipalConstants.DephRT]);
            effect.Parameters["extra"].SetValue(rHelper[PrincipalConstants.extra1RT]);
            effect.Parameters["cena"].SetValue(ImageToProcess);

            oldViewProjection = world.CameraManager.ActiveCamera.ViewProjection;

            if (useFloatBuffer)
                rHelper.RenderFullScreenQuadVertexPixel(effect, SamplerState.PointClamp);
            else
                rHelper.RenderFullScreenQuadVertexPixel(effect, GraphicInfo.SamplerState);
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:25,代码来源:MotionBlurPostEffect.cs

示例2: Draw

        public override void Draw(Texture2D ImageToProcess,RenderHelper rHelper, GameTime gt, Engine.GraphicInfo GraphicInfo, IWorld world, bool useFloatingBuffer)
        {            
            rHelper.PushRenderTarget(renderTarget1);
            Saturate.Parameters["current"].SetValue(ImageToProcess);
            Saturate.Parameters["halfPixel"].SetValue(GraphicInfo.HalfPixel);
            if(useFloatingBuffer)
                rHelper.RenderFullScreenQuadVertexPixel(Saturate,SamplerState.PointClamp);
            else
                rHelper.RenderFullScreenQuadVertexPixel(Saturate, SamplerState.LinearClamp);

            Texture2D t = rHelper.PopRenderTargetAsSingleRenderTarget2D();

            rHelper.PushRenderTarget(renderTarget0);
            gaussian.Draw(t, rHelper, gt, GraphicInfo, world,useFloatingBuffer);
            Texture2D x = rHelper.PopRenderTargetAsSingleRenderTarget2D();
            rHelper.Clear(Color.Black);

            Combine.Parameters["halfPixel"].SetValue(GraphicInfo.HalfPixel);
            Combine.Parameters["base"].SetValue(ImageToProcess);
            Combine.Parameters["last"].SetValue(x);
            if (useFloatingBuffer)
                rHelper.RenderFullScreenQuadVertexPixel(Combine , SamplerState.PointClamp);
            else
                rHelper.RenderFullScreenQuadVertexPixel(Combine, GraphicInfo.SamplerState);
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:25,代码来源:BloomPostEffect.cs

示例3: Draw

        public override void Draw(Microsoft.Xna.Framework.Graphics.Texture2D ImageToProcess, RenderHelper rHelper, Microsoft.Xna.Framework.GameTime gt, PloobsEngine.Engine.GraphicInfo GraphicInfo, IWorld world, bool useFloatBuffer)
        {
            //effect.Parameters["timervalue"].SetValue(m_Timer);

            if (useFloatBuffer)
                rHelper.RenderFullScreenQuadVertexPixel(effect,SamplerState.PointClamp);
            else
                rHelper.RenderFullScreenQuadVertexPixel(effect,SamplerState.LinearClamp);
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:9,代码来源:ProjectiveTexturingPostEffect.cs

示例4: Draw

 public override void Draw(Texture2D ImageToProcess, RenderHelper rHelper, GameTime gt, Engine.GraphicInfo GraphicInfo, IWorld world, bool useFloatingBuffer)
 {
    hsv.Parameters["cena"].SetValue(ImageToProcess);
    hsv.Parameters["toMultiply"].SetValue(toMultiply);
    hsv.Parameters["toAdd"].SetValue(toAdd);
    if (useFloatingBuffer)
        rHelper.RenderFullScreenQuadVertexPixel(hsv, SamplerState.PointClamp);
    else
        rHelper.RenderFullScreenQuadVertexPixel(hsv, GraphicInfo.SamplerState);        
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:10,代码来源:HSVEffect.cs

示例5: Draw

 public override void Draw(Texture2D ImageToProcess, RenderHelper rHelper, GameTime gt, Engine.GraphicInfo GraphicInfo, IWorld world, bool useFloatingBuffer)
 {             
      effect.Parameters["EXTRA"].SetValue(rHelper[PrincipalConstants.extra1RT]);
      effect.Parameters["color"].SetValue(ImageToProcess);             
      effect.Parameters["halfPixel"].SetValue(GraphicInfo.HalfPixel);
      if (useFloatingBuffer)
          rHelper.RenderFullScreenQuadVertexPixel(effect, SamplerState.PointClamp);
      else
          rHelper.RenderFullScreenQuadVertexPixel(effect, GraphicInfo.SamplerState);              
  
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:11,代码来源:ToBlackPostEffect.cs

示例6: Draw

        public override void Draw(Texture2D ImageToProcess, RenderHelper rHelper, GameTime gt, Engine.GraphicInfo GraphicInfo, IWorld world, bool useFloatingBuffer)
        {
             effect.Parameters["Z_Near"].SetValue(world.CameraManager.ActiveCamera.NearPlane);
             effect.Parameters["Z_Far"].SetValue(world.CameraManager.ActiveCamera.FarPlane);
             effect.Parameters["depth"].SetValue(rHelper[PrincipalConstants.DephRT]);
             effect.Parameters["color"].SetValue(ImageToProcess);
             effect.Parameters["InvertViewProjection"].SetValue(Matrix.Invert(world.CameraManager.ActiveCamera.View * world.CameraManager.ActiveCamera.Projection));
             effect.Parameters["halfPixel"].SetValue(GraphicInfo.HalfPixel);
             effect.Parameters["cameraPosition"].SetValue(world.CameraManager.ActiveCamera.Position);

             if (useFloatingBuffer)
                 rHelper.RenderFullScreenQuadVertexPixel(effect, SamplerState.PointClamp);
             else
                 rHelper.RenderFullScreenQuadVertexPixel(effect, GraphicInfo.SamplerState);        
         
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:16,代码来源:DepthCueingPostEffect.cs

示例7: ClearGBuffer

 public void ClearGBuffer(RenderHelper render)
 {
     render.PushDepthStencilState(DepthStencilState.None);
     clearBufferEffect.Parameters["BackColor"].SetValue(backGroundColor.ToVector3());
     render.RenderFullScreenQuadVertexPixel(clearBufferEffect);
     render.PopDepthStencilState();
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:7,代码来源:LightPrePassGBuffer.cs

示例8: ClearGBuffer

 public void ClearGBuffer(RenderHelper render)
 {
     render.ValidateSamplerStates();      
     render.PushDepthStencilState(DepthStencilState.None);
     render.RenderFullScreenQuadVertexPixel(clearBufferEffect);
     render.PopDepthStencilState();      
     render.ValidateSamplerStates();
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:8,代码来源:PreGBuffer.cs

示例9: Draw

        public override void Draw(Texture2D ImageToProcess, RenderHelper rHelper, GameTime gt, GraphicInfo GraphicInfo, IWorld world, bool useFloatingBuffer)
        {
            effect.Parameters["normalSensibility"].SetValue(normalSensibility);
            effect.Parameters["depthSensibility"].SetValue(depthSensibility);
            effect.Parameters["weight"].SetValue(weights);
            effect.Parameters["pixel_size"].SetValue(GraphicInfo.HalfPixel);            
            effect.Parameters["depthTex"].SetValue(rHelper[PrincipalConstants.DephRT]);
            effect.Parameters["normalTex"].SetValue(rHelper[PrincipalConstants.normalRt]);
            effect.Parameters["image"].SetValue(ImageToProcess);                                    

            //if (Keyboard.GetState().IsKeyDown(Keys.Space))
            //{
            //    rHelper.RenderTextureComplete(ImageToProcess);
            //    return;
            //}
            if(useFloatingBuffer)
                rHelper.RenderFullScreenQuadVertexPixel(effect,SamplerState.PointClamp);
            else
                rHelper.RenderFullScreenQuadVertexPixel(effect, GraphicInfo.SamplerState);
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:20,代码来源:AntiAliasingPostEffectTabula.cs

示例10: DownScale

 private Texture2D DownScale(RenderHelper rHelper, Texture2D input, RenderTarget2D downscaleTarget, String technichName, bool useFloatingBuffer)
 {            
     effect.CurrentTechnique = effect.Techniques[technichName];
     effect.Parameters["SourceTexture0"].SetValue(input);
     effect.Parameters["g_vSourceDimensions"].SetValue(new Vector2(input.Width, input.Height));
     effect.Parameters["g_vDestinationDimensions"].SetValue(new Vector2(downscaleTarget.Width, downscaleTarget.Height));
     rHelper.PushRenderTarget(downscaleTarget);            
     if (useFloatingBuffer)
         rHelper.RenderFullScreenQuadVertexPixel(effect, SamplerState.PointClamp);
     else
         rHelper.RenderFullScreenQuadVertexPixel(effect, SamplerState.LinearClamp);
     return rHelper.PopRenderTargetAsSingleRenderTarget2D();            
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:13,代码来源:HdrPostEffect.cs

示例11: DownShaderBilinearTexture

        /// <summary>
        /// DownSample a texture using bilinear filtering implemented in Shader.
        /// </summary>
        /// <param name="render">The render.</param>
        /// <param name="Texture2D">The texture2 D.</param>
        /// <returns></returns>
        public Texture2D DownShaderBilinearTexture(RenderHelper render, Texture2D Texture2D)
        {
            effect.CurrentTechnique = effect.Techniques[1];
            effect.Parameters["PixelSize"].SetValue(new Vector2(1f / Texture2D.Width, 1f / Texture2D.Height));
            effect.Parameters["HalfPixel"].SetValue(new Vector2(0.5f / Rectangle.Width, 0.5f / Rectangle.Height));
            render.Textures[0] = Texture2D;
            SamplerState s0 = render.SetSamplerState(SamplerState.PointClamp, 0);

            render.PushRenderTarget(RenderTarget2D);
            render.RenderFullScreenQuadVertexPixel(effect);
            render.SetSamplerState(s0, 0);
            return render.PopRenderTargetAsSingleRenderTarget2D();
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:19,代码来源:DownSampler.cs

示例12: Draw

        public override void Draw(Microsoft.Xna.Framework.Graphics.Texture2D ImageToProcess, RenderHelper rHelper, Microsoft.Xna.Framework.GameTime gt, PloobsEngine.Engine.GraphicInfo GraphicInfo, IWorld world, bool useFloatBuffer)
        {          
            //ssao
            rHelper.PushRenderTarget(RenderTarget2D);
            rHelper.Textures[0] = rHelper[PrincipalConstants.normalRt];
            SamplerState s0 = rHelper.SetSamplerState(SamplerState.LinearClamp, 0);

            rHelper.Textures[1] = rHelper[PrincipalConstants.DephRT];
            SamplerState s1 = rHelper.SetSamplerState(SamplerState.PointClamp, 1);

            rHelper.Textures[2] = tex;
            SamplerState s2 = rHelper.SetSamplerState(SamplerState.LinearWrap, 2);            

            Effect.CurrentTechnique = Effect.Techniques[0];
            Effect.Parameters["random_size"].SetValue(64);
            Effect.Parameters["g_screen_size"].SetValue(new Vector2(GraphicInfo.BackBufferWidth, GraphicInfo.BackBufferHeight));    
            Effect.Parameters["invertViewProj"].SetValue(Matrix.Invert(world.CameraManager.ActiveCamera.Projection));
            Effect.Parameters["View"].SetValue(world.CameraManager.ActiveCamera.View);
            Effect.Parameters["halfPixel"].SetValue(GraphicInfo.HalfPixel);

            //artist parameters
            Effect.Parameters["g_sample_rad"].SetValue(radius);
            Effect.Parameters["g_intensity"].SetValue(intensity);
            Effect.Parameters["g_scale"].SetValue(scale);
            Effect.Parameters["g_bias"].SetValue(bias);
            
            rHelper.RenderFullScreenQuadVertexPixel(Effect);         

            rHelper.PopRenderTarget();
            rHelper.SetSamplerState(s0, 0);
            rHelper.SetSamplerState(s1, 1);
            rHelper.SetSamplerState(s2, 2);

            //blur
            rHelper.PushRenderTarget(RenderTarget2D2);
            sBlurPost.Draw(RenderTarget2D, rHelper, gt, GraphicInfo, world, useFloatBuffer);
            rHelper.PopRenderTarget();            
            
            rHelper[PrincipalConstants.SSAORT] = RenderTarget2D2;

            //Mix
            Effect.CurrentTechnique = Effect.Techniques[1];
            Effect.Parameters["SSAOCombineIntensityity"].SetValue(SSAOCombineIntensityity);
            rHelper.Textures[0] = RenderTarget2D2;
            SamplerState s = useFloatBuffer == true ? SamplerState.PointClamp : SamplerState.LinearClamp;
            s1 = rHelper.SetSamplerState(s, 1);
            rHelper.Textures[1] = ImageToProcess;                        
            rHelper.RenderFullScreenQuadVertexPixel(Effect);
            rHelper.SetSamplerState(s1, 1);           

        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:51,代码来源:SSAOPost.cs

示例13: Draw

        public override void Draw(Texture2D ImageToProcess, RenderHelper rHelper, GameTime gt, Engine.GraphicInfo GraphicInfo, IWorld world, bool useFloatingBuffer)
        {         
             rHelper.PushRenderTarget(target);
             gbp.Draw(rHelper[PrincipalConstants.extra1RT], rHelper,  gt, GraphicInfo, world,false);
             x = rHelper.PopRenderTargetAsSingleRenderTarget2D();

             if (doubleBlur)
             {
                 rHelper.PushRenderTarget(target2);
                 gbp.Draw(x, rHelper, gt, GraphicInfo, world, false);
                 x = rHelper.PopRenderTargetAsSingleRenderTarget2D();
             }

             effect.Parameters["intensity"].SetValue(intensity);
             effect.Parameters["glowMapBlurried"].SetValue(x);
             effect.Parameters["colorMap"].SetValue(ImageToProcess);
             effect.Parameters["halfPixel"].SetValue(GraphicInfo.HalfPixel);

             if (useFloatingBuffer)
                 rHelper.RenderFullScreenQuadVertexPixel(effect, SamplerState.PointClamp);
             else
                 rHelper.RenderFullScreenQuadVertexPixel(effect, GraphicInfo.SamplerState);
         
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:24,代码来源:GlowPostEffect.cs

示例14: DrawScene

        public void DrawScene(GameTime gameTime, IWorld world, IDeferredGBuffer gbuffer, IDeferredLightMap lightmap, RenderHelper render)
        {
            render.PushDepthStencilState(DepthStencilState.None);

            PambientColor.SetValue(ambientColor.ToVector3());
            render.device.Textures[0] = lightmap[DeferredLightMapType.LIGHTMAP];
            SamplerState s0 = render.SetSamplerState(SamplerState.PointClamp, 0);

            render.device.Textures[1] = gbuffer[GBufferTypes.Extra1];
            render.device.Textures[2] = gbuffer[GBufferTypes.COLOR];
            //PEXTRA1.SetValue(gbuffer[GBufferTypes.Extra1]);            
            //PcolorMap.SetValue(gbuffer[GBufferTypes.COLOR]);
            //PlightMap.SetValue(lightmap[DeferredLightMapType.LIGHTMAP]);            

            render.RenderFullScreenQuadVertexPixel(finalCombineEffect);

            render.SetSamplerState(s0, 0);            

            if (saveToTexture)
            {
                render.PopRenderTarget();                
            }
            render.PopDepthStencilState();
            
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:25,代码来源:FinalCombination.cs

示例15: Draw

            public override void Draw(Texture2D ImageToProcess, RenderHelper rHelper, GameTime gt, PloobsEngine.Engine.GraphicInfo GraphicInfo, IWorld world, bool useFloatBuffer)
            {

                Matrix v = world.CameraManager.ActiveCamera.View;
                Matrix p = world.CameraManager.ActiveCamera.Projection;

                rHelper.PushRenderTarget(depthrender);
                rHelper.Clear(Color.Black);
                rHelper.RenderSceneWithCustomMaterial(renderdepth,
                    (effect, obj, bi, ti, s, er, wvp) =>
                    {
                        Matrix w1 = Matrix.Multiply(obj.WorldMatrix, bi.ModelLocalTransformation);
                        effect.Parameters["wvp"].SetValue(w1 * wvp);
                        effect.Parameters["WorldView"].SetValue(w1 * v);
                        effect.Parameters["farPlane"].SetValue(world.CameraManager.ActiveCamera.FarPlane);

                    }, world, gt, null, ref v, ref p, false, true);

                Texture2D depth = rHelper.PopRenderTargetAsSingleRenderTarget2D();


                // Set shader atributes
                //SetNormalTexture(rHelper[PrincipalConstants.normalRt]);
                //shader.Parameters["depthTexture"].SetValue(rHelper[PrincipalConstants.DephRT]);                
                shader.Parameters["depthTexture"].SetValue(depth);                
                //shader.Parameters["InvertViewProjection"].SetValue(Matrix.Invert(world.CameraManager.ActiveCamera.Projection));
                
                NumberSteps = 8;
                NumberDirections = 12;
                Radius = 10f;
                LineAttenuation = 0.75f;
                Contrast = 1.0f;
                AngleBias = 0.00218166653f;
                LineAttenuation = 0.75f;
                
                // It works a the depth texture resolution. Use a downsampled version of the G-Buffer.
                SetResolution(new Vector2(GraphicInfo.BackBufferWidth, GraphicInfo.BackBufferHeight));
                SetInverseResolution(new Vector2(1f / (float)GraphicInfo.BackBufferWidth, 1f / (float)GraphicInfo.BackBufferHeight));
                SetNumberSteps(8);
                SetNumberDirections(12);
                SetContrast(Contrast  / (1.0f - (float)Math.Sin(AngleBias)));
                SetLineAttenuation(LineAttenuation);
                SetRadius(Radius  );
                SetAngleBias(AngleBias);
                SetHalfPixel(GraphicInfo.HalfPixel);

                float _tanFovy = (float)Math.Tan(world.CameraManager.ActiveCamera.FieldOfView / 2);
                Vector2 focalLen = new Vector2
                {
                    X = world.CameraManager.ActiveCamera.AspectRatio / _tanFovy,
                    Y = 1.0f / _tanFovy
                };               
                
                //pointLightEffect.Parameters["farPlane"].SetValue(camera.FarPlane);

                SetFocalLength(focalLen);
                SetInverseFocalLength(new Vector2(_tanFovy * world.CameraManager.ActiveCamera.AspectRatio, -_tanFovy));

                SetSquareRadius(AngleBias * AngleBias);
                SetInverseRadius(1f / AngleBias);
                SetTanAngleBias((float)Math.Tan(AngleBias));                
                
                //rHelper.PushRenderTarget(RenderTarget2D);
                rHelper.SetSamplerStates(SamplerState.PointWrap);
                rHelper.Clear(Color.White);
                rHelper.RenderFullScreenQuadVertexPixel(shader, SamplerState.PointWrap);
                return;

                Texture2D t = rHelper.PopRenderTargetAsSingleRenderTarget2D();
                               
                //rHelper.PushRenderTarget(RenderTarget2D2);
                //rHelper.Clear(Color.Black);
                //g.Draw(t, rHelper, gt, GraphicInfo, world, useFloatBuffer);
                //t = rHelper.PopRenderTargetAsSingleRenderTarget2D();
                
                ssaofinal.Parameters["SSAOTex"].SetValue(t);
                ssaofinal.Parameters["SceneTexture"].SetValue(ImageToProcess);
                ssaofinal.Parameters["halfPixel"].SetValue(GraphicInfo.HalfPixel);
                ssaofinal.Parameters["weight"].SetValue(1);
                rHelper.SetSamplerStates(SamplerState.PointClamp);
                if (useFloatBuffer)
                    rHelper.RenderFullScreenQuadVertexPixel(ssaofinal, SamplerState.PointClamp);
                else
                    rHelper.RenderFullScreenQuadVertexPixel(ssaofinal, GraphicInfo.SamplerState);              

            }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:86,代码来源:HBAOPostEffect.cs


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