本文整理汇总了C#中SiliconStudio.Xenko.Rendering.RenderContext.GetCameraFromSlot方法的典型用法代码示例。如果您正苦于以下问题:C# RenderContext.GetCameraFromSlot方法的具体用法?C# RenderContext.GetCameraFromSlot怎么用?C# RenderContext.GetCameraFromSlot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SiliconStudio.Xenko.Rendering.RenderContext
的用法示例。
在下文中一共展示了RenderContext.GetCameraFromSlot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawCore
protected override void DrawCore(RenderContext context, RenderFrame output)
{
// Early exit if some properties are null
if (Mode == null)
{
return;
}
// Gets the current camera state from the slot
var camera = context.GetCameraFromSlot(Camera);
// Draw this camera.
using (context.PushTagAndRestore(Current, this))
using (context.PushTagAndRestore(CameraComponentRenderer.Current, camera))
{
// Run all pre-renderers
foreach (var renderer in PreRenderers)
{
renderer.Draw(context);
}
// Draw the scene based on its drawing mode (e.g. implementation forward or deferred... etc.)
Mode.Draw(context);
// Run all post-renderers
foreach (var renderer in PostRenderers)
{
renderer.Draw(context);
}
}
}
示例2: Collect
public override void Collect(RenderContext context)
{
base.Collect(context);
// Early exit if some properties are null
if (Mode == null)
{
return;
}
// Gets the current camera state from the slot
var camera = context.GetCameraFromSlot(Camera);
//TODO camera can be null but we still push it as null... review me please.
//TODO this is needed or if we have no camera we don't render anything e.g. UI only
// Draw this camera.
using (context.PushTagAndRestore(Current, this))
using (context.PushTagAndRestore(CameraComponentRendererExtensions.Current, camera))
{
Mode.Collect(context);
}
}