/// <summary>
        /// Returns whether or not the named queue will be rendered based on the
        /// current 'special case' render queue list and mode.
        /// </summary>
        /// <param name="queueId">The identifier of the queue which should be tested</param>
        /// <returns>true if the queue will be rendered, false otherwise</returns>
        public virtual bool IsRenderQueueToBeProcessed(RenderQueueGroupID queueId)
        {
            var inList = this._queue.Contains(queueId);

            return((inList && this._mode == SpecialCaseRenderQueueMode.Include) ||
                   (!inList && this._mode == SpecialCaseRenderQueueMode.Exclude));
        }
Example #2
0
        /// <summary>
        ///		Adds a renderable item to the queue.
        /// </summary>
        /// <param name="renderable">IRenderable object to add to the queue.</param>
        /// <param name="groupID">Group to add the item to.</param>
        /// <param name="priority"></param>
        public void AddRenderable(IRenderable renderable, ushort priority, RenderQueueGroupID groupID)
        {
            var       group = GetQueueGroup(groupID);
            Technique t;

            // let the material know it has been used, which also forces a recompile if required
            if (renderable.Material != null)
            {
                renderable.Material.Touch();
            }

            // Check material & technique supplied (the former since the default implementation
            // of getTechnique is based on it for backwards compatibility
            if (renderable.Material == null || renderable.Technique == null)
            {
                // Use default base white
                var baseWhite = (Material)MaterialManager.Instance["BaseWhite"];
                t = baseWhite.GetTechnique(0);
            }
            else
            {
                t = renderable.Technique;
            }

            // add the renderable to the appropriate group
            group.AddRenderable(renderable, t, priority);
        }
Example #3
0
 public CompositionPass(CompositionTargetPass parent)
 {
     this.parent                   = parent;
     this.type                     = CompositorPassType.RenderQuad;
     this.identifier               = 0;
     this.firstRenderQueue         = RenderQueueGroupID.Background;
     this.lastRenderQueue          = RenderQueueGroupID.SkiesLate;
     this.materialSchemeName       = string.Empty;
     this.clearBuffers             = FrameBufferType.Color | FrameBufferType.Depth;
     this.clearColor               = new ColorEx(0f, 0f, 0f, 0f);
     this.clearDepth               = 1.0f;
     this.clearStencil             = 0;
     this.stencilCheck             = false;
     this.stencilFunc              = CompareFunction.AlwaysPass;
     this.stencilRefValue          = 0;
     this.stencilMask              = 0x7FFFFFFF;
     this.stencilFailOp            = StencilOperation.Keep;
     this.stencilDepthFailOp       = StencilOperation.Keep;
     this.stencilPassOp            = StencilOperation.Keep;
     this.stencilTwoSidedOperation = false;
     this.quadCornerModified       = false;
     this.quadLeft                 = -1;
     this.quadTop                  = 1;
     this.quadRight                = 1;
     this.quadBottom               = -1;
     this.quadFarCorners           = false;
     this.quadFarCornersViewSpace  = false;
 }
Example #4
0
        /// <summary>
        ///    Internal method to put the overlay contents onto the render queue.
        /// </summary>
        /// <param name="camera">Current camera being used in the render loop.</param>
        /// <param name="queue">Current render queue.</param>
        public void FindVisibleObjects(Camera camera, RenderQueue queue)
        {
            if (!isVisible)
            {
                return;
            }

            // add 3d elements
            rootNode.Position    = camera.DerivedPosition;
            rootNode.Orientation = camera.DerivedOrientation;
            rootNode.Update(true, false);

            // set up the default queue group for the objects about to be added
            RenderQueueGroupID oldGroupID = queue.DefaultRenderGroup;

            queue.DefaultRenderGroup = RenderQueueGroupID.Overlay;
            rootNode.FindVisibleObjects(camera, queue, null, true, false);
            // reset the group
            queue.DefaultRenderGroup = oldGroupID;

            // add 2d elements
            for (int i = 0; i < elementList.Count; i++)
            {
                OverlayElementContainer container = (OverlayElementContainer)elementList[i];
                container.Update();
                container.UpdateRenderQueue(queue);
            }
        }
Example #5
0
 /// <summary>
 ///   Add children to the render queue
 /// </summary>
 /// <param name="queue"> </param>
 /// <param name="group"> </param>
 /// <param name="camSquaredDistance"> </param>
 public void AddRenderables(RenderQueue queue, RenderQueueGroupID group, float camSquaredDistance)
 {
     foreach (MaterialBucket iter in mMaterialBucketMap.Values)
     {
         iter.AddRenderables(queue, group, camSquaredDistance);
     }
 }
