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


C# RenderHelper.RenderTexture方法代码示例

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


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

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

示例2: Draw


//.........这里部分代码省略.........

                    forwardPass.Draw(gameTime, world, render,DeferrednotCulledObjectsList,ForwardnotCulledObjectsList);

                    render.DettachBindedTextures(6);
                    render.ValidateSamplerStates();

                    render.RenderPosWithDepthComponents(gameTime, ref view, ref projection);

                    render.DettachBindedTextures(6);
                    render.ValidateSamplerStates();

                    render[PrincipalConstants.CurrentImage] = restoreDepth.EndForwardPass(render);
                    render[PrincipalConstants.CombinedImage] = render[PrincipalConstants.CurrentImage];

                    for (int i = 0; i < PostEffects.Count; i++)
                    {
                        if (PostEffects[i].Enabled)
                        {
                            render.PushRenderTarget(PostEffectTarget);
                            render.Clear(Color.Black);
                            PostEffects[i].Draw(render[PrincipalConstants.CurrentImage], render, gameTime, ginfo, world, desc.UseFloatingBufferForLightMap);
                            Texture2D tex = render.PopRenderTarget()[0].RenderTarget as Texture2D;
                            render[PrincipalConstants.CurrentImage] = tex;
                            SwapTargetBuffers();                            
                        }
                    }

                    render.SetSamplerStates(ginfo.SamplerState);
                    render.DettachBindedTextures(6);
                                        
                    if (desc.UseFloatingBufferForLightMap)
                    {                        
                        render.Clear(Color.Black);
                        render.RenderTextureComplete(render[PrincipalConstants.CurrentImage], Color.White, ginfo.FullScreenRectangle, Matrix.Identity, null, true, SpriteSortMode.Deferred, SamplerState.PointClamp);                     
                    }
                    else
                    {                        
                        render.Clear(Color.Black);                        
                        render.RenderTextureComplete(render[PrincipalConstants.CurrentImage], Color.White, ginfo.FullScreenRectangle, Matrix.Identity,null,true,SpriteSortMode.Deferred,ginfo.SamplerState);                    
                    }                    
                }
                else if (desc.RestoreDepthOption == RestoreDepthOption.AFTER_POSTEFFECT)
                {                    
                    for (int i = 0; i < PostEffects.Count; i++)
                    {
                        if (PostEffects[i].Enabled)
                        {
                            render.PushRenderTarget(PostEffectTarget);
                            render.Clear(Color.Black);
                            PostEffects[i].Draw(render[PrincipalConstants.CurrentImage], render, gameTime, ginfo, world, desc.UseFloatingBufferForLightMap);
                            Texture2D tex = render.PopRenderTarget()[0].RenderTarget as Texture2D;
                            render[PrincipalConstants.CurrentImage] = tex;
                            SwapTargetBuffers();
                        }
                    }

                    render.SetSamplerStates(ginfo.SamplerState);
                    render.DettachBindedTextures(16);

                    restoreDepth.PerformForwardPass(render[PrincipalConstants.CurrentImage], render[PrincipalConstants.DephRT], render, ginfo);

                    render.DettachBindedTextures(2);

                    if (world.PhysicWorld.isDebugDraw)
                    {
                        world.PhysicWorld.iDebugDrawn(render, gameTime, world.CameraManager.ActiveCamera);
开发者ID:brunoduartec,项目名称:port-ploobsengine,代码行数:67,代码来源:DeferredRenderTechnic.cs


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