本文整理汇总了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();
}
示例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);