Example #6
0
 public void AddRenderables(RenderQueue queue, RenderQueueGroupID group, float camSquaredDistance)
 {
     // Just pass this on to child buckets
     foreach (var mbucket in this.materialBucketMap.Values)
     {
         mbucket.AddRenderables(queue, group, camSquaredDistance);
     }
 }
 //-----------------------------------------------------------------------
 protected void SetRenderQueueGroup(RenderQueueGroupID queueID)
 {
     base.RenderQueueGroup = queueID;
     if (renderer != null)
     {
         renderer.SetRenderQueueGroup(queueID);
     }
 }
Example #8
0
 /// <summary>
 ///   Add children to the render queue
 /// </summary>
 /// <param name="queue"> </param>
 /// <param name="group"> </param>
 /// <param name="camSquaredDistance"> </param>
 public void AddRenderables(RenderQueue queue, RenderQueueGroupID group, float camSquaredDistance)
 {
     // Determine the current material technique
     mTechnique = mMaterial.GetBestTechnique(mMaterial.GetLodIndex(camSquaredDistance));
     foreach (GeometryBucket iter in mGeometryBucketList)
     {
         queue.AddRenderable(iter, group);
     }
 }
 /// <summary>
 ///		Default constructor.
 /// </summary>
 public MovableObject()
 {
     isVisible = true;
     // set default RenderQueueGroupID for this movable object
     renderQueueID = RenderQueueGroupID.Main;
     queryFlags    = unchecked (0xffffffff);
     worldAABB     = AxisAlignedBox.Null;
     castShadows   = true;
 }
Example #10
0
        /// <summary>
        ///		Default constructor.
        /// </summary>
        public RenderQueue()
        {
            // set the default queue group for this queue
            this.defaultGroup = RenderQueueGroupID.Main;

            // create the main queue group up front
            this.renderGroups.Add(RenderQueueGroupID.Main,
                                  new RenderQueueGroup(this, this.splitPassesByLightingType, this.splitNoShadowPasses,
                                                       this.shadowCastersCannotBeReceivers));
        }
Example #11
0
 public static void Initization(SceneManager sceneManager)
 {
     sceneMgr = sceneManager;
     sceneMgr.RenderQueueStarted += SceneManager_RenderQueueStarted;
     sceneMgr.RenderQueueEnded   += SceneManager_RenderQueueEnded;
     TargetQueue         = RenderQueueGroupID.RENDER_QUEUE_OVERLAY;
     AfterQueue          = false;
     glRenderableObjects = new LinkedList <IOpenGLRenderable>();
     gl = new OpenGL();
 }
Example #12
0
        /// <summary>
        ///		When RenderQueue 6 is starting, we will begin the occlusion query.
        /// </summary>
        /// <param name="priority"></param>
        /// <returns></returns>
        private bool scene_QueueStarted(RenderQueueGroupID priority)
        {
            // begin the occlusion query
            if (priority == RenderQueueGroupID.Six)
            {
                query.Begin();
            }

            return(false);
        }
Example #13
0
 public static void Initialize(SceneManager sceneManager)
 {
     sceneMan    = sceneManager;
     TargetQueue = RenderQueueGroupID.Overlay;
     AfterQueue  = false;
     MinimalHardwareBufferSize = 120;
     sprites = new LinkedList <Sprite>();
     sceneMan.QueueStarted += RenderQueueStarted;
     sceneMan.QueueEnded   += RenderQueueEnded;
 }
Example #14
0
 public CompositorTargetOperation(RenderTarget target)
 {
     this.target            = target;
     currentQueueGroupID    = 0;
     renderSystemOperations = new List <QueueIDAndOperation>();
     visibilityMask         = 0xFFFFFFFF;
     lodBias            = 1.0f;
     onlyInitial        = false;
     hasBeenRendered    = false;
     findVisibleObjects = false;
 }
Example #15
0
 /// <summary>
 /// Creates a new GrassLoader object.
 /// </summary>
 /// <param name="geom">The PagedGeometry object that this GrassLoader will be assigned to.</param>
 public GrassLoader(PagedGeometry geom)
 {
     mGeom = geom;
     mHeightFunctionUserData = null;
     mWindDir       = Vector3.UnitX;
     mDensityFactor = 1.0f;
     mRenderQueue   = RenderQueueGroupID.Six;
     mWindTimer     = new MogreLib.Core.Timer();//mWindTimer = Root.Singleton.Timer;
     mWindTimer.Reset();
     mLastTime = 0;
 }
Example #16
0
 ///<summary>
 ///    Flush remaining render system operations
 ///</summary>
 public void FlushUpTo(RenderQueueGroupID id)
 {
     // Process all RenderSystemOperations up to and including render queue id.
     // Including, because the operations for RenderQueueGroup x should be executed
     // at the beginning of the RenderQueueGroup render for x.
     while (this.currentOp != this.lastOp &&
            ((int)this.operation.RenderSystemOperations[this.currentOp].QueueID < (int)id))
     {
         this.operation.RenderSystemOperations[this.currentOp].Operation.Execute(this.sceneManager, this.renderSystem);
         this.currentOp++;
     }
 }
