本文整理汇总了C#中Engine.CreateRenderTarget方法的典型用法代码示例。如果您正苦于以下问题:C# Engine.CreateRenderTarget方法的具体用法?C# Engine.CreateRenderTarget怎么用?C# Engine.CreateRenderTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine
的用法示例。
在下文中一共展示了Engine.CreateRenderTarget方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
{
target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight);
target2 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight);
effect = factory.GetEffect("glowPost",false,true);
gbp = new GaussianBlurPostEffect();
gbp.Init(ginfo, factory);
}
示例2: Init
public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
{
this.toon = factory.GetEffect("toon1",false,true);
this.line = factory.GetEffect("LineDetection",false,true);
this.cell = factory.GetTexture2D("Toon",true);
target = factory.CreateRenderTarget(ginfo.BackBufferWidth,ginfo.BackBufferHeight,SurfaceFormat.Color,ginfo.UseMipMap,DepthFormat.None,ginfo.MultiSample);
}
示例3: Init
public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
{
depht = factory.GetEffect("depth",false,true);
target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight,SurfaceFormat.Color,
ginfo.UseMipMap,DepthFormat.None,ginfo.MultiSample);
be= new GaussianBlurPostEffect();
be.Init(ginfo, factory);
}
示例4: LoadContent
public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, bool cullPointLight, bool useFloatingBufferForLightning)
{
_lightAddBlendState = new BlendState()
{
AlphaSourceBlend = Blend.One,
ColorSourceBlend = Blend.One,
AlphaDestinationBlend = Blend.One,
ColorDestinationBlend = Blend.One,
};
this.ginfo = ginfo;
shadow = new DirectionalShadowRenderer();
shadow.ShadowFilteringType = filteringType;
shadow.ShadowMapSize = shadowMapSize;
shadow.SplitConstant = splitConstant;
shadownBufferSize = ginfo.BackBufferWidth;
shadowRT = factory.CreateRenderTarget(shadownBufferSize, shadownBufferSize, SurfaceFormat.Single, ginfo.UseMipMap,DepthFormat.Depth24Stencil8,ginfo.MultiSample);
if (useFloatingBufferForLightning)
lightRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.PreserveContents);
else
lightRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.PreserveContents);
pointLightEffect = factory.GetEffect("PointLight",false,true);
directionalLightEffect = factory.GetEffect("ShadowDirectionalCascade",false,true);
spotLightEffect = factory.GetEffect("ShadowSpot",false,true);
sphereModel = new SimpleModel(factory, "Dsphere", true);
blank = factory.CreateTexture2DColor(1, 1, Color.White);
rt = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight,SurfaceFormat.Color,ginfo.UseMipMap,DepthFormat.Depth24Stencil8,ginfo.MultiSample);
deferredRT = factory.CreateRenderTarget(shadownBufferSize, shadownBufferSize, SurfaceFormat.Single,ginfo.UseMipMap, DepthFormat.Depth24Stencil8, ginfo.MultiSample);
shadow.Load(factory,ginfo);
switch (shadowFilterSpot)
{
case ShadowFilter.NONE:
spotLightEffect.CurrentTechnique = spotLightEffect.Techniques["Technique1"];
break;
case ShadowFilter.PCF3x3:
spotLightEffect.CurrentTechnique = spotLightEffect.Techniques["Technique2"];
break;
case ShadowFilter.PCF7x7SOFT:
spotLightEffect.CurrentTechnique = spotLightEffect.Techniques["Technique3"];
break;
default:
break;
}
}
示例5: LoadContent
//EffectParameter PcolorMap;
//EffectParameter PlightMap;
#endregion
#region IDeferredFinalCombination Members
public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, bool useFloatBuffer, bool saveToTexture )
{
this.useFloatBuffer = useFloatBuffer;
this.ginfo = ginfo;
this.saveToTexture = saveToTexture;
finalCombineEffect = manager.GetAsset<Effect>("CombineFinal",true);
PhalfPixel = finalCombineEffect.Parameters["halfPixel"];
PambientColor = finalCombineEffect.Parameters["ambientColor"];
//PEXTRA1 = finalCombineEffect.Parameters["EXTRA1"];
//PcolorMap = finalCombineEffect.Parameters["colorMap"];
//PlightMap = finalCombineEffect.Parameters["lightMap"];
PhalfPixel.SetValue(ginfo.HalfPixel);
if (saveToTexture)
{
if (useFloatBuffer)
target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
else
target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
}
}
示例6: Init
public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
{
target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);
target2 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);
target3 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);
effect = factory.GetEffect("SSAOPOST", false, true);
ssaofinal = factory.GetEffect("ssaofinal", false, true);
RandomTexture = factory.GetTexture2D("random", true);
gbp = new GaussianBlurPostEffect();
gbp.Init(ginfo, factory);
}
示例7: Init
public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
{
Saturate = factory.GetEffect("Saturate",false,true);
Saturate.Parameters["BloomThreshold"].SetValue(bloomThreshold);
Combine = factory.GetEffect("Combine",false,true);
renderTarget0 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight,SurfaceFormat.Color,ginfo.UseMipMap,DepthFormat.None,ginfo.MultiSample);
renderTarget1 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);
gaussian = new GaussianBlurPostEffect();
gaussian.Init(ginfo,factory);
}
示例8: LoadContent
public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, Color BackGroundColor,bool useFloatBuffer)
{
this.useFloatBuffer = useFloatBuffer;
normalRT = factory.CreateRenderTarget(ginfo.BackBufferWidth , ginfo.BackBufferHeight, SurfaceFormat.Color, false, DepthFormat.Depth24, 0, RenderTargetUsage.DiscardContents);
depthRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Single, false, DepthFormat.Depth24, 0, RenderTargetUsage.DiscardContents);
//lightOclusionRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, multisample, RenderTargetUsage.DiscardContents);
clearBufferEffect = manager.GetAsset<Effect>("PrePass2/ClearGBuffer");
}
示例9: LoadContent
public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, Color BackGroundColor, bool useFloatBuffer)
{
this.backGroundColor = BackGroundColor;
colorRT2 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, 8, RenderTargetUsage.DiscardContents);
colorRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, 0, RenderTargetUsage.DiscardContents);
normalRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);
depthRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Single, ginfo.UseMipMap, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);
lightOclusionRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, 0, RenderTargetUsage.DiscardContents);
clearBufferEffect = manager.GetAsset<Effect>("ClearGBuffer",true);
effect = factory.GetEffect("Effects//hibe");
}
示例10: Init
public override void Init(Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
{
gblur = factory.GetEffect("gblur",true,true);
if (useHalfSingleRenderTarget)
{
target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Single, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);
}
else
{
target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample);
}
Vector2 texelSize = new Vector2(1f / ginfo.BackBufferWidth, 1f / ginfo.BackBufferHeight);
SetBlurParameters(texelSize.X, 0, ref sampleOffsetsH, ref sampleWeightsH);
SetBlurParameters(0, texelSize.Y, ref sampleOffsetsV, ref sampleWeightsV);
}
示例11: LoadContent
public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, Color BackGroundColor,bool useFloatBuffer)
{
this.useFloatBuffer = useFloatBuffer;
this.backGroundColor = BackGroundColor;
const int multisample = 0;
colorRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, multisample, RenderTargetUsage.DiscardContents);
normalRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, multisample, RenderTargetUsage.DiscardContents);
depthRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Single, ginfo.UseMipMap, DepthFormat.None, multisample, RenderTargetUsage.DiscardContents);
lightOclusionRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, multisample, RenderTargetUsage.DiscardContents);
clearBufferEffect = manager.GetAsset<Effect>("ClearGBuffer",true);
clearBufferEffect.Parameters["BackColor"].SetValue(backGroundColor.ToVector3());
}
示例12: AfterLoadContent
protected override void AfterLoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory)
{
this.ginfo = ginfo;
{
if (ginfo.CheckIfRenderTargetFormatIsSupported(SurfaceFormat.HdrBlendable, DepthFormat.Depth24Stencil8, ginfo.UseMipMap, ginfo.MultiSample) == false)
{
throw new NotSupportedException("The plataform does not support the specified Render target Combination for Deferred Rendering, check the logs for more info");
}
}
if (ginfo.CheckIfRenderTargetFormatIsSupported(SurfaceFormat.Color, DepthFormat.Depth24Stencil8, ginfo.UseMipMap, ginfo.MultiSample) == false)
{
throw new NotSupportedException("The plataform does not support the specified Render target Combination for Deferred Rendering, check the logs for more info");
}
if (ginfo.CheckIfRenderTargetFormatIsSupported(SurfaceFormat.Single, DepthFormat.Depth24Stencil8, false, 0) == false)
{
throw new NotSupportedException("The plataform does not support the specified Render target Combination for Deferred Rendering, check the logs for more info");
}
if (ginfo.CheckIfRenderTargetFormatIsSupported(SurfaceFormat.Single, DepthFormat.Depth24Stencil8, ginfo.UseMipMap, ginfo.MultiSample) == false)
{
ActiveLogger.LogMessage("Shadow can behave strange, you dont have the minimum requirements", LogLevel.Warning);
}
deferredGBuffer.LoadContent(manager, ginfo, factory, desc.BackGroundColor, true);
deferredLightMap.LoadContent(manager, ginfo, factory, desc.CullPointLight,true);
target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, ginfo.MultiSample);
target2 = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, ginfo.MultiSample);
scenerender = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, ginfo.MultiSample);
PostEffectTarget = target;
halfWidth = ginfo.Viewport.Width / 2;
halfHeight = ginfo.Viewport.Height / 2;
}
示例13: LoadContent
public void LoadContent(IContentManager manager, Engine.GraphicInfo ginfo, Engine.GraphicFactory factory, bool cullPointLight, bool useFloatingBufferForLightning)
{
this.ginfo = ginfo;
this.cullPointLight = cullPointLight;
if (useFloatingBufferForLightning)
{
lightRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
samplerState = SamplerState.PointClamp;
}
else
{
lightRT = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.None, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
samplerState = ginfo.SamplerState;
}
directionalLightEffect = manager.GetAsset<Effect>("PrePass2/DirectionalLight");
pointLightEffect = manager.GetAsset<Effect>("PrePass2/PointLight");
sphereModel = new SimpleModel(factory, "Models/Dsphere");
spotLightEffect = manager.GetAsset<Effect>("PrePass2/SpotLight");
spotLightEffect.Parameters["halfPixel"].SetValue(ginfo.HalfPixel);
pointLightEffect.Parameters["halfPixel"].SetValue(ginfo.HalfPixel);
DirectionalhalfPixel = directionalLightEffect.Parameters["halfPixel"];
DirectionallightDirection = directionalLightEffect.Parameters["lightDirection"];
DirectionalColor = directionalLightEffect.Parameters["Color"];
DirectionallightIntensity = directionalLightEffect.Parameters["lightIntensity"];
PointWordViewProjection = pointLightEffect.Parameters["wvp"];
PointlightPosition = pointLightEffect.Parameters["lightPosition"];
PointColor = pointLightEffect.Parameters["Color"];
PointlightRadius = pointLightEffect.Parameters["lightRadius"];
PointlightIntensity = pointLightEffect.Parameters["lightIntensity"];
Pointquadratic = pointLightEffect.Parameters["quadratic"];
PointcameraPosition = pointLightEffect.Parameters["cameraPosition"];
_lightAddBlendState = new BlendState()
{
AlphaSourceBlend = Blend.One,
ColorSourceBlend = Blend.One,
AlphaDestinationBlend = Blend.One,
ColorDestinationBlend = Blend.One,
};
}