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


C# RenderHelper类代码示例

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


RenderHelper类属于命名空间,在下文中一共展示了RenderHelper类的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

 protected override void Draw(GameTime gameTime, RenderHelper render)
 {        
     base.Draw(gameTime, render);
     render.RenderTextComplete("PloobsEngine on Windows Phone7", new Vector2(20, 10), Color.Red, Matrix.Identity);
     if(result != null)
         render.RenderTextComplete(result, new Vector2(20, 30), Color.Red, Matrix.Identity);
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:7,代码来源:Picking3D.cs

示例3: Draw

 protected override void  Draw(GameTime gameTime, RenderHelper render)
 {
     render.RenderTextureComplete(texture, Color.White, GraphicInfo.FullScreenRectangle, Matrix.Identity);
     render.RenderTextComplete("Demo 17-22:Texture Generates On the fly ", new Vector2(10, 15), Color.White, Matrix.Identity);
     render.RenderTextComplete("Random Texture generated Procedurally on CPU", new Vector2(10, 35), Color.White, Matrix.Identity);
     render.RenderTextComplete("Hit Space to change the texture", new Vector2(10, 55), Color.White, Matrix.Identity);
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:7,代码来源:ProceduralTextureScreen.cs

示例4: Draw

        /// <summary>
        /// This is called when the screen should draw itself.
        /// </summary>
        /// <param name="gameTime"></param>
        /// <param name="render"></param>
        protected override void Draw(GameTime gameTime, RenderHelper render)
        {
            base.Draw(gameTime, render);

            ///Draw some text on the screen
            render.RenderTextComplete("Demo: Basic Screen Forward", new Vector2(GraphicInfo.Viewport.Width - 315, 15), Color.White, Matrix.Identity);
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:12,代码来源:TemplateForwardScreen.cs

示例5: Draw

        public override void Draw(Texture2D ImageToProcess, RenderHelper rHelper, GameTime gt, Engine.GraphicInfo GraphicInfo, IWorld world, bool useFloatingBuffer)
        {
            if (changeColors)
            {
                rHelper.PushRenderTarget(target);                

                toon.Parameters["ColorMap"].SetValue(ImageToProcess);
                toon.Parameters["useLight"].SetValue(useLight);
                toon.Parameters["TexColor"].SetValue(rHelper[PrincipalConstants.colorRT]);
                toon.Parameters["CelMap"].SetValue(cell);
                toon.Parameters["LightMap"].SetValue(rHelper[PrincipalConstants.lightRt]);
                toon.Parameters["halfPixel"].SetValue(GraphicInfo.HalfPixel);
                if (useFloatingBuffer)
                    rHelper.RenderFullScreenQuadVertexPixel(toon, SamplerState.PointClamp);
                else
                    rHelper.RenderFullScreenQuadVertexPixel(toon, GraphicInfo.SamplerState);              

                ImageToProcess = rHelper.PopRenderTargetAsSingleRenderTarget2D();
            }

                line.Parameters["Thickness"].SetValue(1.0f);
                line.Parameters["Threshold"].SetValue(0.2f);                
                if (useFloatingBuffer)
                    rHelper.RenderTextureToFullScreenSpriteBatch(ImageToProcess, line, GraphicInfo.FullScreenRectangle, SamplerState.PointClamp);
            else
                    rHelper.RenderTextureToFullScreenSpriteBatch(ImageToProcess, line, GraphicInfo.FullScreenRectangle, GraphicInfo.SamplerState);
            
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:28,代码来源:ToonPostEffect.cs

示例6: Draw

 public override void Draw(Texture2D ImageToProcess, RenderHelper rHelper, GameTime gt, Engine.GraphicInfo GraphicInfo, IWorld world, bool useFloatingBuffer)
 {        
     if(useFloatingBuffer)
         rHelper.RenderTextureToFullScreenSpriteBatch(ImageToProcess, effect, GraphicInfo.FullScreenRectangle, SamplerState.PointClamp);
     else
         rHelper.RenderTextureToFullScreenSpriteBatch(ImageToProcess, effect, GraphicInfo.FullScreenRectangle, GraphicInfo.SamplerState);            
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:7,代码来源:BlackWhitePostEffect.cs

示例7: PreDrawScene

 public void PreDrawScene(GameTime gameTime, IWorld world, RenderHelper render, GraphicInfo ginfo,List<IObject> objs)
 {
     foreach (IObject item in objs)
     {
         item.Material.PreDrawnPhase(gameTime,world, item,world.CameraManager.ActiveCamera, world.Lights, render);
     }
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:7,代码来源:LightPrePassGBuffer.cs

示例8: 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

示例9: Draw

        /// <summary>
        /// This is called when the screen should draw itself.
        /// </summary>
        /// <param name="gameTime"></param>
        /// <param name="render"></param>
        protected override void Draw(GameTime gameTime, RenderHelper render)
        {
            base.Draw(gameTime, render);

            ///Draw some text on the screen
            render.RenderTextComplete("Demo: Basic Screen Forward (Move the camera using WASD and Mouse)", new Vector2(10, 15), Color.Red, Matrix.Identity);
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:12,代码来源:TemplateForwardScreen.cs

示例10: 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

示例11: Draw

        protected override void Draw(GameTime gt, IObject obj, RenderHelper render, ICamera cam, IList<ILight> lights)
        {
            Vector3 dir = cam.Target - cam.Position;
            dir.Normalize();
            _shader.Parameters["forward"].SetValue(dir);
            _shader.Parameters["camUp"].SetValue(cam.Up);
            _shader.Parameters["scaleX"].SetValue(scale.X);
            _shader.Parameters["scaleY"].SetValue(scale.Y);
            _shader.Parameters["xWorld"].SetValue(obj.PhysicObject.WorldMatrix);
            _shader.Parameters["xView"].SetValue(cam.View);
            _shader.Parameters["xProjection"].SetValue(cam.Projection);                        
            //_shader.Parameters["xBillboardTexture"].SetValue(obj.Modelo.getTexture(TextureType.DIFFUSE,0,0));
            render.Textures[0] = obj.Modelo.getTexture(TextureType.DIFFUSE, 0, 0);
            _shader.Parameters["atenuation"].SetValue(atenuation);

            render.PushRasterizerState(RasterizerState.CullNone);

            BatchInformation batchInfo = obj.Modelo.GetBatchInformation(0)[0];            
            {
                _shader.Parameters["alphaTest"].SetValue(alphaTestLimit);
                render.RenderBatch(batchInfo, _shader);
            }

            render.PopRasterizerState();
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:25,代码来源:DeferredSphericalBilboardShader.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)
        {            
            //mix with last frame downsampled
            if (tex != null)
            {
                rHelper.PushRenderTarget(rtend);
                rHelper.RenderTextureComplete(tex, Color.FromNonPremultiplied(255, 255, 255, 255), GraphicInfo.FullScreenRectangle, Matrix.Identity, null, true, SpriteSortMode.Deferred, SamplerState.LinearClamp);
                rHelper.RenderTextureComplete(ImageToProcess, Color.FromNonPremultiplied(255, 255, 255, Amount), GraphicInfo.FullScreenRectangle, Matrix.Identity, null, true, SpriteSortMode.Deferred, SamplerState.LinearClamp, BlendState.AlphaBlend);                
                end = rHelper.PopRenderTargetAsSingleRenderTarget2D();
            }            

            //DownSample
            rHelper.PushRenderTarget(rt);
            rHelper.Clear(Color.Black);
            if (end == null)
            {
                rHelper.RenderTextureComplete(ImageToProcess, Color.White, rt.Bounds, Matrix.Identity, ImageToProcess.Bounds, true, SpriteSortMode.Deferred, SamplerState.AnisotropicClamp);
            }
            else
            {
                rHelper.RenderTextureComplete(end, Color.White, rt.Bounds, Matrix.Identity, ImageToProcess.Bounds, true, SpriteSortMode.Deferred, SamplerState.AnisotropicClamp);
            }
            tex = rHelper.PopRenderTargetAsSingleRenderTarget2D();                        

            if(end!=null)
                rHelper.RenderTextureComplete(end, Color.White, GraphicInfo.FullScreenRectangle, Matrix.Identity, null, true, SpriteSortMode.Deferred, SamplerState.LinearClamp);
            else
                rHelper.RenderTextureComplete(ImageToProcess, Color.White, GraphicInfo.FullScreenRectangle, Matrix.Identity, null, true, SpriteSortMode.Deferred, SamplerState.LinearClamp);
             
        }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:30,代码来源:MotionBlurPostEffect.cs

示例13: Init

 /// <summary>
 /// Function to initialise the particle system. Has to be called before the first call to RenderFrame.
 /// </summary>
 /// <param name="settings">Particle system settings</param>
 /// <param name="context">Particle system context</param>
 public void Init(Context context, RenderHelper renderHelper)
 {
     Particles = new List<Particle>();
     Context = context;
     RenderHelper = renderHelper;
     Initialise();
 }
开发者ID:RaphaelaHeil,项目名称:ParticleSystems,代码行数:12,代码来源:ParticleSystem.cs

示例14: rt_RenderBackGround

 void rt_RenderBackGround(GraphicInfo ginfo,RenderHelper render)
 {
     Rectangle source = new Rectangle(0, 0, ginfo.Viewport.Width, ginfo.Viewport.Height);
     render.RenderBegin(Matrix.Identity, null, SpriteSortMode.Deferred, SamplerState.LinearWrap, BlendState.Opaque, RasterizerState.CullNone,DepthStencilState.Default);
     render.RenderTexture(tile, Vector2.Zero, source, Color.White, 0, Vector2.Zero, 1.0f, SpriteEffects.None, 1.0f);
     render.RenderEnd();            
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:7,代码来源:Basic2DNeoforce.cs

示例15: DownColorTexture

 /// <summary>
 /// DownSample a Color Texture (using hardware Linear filtering, cant be used on Single/float Textures)
 /// </summary>
 /// <param name="render">The render.</param>
 /// <param name="Texture2D">The texture2 D.</param>
 /// <param name="SamplerState">State of the sampler.</param>
 /// <returns></returns>
 public Texture2D DownColorTexture(RenderHelper render, Texture2D Texture2D, SamplerState SamplerState)
 {
     render.PushRenderTarget(RenderTarget2D);
     render.RenderTextureComplete(Texture2D, Color.White,
         Rectangle, Matrix.Identity, Texture2D.Bounds,
         true, SpriteSortMode.Deferred, SamplerState);
     return render.PopRenderTargetAsSingleRenderTarget2D();
 }
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:15,代码来源:DownSampler.cs


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