Example #17
0
 public void AddRenderables(RenderQueue queue, RenderQueueGroupID group, float camDistanceSquared)
 {
     if (material != null)
     {
         // determine the current material technique
         technique = material.GetBestTechnique(material.GetLodIndexSquaredDepth(camDistanceSquared));
         foreach (GeometryBucket gbucket in geometryBucketList)
         {
             queue.AddRenderable(gbucket, RenderQueue.DEFAULT_PRIORITY, group);
         }
     }
 }
Example #18
0
        /// <summary>
        ///		Adds a renderable item to the queue.
        /// </summary>
        /// <param name="item">IRenderable object to add to the queue.</param>
        /// <param name="groupID">Group to add the item to.</param>
        /// <param name="priority"></param>
        public void AddRenderable(IRenderable renderable, ushort priority, RenderQueueGroupID groupID)
        {
            RenderQueueGroup group = GetQueueGroup(groupID);

            // let the material know it has been used, which also forces a recompile if required
            if (renderable.Material != null)
            {
                renderable.Material.Touch();
            }

            // add the renderable to the appropriate group
            group.AddRenderable(renderable, priority);
        }
Example #19
0
        /// <summary>
        ///		Get a render queue group.
        /// </summary>
        /// <remarks>
        ///		New queue groups are registered as they are requested,
        ///		therefore this method will always return a valid group.
        /// </remarks>
        /// <param name="queueID">ID of the queue group to retreive.</param>
        /// <returns></returns>
        public RenderQueueGroup GetQueueGroup(RenderQueueGroupID queueID)
        {
            var group = this.renderGroups[queueID] as RenderQueueGroup;

            // see if there is a current queue group for this group id
            if (group == null)
            {
                // create a new queue group for this group id
                group = new RenderQueueGroup(this, this.splitPassesByLightingType, this.splitNoShadowPasses,
                                             this.shadowCastersCannotBeReceivers);

                // add the new group to cached render group
                this.renderGroups.Add(queueID, group);
            }

            return(group);
        }
Example #20
0
        public QuickGUIRenderer()
        {
            mQueueID = RenderQueueGroupID.RENDER_QUEUE_OVERLAY;
            unsafe
            {
                mVertexBufferPtr = null;
            }
            mRenderListDirty = false;

            mRenderSystem = Root.Singleton.RenderSystem;

            mRenderOperation = new RenderOperation();

            mRenderList = new List <QuickGUIQuad>();

            mTexelOffset.x = mRenderSystem.HorizontalTexelOffset;
            mTexelOffset.y = mRenderSystem.VerticalTexelOffset;

            // Initialise blending modes to be used. We use these every frame, so we'll set them up now to save time later.

            mColorBlendMode = LayerBlendModeEx_NativePtr.Create();

            mColorBlendMode.blendType = LayerBlendType.LBT_COLOUR;
            mColorBlendMode.source1   = LayerBlendSource.LBS_TEXTURE;
            mColorBlendMode.source2   = LayerBlendSource.LBS_DIFFUSE;
            mColorBlendMode.operation = LayerBlendOperationEx.LBX_MODULATE;

            mAlphaBlendMode = LayerBlendModeEx_NativePtr.Create();

            mAlphaBlendMode.blendType = LayerBlendType.LBT_ALPHA;
            mAlphaBlendMode.source1   = LayerBlendSource.LBS_TEXTURE;
            mAlphaBlendMode.source2   = LayerBlendSource.LBS_DIFFUSE;
            mAlphaBlendMode.operation = LayerBlendOperationEx.LBX_MODULATE;

            mTextureAddressMode.u = TextureUnitState.TextureAddressingMode.TAM_CLAMP;
            mTextureAddressMode.v = TextureUnitState.TextureAddressingMode.TAM_CLAMP;
            mTextureAddressMode.w = TextureUnitState.TextureAddressingMode.TAM_CLAMP;

            // set up buffer and tracking variables
            _createVertexBuffer(BUFFER_SIZE_INITIAL);

// For now, assume the first scene manager instance is the one in use.
// TODO: reparar esto
//Root.Singleton.GetSceneManagerIterator().Current.RenderQueueStarted += new RenderQueueListener.RenderQueueStartedHandler(Current_RenderQueueStarted);
        }
            ///<summary>
            ///    @copydoc RenderQueueListener::renderQueueStarted
            ///</summary>
            public bool OnRenderQueueStarted(RenderQueueGroupID id)
            {
                // Skip when not matching viewport
                // shadows update is nested within main viewport update
                if (sceneManager.CurrentViewport != viewport)
                {
                    return(false);
                }

                FlushUpTo(id);
                /// If noone wants to render this queue, skip it
                /// Don't skip the OVERLAY queue because that's handled seperately
                if (!operation.RenderQueueBitTest(id) && id != RenderQueueGroupID.Overlay)
                {
                    return(true);
                }
                return(false);
            }
 public CompositionPass(CompositionTargetPass parent)
 {
     this.parent              = parent;
     type                     = CompositorPassType.RenderQuad;
     identifier               = 0;
     firstRenderQueue         = RenderQueueGroupID.SkiesEarly;
     lastRenderQueue          = RenderQueueGroupID.SkiesLate;
     clearBuffers             = FrameBuffer.Color | FrameBuffer.Depth;
     clearColor               = new ColorEx(0f, 0f, 0f, 0f);
     clearDepth               = 1.0f;
     clearStencil             = 0;
     stencilCheck             = false;
     stencilFunc              = CompareFunction.AlwaysPass;
     stencilRefValue          = 0;
     stencilMask              = (int)0x7FFFFFFF;
     stencilFailOp            = StencilOperation.Keep;
     stencilDepthFailOp       = StencilOperation.Keep;
     stencilPassOp            = StencilOperation.Keep;
     stencilTwoSidedOperation = false;
 }
