本文整理汇总了C#中RenderTarget.AddViewport方法的典型用法代码示例。如果您正苦于以下问题:C# RenderTarget.AddViewport方法的具体用法?C# RenderTarget.AddViewport怎么用?C# RenderTarget.AddViewport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderTarget
的用法示例。
在下文中一共展示了RenderTarget.AddViewport方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateScene
public override void CreateScene()
{
TexturePtr mTexture = TextureManager.Singleton.CreateManual("RenderArea",
ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME, TextureType.TEX_TYPE_2D,
512, 512, 0, PixelFormat.PF_R8G8B8, (int)TextureUsage.TU_RENDERTARGET);
rttTex = mTexture.GetBuffer().GetRenderTarget();
rttTex.IsAutoUpdated = false;
{
// Create the camera
Camera camera2 = sceneMgr.CreateCamera("PlayerCam2");
camera2.Position = new Vector3(0, 0, 3);
camera2.LookAt(new Vector3(0.0f, 0.0f, 0.0f));
camera2.NearClipDistance = 1;
Viewport v = rttTex.AddViewport(camera2);
MaterialPtr mat = MaterialManager.Singleton.GetByName("CgTutorials/RenderToTexture_Material");
mat.GetTechnique(0).GetPass(0).GetTextureUnitState(0).SetTextureName("RenderArea");
v.BackgroundColour = new ColourValue(0.0f, 0.3f, 0.2f, 0.0f);
//v.SetClearEveryFrame(false);
//v.OverlaysEnabled = false;
rttTex.PreRenderTargetUpdate += new RenderTargetListener.PreRenderTargetUpdateHandler(RenderArea_PreRenderTargetUpdate);
rttTex.PostRenderTargetUpdate += new RenderTargetListener.PostRenderTargetUpdateHandler(RenderArea_PostRenderTargetUpdate);
}
node1 = base.sceneMgr.RootSceneNode.CreateChildSceneNode("TutorialRender2TexNode1");
node2 = base.sceneMgr.RootSceneNode.CreateChildSceneNode("TutorialRender2TexNode2");
manualObj1 = sceneMgr.CreateManualObject("TutorialRender2TexObject1");
manualObj2 = sceneMgr.CreateManualObject("TutorialRender2TexObject2");
node1.AttachObject(DrawTriangle1(manualObj1));
node2.AttachObject(DrawTriangle2(manualObj2));
}