本文整理汇总了C#中Axiom.Core.Camera.NotifyRenderedFaces方法的典型用法代码示例。如果您正苦于以下问题:C# Camera.NotifyRenderedFaces方法的具体用法?C# Camera.NotifyRenderedFaces怎么用?C# Camera.NotifyRenderedFaces使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Axiom.Core.Camera
的用法示例。
在下文中一共展示了Camera.NotifyRenderedFaces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderScene
//.........这里部分代码省略.........
this.targetRenderSystem.AmbientLight = this.ambientColor;
// Tell params about render target
this.autoParamDataSource.RenderTarget = viewport.Target;
// set fog params
float fogScale = 1f;
if ( this.fogMode == FogMode.None )
{
fogScale = 0f;
}
this.autoParamDataSource.FogParams = new Vector4( this.fogStart, this.fogEnd, fogScale, 0 );
// set the time in the auto param data source
//autoParamDataSource.Time = ((float)Root.Instance.Timer.Milliseconds) / 1000f;
// Set camera window clipping planes (if any)
if ( this.targetRenderSystem.Capabilities.HasCapability( Capabilities.UserClipPlanes ) )
{
// TODO: Add ClipPlanes to RenderSystem.cs
if ( camera.IsWindowSet )
{
targetRenderSystem.ResetClipPlanes();
IList<Plane> planeList = camera.WindowPlanes;
for ( ushort i = 0; i < 4; ++i )
{
targetRenderSystem.AddClipPlane( planeList[ i ] );
//this.targetRenderSystem.EnableClipPlane( i, true );
//this.targetRenderSystem.SetClipPlane( i, planeList[ i ] );
}
}
// this disables any user-set clipplanes... this should be done manually
//else
//{
// for (ushort i = 0; i < 4; ++i)
// {
// targetRenderSystem.EnableClipPlane(i, false);
// }
//}
}
// Prepare render queue for receiving new objects
this.PrepareRenderQueue();
// Parse the scene and tag visibles
if ( this.findVisibleObjects )
{
if ( this.PreFindVisibleObjects != null )
PreFindVisibleObjects( this, this.illuminationStage, viewport );
this.FindVisibleObjects( camera, this.illuminationStage == IlluminationRenderStage.RenderToTexture );
if ( this.PostFindVisibleObjects != null )
PostFindVisibleObjects( this, this.illuminationStage, viewport );
}
// Add overlays, if viewport deems it
if ( viewport.ShowOverlays && this.illuminationStage != IlluminationRenderStage.RenderToTexture )
{
// Queue overlays for rendering
OverlayManager.Instance.QueueOverlaysForRendering( camera, this.GetRenderQueue(), viewport );
}
// queue overlays and skyboxes for rendering
if ( viewport.ShowSkies && this.findVisibleObjects &&
this.illuminationStage != IlluminationRenderStage.RenderToTexture )
{
this.QueueSkiesForRendering( camera );
}
// begin frame geometry count
this.targetRenderSystem.BeginGeometryCount();
// clear the device if need be
if ( viewport.ClearEveryFrame )
{
this.targetRenderSystem.ClearFrameBuffer( viewport.ClearBuffers, viewport.BackgroundColor );
}
// being a frame of animation
this.targetRenderSystem.BeginFrame();
// use the camera's current scene detail level
this.targetRenderSystem.PolygonMode = camera.PolygonMode;
// Set initial camera state
this.targetRenderSystem.ProjectionMatrix = camera.ProjectionMatrixRS;
this.targetRenderSystem.ViewMatrix = camera.ViewMatrix;
// render all visible objects
this.RenderVisibleObjects();
// end the current frame
this.targetRenderSystem.EndFrame();
// Notify camera of the number of rendered faces
camera.NotifyRenderedFaces( this.targetRenderSystem.FaceCount );
// Notify camera of the number of rendered batches
camera.NotifyRenderedBatches( this.targetRenderSystem.BatchCount );
}
示例2: RenderScene
//.........这里部分代码省略.........
autoParamDataSource.AmbientLight = ambientColor;
// Tell rendersystem
targetRenderSystem.AmbientLight = ambientColor;
// Tell params about render target
autoParamDataSource.RenderTarget = viewport.Target;
// set fog params
float fogScale = 1f;
if (fogMode == FogMode.None)
{
fogScale = 0f;
}
autoParamDataSource.FogParams = new Vector4(fogStart, fogEnd, fogScale, 0);
// set the time in the auto param data source
// autoParamDataSource.Time = ((float)Root.Instance.Timer.Milliseconds) / 1000f;
// Set camera window clipping planes (if any)
if (targetRenderSystem.Caps.CheckCap(Capabilities.UserClipPlanes)) {
// TODO: Add ClipPlanes to RenderSystem.cs
/*
if (camera.IsWindowSet)
{
PlaneList planeList = camera.WindowPlanes;
for (ushort i = 0; i < 4; ++i)
{
targetRenderSystem.EnableClipPlane(i, true);
targetRenderSystem.SetClipPlane(i, planeList[i]);
}
}
else
{
for (ushort i = 0; i < 4; ++i)
{
targetRenderSystem.EnableClipPlane(i, false);
}
}
*/
}
// Prepare render queue for receiving new objects
PrepareRenderQueue();
// Parse the scene and tag visibles
if (findVisibleObjects) {
VisibleObjectsBoundsInfo bounds;
if (!camVisibleObjectsMap.TryGetValue(camera, out bounds))
Debug.Assert(false, "Should never fail to find a visible object bound for a camera, " +
"did you override SceneManager.CreateCamera or something?");
else {
bounds.Reset();
findVisibleMeter.Enter();
FindVisibleObjects(camera, bounds, illuminationStage == IlluminationRenderStage.RenderToTexture);
findVisibleMeter.Exit();
autoParamDataSource.MainCamBoundsInfo = bounds;
}
}
// Add overlays, if viewport deems it
if(viewport.OverlaysEnabled && illuminationStage != IlluminationRenderStage.RenderToTexture) {
// Queue overlays for rendering
OverlayManager.Instance.QueueOverlaysForRendering(camera, GetRenderQueue(), viewport);
}
// queue overlays and skyboxes for rendering
if (viewport.SkiesEnabled && findVisibleObjects &&
illuminationStage != IlluminationRenderStage.RenderToTexture)
QueueSkiesForRendering(camera);
// begin frame geometry count
targetRenderSystem.BeginGeometryCount();
// Clear the viewport if required
if (currentViewport.ClearEveryFrame)
targetRenderSystem.ClearFrameBuffer(currentViewport.ClearBuffers, currentViewport.BackgroundColor);
// being a frame of animation
targetRenderSystem.BeginFrame();
// use the camera's current scene detail level
targetRenderSystem.RasterizationMode = camera.SceneDetail;
// Set initial camera state
targetRenderSystem.ProjectionMatrix = camera.ProjectionMatrixRS;
targetRenderSystem.ViewMatrix = camera.ViewMatrix;
// render all visible objects
renderVisibleMeter.Enter();
RenderVisibleObjects();
renderVisibleMeter.Exit();
// end the current frame
targetRenderSystem.EndFrame();
// Notify camera of the number of rendered faces
camera.NotifyRenderedFaces(targetRenderSystem.FacesRendered);
renderSceneMeter.Exit();
}