Example #23
0
        /// <summary>
        /// Named constructor
        /// </summary>
        /// <param name="name"></param>
        protected MovableObject(string name)
            : base()
        {
            if (string.IsNullOrEmpty(name))
            {
                this.name = "Unnamed_" + nextUnnamedNodeExtNum++;
            }
            else
            {
                this.name = name;
            }

            this.isVisible = true;
            // set default RenderQueueGroupID for this movable object
            this.renderQueueID   = RenderQueueGroupID.Main;
            this.queryFlags      = DefaultQueryFlags;
            this.visibilityFlags = DefaultVisibilityFlags;
            this.worldAABB       = AxisAlignedBox.Null;
            this.castShadows     = true;
        }
Example #24
0
 public StaticGeometry(SceneManager owner, string name)
 {
     this.owner                   = owner;
     this.name                    = name;
     built                        = false;
     upperDistance                = 0.0f;
     squaredUpperDistance         = 0.0f;
     castShadows                  = false;
     regionDimensions             = new Vector3(regionSize, regionSize, regionSize);
     halfRegionDimensions         = regionDimensions * 0.5f;
     origin                       = Vector3.Zero;
     visible                      = true;
     renderQueueID                = RenderQueueGroupID.Main;
     renderQueueIDSet             = false;
     buildCount                   = 0;
     subMeshGeometryLookup        = new Dictionary <SubMesh, List <SubMeshLodGeometryLink> >();
     queuedSubMeshes              = new List <QueuedSubMesh>();
     regionMap                    = new Dictionary <uint, Region>();
     optimisedSubMeshGeometryList = new List <OptimisedSubMeshGeometry>();
 }
Example #25
0
            public void AddRenderables(RenderQueue queue, RenderQueueGroupID group, Real lodValue)
            {
                // Get batch instance
#warning OGRE-1.6 BatchInstance Implementation
                //BatchInstance batchInstance = Parent.Parent;

                // Get material lod strategy
                var materialLodStrategy = Material.LodStrategy;

                // If material strategy doesn't match, recompute lod value with correct strategy
#warning OGRE-1.6 BatchInstance Implementation needed
                //if ( materialLodStrategy != batchInstance.LodStrategy )
                //    lodValue = materialLodStrategy.GetValue( batchInstance, batchInstance.Camera );

                // determine the current material technique
                this.technique = this.material.GetBestTechnique(this.material.GetLodIndex(lodValue));
                foreach (var gbucket in this.geometryBucketList)
                {
                    queue.AddRenderable(gbucket, RenderQueue.DEFAULT_PRIORITY, group);
                }
            }
Example #26
0
        /// <summary>
        ///		When RenderQueue 6 is ending, we will end the query and poll for the results.
        /// </summary>
        /// <param name="priority"></param>
        /// <returns></returns>
        private bool scene_QueueEnded(RenderQueueGroupID priority)
        {
            // end our occlusion query
            if (priority == RenderQueueGroupID.Six)
            {
                query.End();
            }

            // get the fragment count from the query
            int count = query.PullResults(true);

            // report the results
            if (count == 0)
            {
                window.DebugText = "Object is occluded.";
            }
            else
            {
                window.DebugText = string.Format("Visible fragments = {0}", count);
            }

            return(false);
        }
Example #27
0
        /// <summary>
        ///		Get a render queue group.
        /// </summary>
        /// <remarks>
        ///		New queue groups are registered as they are requested,
        ///		therefore this method will always return a valid group.
        /// </remarks>
        /// <param name="queueID">ID of the queue group to retreive.</param>
        /// <returns></returns>
        public RenderQueueGroup GetQueueGroup(RenderQueueGroupID queueID)
        {
            RenderQueueGroup group = null;

            // see if there is a current queue group for this group id
            if (renderGroups[queueID] == null)
            {
                // create a new queue group for this group id
                group = new RenderQueueGroup(this, splitPassesByLightingType,
                                             splitNoShadowPasses,
                                             shadowCastersCannotBeReceivers);

                // add the new group to cached render group
                renderGroups.Add(queueID, group);
            }
            else
            {
                // retreive the existing queue group
                group = (RenderQueueGroup)renderGroups[queueID];
            }

            return(group);
        }
