本文整理汇总了C#中IContentManager.GetAsset方法的典型用法代码示例。如果您正苦于以下问题:C# IContentManager.GetAsset方法的具体用法?C# IContentManager.GetAsset怎么用?C# IContentManager.GetAsset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IContentManager
的用法示例。
在下文中一共展示了IContentManager.GetAsset方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadContent
/// <summary>
/// Load graphics content for the screen.
/// </summary>
/// <param name="GraphicInfo"></param>
/// <param name="factory"></param>
/// <param name="contentManager"></param>
protected override void LoadContent(Engine.GraphicInfo GraphicInfo, Engine.GraphicFactory factory, IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
videoPlayer = new VideoPlayer();
myVideoFile = contentManager.GetAsset<Video>(location);
videoPlayer.IsLooped = false;
}
示例2: RestoreDepth
//EffectParameter Depth;
//EffectParameter Color;
/// <summary>
/// Initializes a new instance of the <see cref="RestoreDepth"/> class.
/// </summary>
/// <param name="useFloatBuffer">if set to <c>true</c> [use float buffer].</param>
/// <param name="manager">The manager.</param>
/// <param name="factory">The factory.</param>
/// <param name="ginfo">The ginfo.</param>
public RestoreDepth(bool useFloatBuffer,IContentManager manager,GraphicFactory factory, GraphicInfo ginfo)
{
this.usefloatBuffer = useFloatBuffer;
this.restore = manager.GetAsset<Effect>("RestoreDepth",true);
this.restore.Parameters["halfPixel"].SetValue(ginfo.HalfPixel);
//Depth = restore.Parameters["DepthTexture"];
//Color = restore.Parameters["ColorTexture"];
if (useFloatBuffer)
target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.HdrBlendable, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
else
target = factory.CreateRenderTarget(ginfo.BackBufferWidth, ginfo.BackBufferHeight, SurfaceFormat.Color, ginfo.UseMipMap, DepthFormat.Depth24Stencil8, ginfo.MultiSample, RenderTargetUsage.DiscardContents);
}
示例3: 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);
}
}
示例4: 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");
}
示例5: 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");
}
示例6: LoadContent
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
{
mouseT = contentManager.GetAsset<Texture2D>("Images//mouse//defualt");
base.LoadContent(GraphicInfo, factory, contentManager);
}
示例7: 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());
}
示例8: 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,
};
}