/// <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)); }
/// <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); }
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; }
/// <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); } }
/// <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); } }
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); } }
/// <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; }
/// <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)); }
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(); }
/// <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); }
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; }
public CompositorTargetOperation(RenderTarget target) { this.target = target; currentQueueGroupID = 0; renderSystemOperations = new List <QueueIDAndOperation>(); visibilityMask = 0xFFFFFFFF; lodBias = 1.0f; onlyInitial = false; hasBeenRendered = false; findVisibleObjects = false; }
/// <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; }
///<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++; } }
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); } } }
/// <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); }
/// <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); }
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; }
/// <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; }
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>(); }
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> /// 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); }
/// <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); }
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++; } }
public QueueIDAndOperation( RenderQueueGroupID queueID, CompositeRenderSystemOperation operation ) { this.queueID = queueID; this.operation = operation; }
/// <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> /// 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 ); } }
/// <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); }
/// <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; }
/// <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; }
/// <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 ); }
/// <summary> /// Overloaded method. /// </summary> /// <param name="item"></param> /// <param name="groupID"></param> public void AddRenderable( IRenderable item, RenderQueueGroupID groupID ) { AddRenderable( item, DEFAULT_PRIORITY, groupID ); }
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; }
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; }
/// <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); }
/// <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)); }
/// <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; }
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; }
/// <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; }
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]; }
/// <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; }
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 ); }
/// <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; }