Example #28
0
			public void AddRenderables( RenderQueue queue, RenderQueueGroupID group, Real lodValue )
			{
				// Get batch instance
#warning OGRE-1.6 BatchInstance Implementation
				//BatchInstance batchInstance = Parent.Parent;

				// Get material lod strategy
				var materialLodStrategy = Material.LodStrategy;

				// If material strategy doesn't match, recompute lod value with correct strategy
#warning OGRE-1.6 BatchInstance Implementation needed
				//if ( materialLodStrategy != batchInstance.LodStrategy )
				//    lodValue = materialLodStrategy.GetValue( batchInstance, batchInstance.Camera );

				// determine the current material technique
				this.technique = this.material.GetBestTechnique( this.material.GetLodIndex( lodValue ) );
				foreach ( var gbucket in this.geometryBucketList )
				{
					queue.AddRenderable( gbucket, RenderQueue.DEFAULT_PRIORITY, group );
				}
			}
 ///<summary>
 ///    Flush remaining render system operations
 ///</summary>
 public void FlushUpTo(RenderQueueGroupID id)
 {
     /// Process all RenderSystemOperations up to and including render queue id.
     /// Including, because the operations for RenderQueueGroup x should be executed
     /// at the beginning of the RenderQueueGroup render for x.
     while (currentOp != lastOp &&
            ((int)operation.RenderSystemOperations[currentOp].QueueID < (int)id)) {
         operation.RenderSystemOperations[currentOp].Operation.Execute(sceneManager, renderSystem);
         currentOp++;
     }
 }
Example #30
0
			public QueueIDAndOperation( RenderQueueGroupID queueID, CompositeRenderSystemOperation operation )
			{
				this.queueID = queueID;
				this.operation = operation;
			}
Example #31
0
			/// <summary>
			///   Add children to the render queue
			/// </summary>
			/// <param name="queue"> </param>
			/// <param name="group"> </param>
			/// <param name="camSquaredDistance"> </param>
			public void AddRenderables( RenderQueue queue, RenderQueueGroupID group, float camSquaredDistance )
			{
				// Determine the current material technique
				mTechnique = mMaterial.GetBestTechnique( mMaterial.GetLodIndex( camSquaredDistance ) );
				foreach ( GeometryBucket iter in mGeometryBucketList )
				{
					queue.AddRenderable( iter, group );
				}
			}
Example #32
0
			/// <summary>
			///   Add children to the render queue
			/// </summary>
			/// <param name="queue"> </param>
			/// <param name="group"> </param>
			/// <param name="camSquaredDistance"> </param>
			public void AddRenderables( RenderQueue queue, RenderQueueGroupID group, float camSquaredDistance )
			{
				foreach ( MaterialBucket iter in mMaterialBucketMap.Values )
				{
					iter.AddRenderables( queue, group, camSquaredDistance );
				}
			}
Example #33
0
 /// <summary>
 /// Adds an item to the 'special case' render queue list.
 /// </summary>
 /// <remarks>Normally all render queues are rendered, in their usual sequence,
 /// only varying if a RenderQueueListener nominates for the queue to be
 /// repeated or skipped. This method allows you to add a render queue to
 /// a 'special case' list, which varies the behaviour. The effect of this
 /// list depends on the 'mode' in which this list is in, which might be
 /// to exclude these render queues, or to include them alone (excluding
 /// all other queues). This allows you to perform broad selective
 /// rendering without requiring a RenderQueueListener.</remarks>
 /// <param name="queueId">The identifier of the queue which should be added to the
 ///  special case list. Nothing happens if the queue is already in the list.</param>
 public virtual void AddRenderQueue(RenderQueueGroupID queueId)
 {
     this._queue.Add(queueId);
 }
Example #34
0
		/// <summary>
		///		Get a render queue group.
		/// </summary>
		/// <remarks>
		///		New queue groups are registered as they are requested, 
		///		therefore this method will always return a valid group.
		/// </remarks>
		/// <param name="queueID">ID of the queue group to retreive.</param>
		/// <returns></returns>
		public RenderQueueGroup GetQueueGroup( RenderQueueGroupID queueID )
		{
			var group = this.renderGroups[ queueID ] as RenderQueueGroup;

			// see if there is a current queue group for this group id
			if ( group == null )
			{
				// create a new queue group for this group id
				group = new RenderQueueGroup( this, this.splitPassesByLightingType, this.splitNoShadowPasses,
				                              this.shadowCastersCannotBeReceivers );

				// add the new group to cached render group
				this.renderGroups.Add( queueID, group );
			}

			return group;
		}
