本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例10: ClearGBuffer
public void ClearGBuffer(RenderHelper render)
{
render.PushDepthStencilState(DepthStencilState.None);
clearBufferEffect.Parameters["BackColor"].SetValue(backGroundColor.ToVector3());
render.RenderFullScreenQuadVertexPixel(clearBufferEffect);
render.PopDepthStencilState();
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}