Example #35
0
        /// <summary>
        /// Creates the element in the world. It automatically
        /// sets up the mesh and the node.</summary>
        protected virtual void Initialise(RenderQueueGroupID renderGroup, string materialName, Vec3 scale)
        {
            mBillboardSet = SceneManager.Instance.CreateBillboardSet(2);
            mBillboardSet.CastShadows = false;
            mBillboardSet.RenderQueueGroup = renderGroup;
            mBillboardSet.MaterialName = materialName;
            mBillboardSet.DefaultSize = new Vec2(1, 1);

            // Attaches the mesh on a node
            if (mBillboardSet.ParentSceneNode == null)
            {
                mNode = new SceneNode();
                mNode.Attach(mBillboardSet);
            }
            else
                mNode = mBillboardSet.ParentSceneNode;

            // Sets up the node (Position, Scale and Rotation)
            mBillboardSet.CreateBillboard(Vec3.Zero);
            mNode.Position = Vec3.Zero;
            mNode.Scale = scale;

            mMainLight = SceneManager.Instance.CreateLight();
            mMainLight.Type = RenderLightType.Directional;
            mMainLight.AllowStaticLighting = false;
            mMainLight.CastShadows = true;
            mMainLight.Position = new Vec3(0, 0, 150);
        }
 private bool scene_OnQueueStarted(RenderQueueGroupID x)
 {
     //if (x == RenderQueueGroupID.Overlay)
     //    renderOverlayQueueTimer.Start();
     //else
     // renderQueueTimer.Enter();
     MeterManager.AddInfoEvent(string.Format("Client Render Queue Timer OnQueueStarted({0})", x));
     return false;
 }
 //-----------------------------------------------------------------------
 public override void SetRenderQueueGroup(RenderQueueGroupID queueID)
 {
     billboardSet.RenderQueueGroup = queueID;
 }
            ///<summary>
            ///    @copydoc RenderQueueListener::renderQueueStarted
            ///</summary>
            public bool OnRenderQueueStarted(RenderQueueGroupID id)
            {
                // Skip when not matching viewport
                // shadows update is nested within main viewport update
                if (sceneManager.CurrentViewport != viewport)
                    return false;

                FlushUpTo(id);
                /// If noone wants to render this queue, skip it
                /// Don't skip the OVERLAY queue because that's handled seperately
                if (!operation.RenderQueueBitTest(id) && id != RenderQueueGroupID.Overlay)
                    return true;
                return false;
            }
 public bool OnRenderQueueEnded(RenderQueueGroupID id)
 {
     return false;
 }
Example #40
0
		/// <summary>
		///		Adds a renderable item to the queue.
		/// </summary>
		/// <param name="renderable">IRenderable object to add to the queue.</param>
		/// <param name="groupID">Group to add the item to.</param>
		/// <param name="priority"></param>
		public void AddRenderable( IRenderable renderable, ushort priority, RenderQueueGroupID groupID )
		{
			var group = GetQueueGroup( groupID );
			Technique t;

			// let the material know it has been used, which also forces a recompile if required
			if ( renderable.Material != null )
			{
				renderable.Material.Touch();
			}

			// Check material & technique supplied (the former since the default implementation
			// of getTechnique is based on it for backwards compatibility
			if ( renderable.Material == null || renderable.Technique == null )
			{
				// Use default base white
				var baseWhite = (Material)MaterialManager.Instance[ "BaseWhite" ];
				t = baseWhite.GetTechnique( 0 );
			}
			else
			{
				t = renderable.Technique;
			}

			// add the renderable to the appropriate group
			group.AddRenderable( renderable, t, priority );
		}
Example #41
0
		/// <summary>
		///		Overloaded method.
		/// </summary>
		/// <param name="item"></param>
		/// <param name="groupID"></param>
		public void AddRenderable( IRenderable item, RenderQueueGroupID groupID )
		{
			AddRenderable( item, DEFAULT_PRIORITY, groupID );
		}
Example #42
0
			public void AddRenderables( RenderQueue queue, RenderQueueGroupID group, float camSquaredDistance )
			{
				// Just pass this on to child buckets
				foreach ( var mbucket in this.materialBucketMap.Values )
				{
					mbucket.AddRenderables( queue, group, camSquaredDistance );
				}
			}
        /// <summary>
        ///		When RenderQueue 6 is ending, we will end the query and poll for the results.
        /// </summary>
        /// <param name="priority"></param>
        /// <returns></returns>
        private bool scene_QueueEnded(RenderQueueGroupID priority)
        {
            // end our occlusion query
            if(priority == RenderQueueGroupID.Six) {
                query.End();
            }

            // get the fragment count from the query
            int count = query.PullResults(true);

            // report the results
            if(count == 0) {
                window.DebugText = "Object is occluded.";
            }
            else {
                window.DebugText = string.Format("Visible fragments = {0}", count);
            }

            return false;
        }
Example #44
0
        private ITimer mWindTimer; //private Mogre.Timer mWindTimer;

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Creates a new GrassLoader object. 
        /// </summary>
        /// <param name="geom">The PagedGeometry object that this GrassLoader will be assigned to.</param>
        public GrassLoader(PagedGeometry geom)
        {
            mGeom = geom;
            mHeightFunctionUserData = null;
            mWindDir = Vector3.UnitX;
            mDensityFactor = 1.0f;
            mRenderQueue = RenderQueueGroupID.Six;
            mWindTimer = new MogreLib.Core.Timer();//mWindTimer = Root.Singleton.Timer;
            mWindTimer.Reset();
            mLastTime = 0;
        }
Example #45
0
 /// <summary>
 /// Removes an item to the 'special case' render queue list
 /// </summary>
 /// <param name="queueId">The identifier of the queue which should be removed from the
 /// special case list. Nothing happens if the queue is not in the list.</param>
 public virtual void RemoveRenderQueue(RenderQueueGroupID queueId)
 {
     this._queue.Remove(queueId);
 }
Example #46
0
        /// <summary>
        /// Creates the element in the world. It automatically
        /// sets up the mesh and the node.</summary>
        protected virtual void Initialise(RenderQueueGroupID renderGroup, string meshName, Vec3 scale, Vec3 rotation)
        {
            // Creates the mesh in the world
            mMesh = SceneManager.Instance.CreateMeshObject(meshName);
            mMesh.CastShadows = false;
            mMesh.RenderQueueGroup = renderGroup;

            // Attaches the mesh on a node
            if (mMesh.ParentSceneNode == null)
            {
                mNode = new SceneNode();
                mNode.Attach(mMesh);
            }
            else
                mNode = mMesh.ParentSceneNode;

            // Sets up the node (Position, Scale and Rotation)
            mNode.Position = Vec3.Zero;
            mNode.Scale = scale;
            mNode.Rotation *= CaelumUtils.GenerateQuat(CaelumUtils.XAxis, new Degree(rotation.X));
            mNode.Rotation *= CaelumUtils.GenerateQuat(CaelumUtils.YAxis, new Degree(rotation.Y));
            mNode.Rotation *= CaelumUtils.GenerateQuat(CaelumUtils.ZAxis, new Degree(rotation.Z));
        }
Example #47
0
		/// <summary>
		///		Used to first the QueueStarted event.
		/// </summary>
		/// <returns>True if the queue should be skipped.</returns>
		protected virtual bool OnRenderQueueStarted( RenderQueueGroupID group, string invocation )
		{
			BeginRenderQueueEventArgs e = new BeginRenderQueueEventArgs();
			e.RenderQueueId = group;
			e.Invocation = invocation;

			bool skip = false;
			this._queueStartedEvent.Fire( this, e, ( args ) =>
			{
				skip |= args.SkipInvocation;
				return true;
			} );
			return skip;
		}
Example #48
0
		public CompositionPass( CompositionTargetPass parent )
		{
			this.parent = parent;
			type = CompositorPassType.RenderQuad;
			identifier = 0;
			firstRenderQueue = RenderQueueGroupID.Background;
			lastRenderQueue = RenderQueueGroupID.SkiesLate;
			materialSchemeName = string.Empty;
			clearBuffers = FrameBufferType.Color | FrameBufferType.Depth;
			clearColor = new ColorEx( 0f, 0f, 0f, 0f );
			clearDepth = 1.0f;
			clearStencil = 0;
			stencilCheck = false;
			stencilFunc = CompareFunction.AlwaysPass;
			stencilRefValue = 0;
			stencilMask = 0x7FFFFFFF;
			stencilFailOp = StencilOperation.Keep;
			stencilDepthFailOp = StencilOperation.Keep;
			stencilPassOp = StencilOperation.Keep;
			stencilTwoSidedOperation = false;
			quadCornerModified = false;
			quadLeft = -1;
			quadTop = 1;
			quadRight = 1;
			quadBottom = -1;
			quadFarCorners = false;
			quadFarCornersViewSpace = false;
		}
 public CompositionPass(CompositionTargetPass parent)
 {
     this.parent = parent;
     type = CompositorPassType.RenderQuad;
     identifier = 0;
     firstRenderQueue = RenderQueueGroupID.SkiesEarly;
     lastRenderQueue = RenderQueueGroupID.SkiesLate;
     clearBuffers = FrameBuffer.Color | FrameBuffer.Depth;
     clearColor = new ColorEx(0f, 0f, 0f, 0f);
     clearDepth = 1.0f;
     clearStencil = 0;
     stencilCheck = false;
     stencilFunc = CompareFunction.AlwaysPass;
     stencilRefValue = 0;
     stencilMask = (int)0x7FFFFFFF;
     stencilFailOp = StencilOperation.Keep;
     stencilDepthFailOp = StencilOperation.Keep;
     stencilPassOp = StencilOperation.Keep;
     stencilTwoSidedOperation = false;
 }
		/// <summary>
		/// Adds an item to the 'special case' render queue list.
		/// </summary>
		/// <remarks>Normally all render queues are rendered, in their usual sequence,
		/// only varying if a RenderQueueListener nominates for the queue to be
		/// repeated or skipped. This method allows you to add a render queue to
		/// a 'special case' list, which varies the behaviour. The effect of this
		/// list depends on the 'mode' in which this list is in, which might be
		/// to exclude these render queues, or to include them alone (excluding
		/// all other queues). This allows you to perform broad selective
		/// rendering without requiring a RenderQueueListener.</remarks>
		/// <param name="queueId">The identifier of the queue which should be added to the
		///  special case list. Nothing happens if the queue is already in the list.</param>
		public virtual void AddRenderQueue( RenderQueueGroupID queueId )
		{
			_queue.Add( queueId );
		}
 public CompositorTargetOperation(RenderTarget target)
 {
     this.target = target;
     currentQueueGroupID = 0;
     renderSystemOperations = new List<QueueIDAndOperation>();
     visibilityMask = 0xFFFFFFFF;
     lodBias = 1.0f;
     onlyInitial = false;
     hasBeenRendered = false;
     findVisibleObjects = false;
 }
        public MovableObject(string name)
        {
            this.Name = name;

            isVisible = true;
            // set default RenderQueueGroupID for this movable object
            renderQueueID = RenderQueueGroupID.Main;
            queryFlags = unchecked(0xffffffff);
            worldAABB = AxisAlignedBox.Null;
            castShadows = true;
        }
Example #53
0
		protected override bool OnRenderQueueEnded( RenderQueueGroupID group, string invocation )
		{
			bool repeat = base.OnRenderQueueEnded( group, invocation );
			if ( group == RenderQueueGroupID.SkiesEarly )
			{
				RenderStaticGeometry();
			}
			return repeat;
		}
 public bool RenderQueueBitTest(RenderQueueGroupID id)
 {
     return renderQueues[(int)id];
 }
Example #55
0
		/// <summary>
		///		Used to first the QueueEnded event.
		/// </summary>
		/// <returns>True if the queue should be repeated.</returns>
		protected virtual bool OnRenderQueueEnded( RenderQueueGroupID group, string invocation )
		{
			EndRenderQueueEventArgs e = new EndRenderQueueEventArgs();
			e.RenderQueueId = group;
			e.Invocation = invocation;

			bool repeat = false;
			this._queueEndedEvent.Fire( this, e, ( args ) =>
			{
				repeat |= args.RepeatInvocation;
				return true;
			} );
			return repeat;
		}
Example #56
0
 public bool RenderQueueBitTest(RenderQueueGroupID id)
 {
     return(renderQueues[(int)id]);
 }
		/// <summary>
		/// Returns whether or not the named queue will be rendered based on the
		/// current 'special case' render queue list and mode.
		/// </summary>
		/// <param name="queueId">The identifier of the queue which should be tested</param>
		/// <returns>true if the queue will be rendered, false otherwise</returns>
		public virtual bool IsRenderQueueToBeProcessed( RenderQueueGroupID queueId )
		{
			bool inList = _queue.Contains( queueId );
			return ( inList && _mode == SpecialCaseRenderQueueMode.Include )
				|| ( !inList && _mode == SpecialCaseRenderQueueMode.Exclude );
		}
Example #58
0
		/// <summary>
		///		Default constructor.
		/// </summary>
		public RenderQueue()
		{
			// set the default queue group for this queue
			this.defaultGroup = RenderQueueGroupID.Main;

			// create the main queue group up front
			this.renderGroups.Add( RenderQueueGroupID.Main,
			                       new RenderQueueGroup( this, this.splitPassesByLightingType, this.splitNoShadowPasses,
			                                             this.shadowCastersCannotBeReceivers ) );
		}
		/// <summary>
		/// Removes an item to the 'special case' render queue list
		/// </summary>
		/// <param name="queueId">The identifier of the queue which should be removed from the
		/// special case list. Nothing happens if the queue is not in the list.</param>
		public virtual void RemoveRenderQueue( RenderQueueGroupID queueId )
		{
			_queue.Remove( queueId );
		}
        /// <summary>
        ///		When RenderQueue 6 is starting, we will begin the occlusion query.
        /// </summary>
        /// <param name="priority"></param>
        /// <returns></returns>
        private bool scene_QueueStarted(RenderQueueGroupID priority)
        {
            // begin the occlusion query
            if(priority == RenderQueueGroupID.Six) {
                query.Begin();
            }

            return false;
        }