private static void RenderSystem_Setup() { Axiom.Graphics.RenderSystem rs = Root.Instance.RenderSystem; var colorBlendMode = new LayerBlendModeEx(); colorBlendMode.blendType = LayerBlendType.Color; colorBlendMode.source1 = LayerBlendSource.Texture; colorBlendMode.operation = LayerBlendOperationEx.Source1; var uvwAddressMode = new UVWAddressing(TextureAddressing.Clamp); rs.WorldMatrix = Matrix4.Identity; rs.ViewMatrix = Matrix4.Identity; rs.ProjectionMatrix = Matrix4.Identity; rs.SetTextureMatrix(0, Matrix4.Identity); rs.SetTextureCoordSet(0, 0); rs.SetTextureCoordCalculation(0, TexCoordCalcMethod.None); rs.SetTextureBlendMode(0, colorBlendMode); rs.SetTextureAddressingMode(0, uvwAddressMode); rs.DisableTextureUnitsFrom(1); rs.LightingEnabled = false; rs.SetFog(FogMode.None); rs.CullingMode = CullingMode.None; rs.SetDepthBufferParams(false, false); rs.SetColorBufferWriteEnabled(true, true, true, false); rs.ShadingType = ShadeOptions.Gouraud; rs.PolygonMode = PolygonMode.Solid; rs.UnbindGpuProgram(GpuProgramType.Fragment); rs.UnbindGpuProgram(GpuProgramType.Vertex); rs.SetSeparateSceneBlending(SceneBlendFactor.SourceAlpha, SceneBlendFactor.OneMinusSourceAlpha, SceneBlendFactor.One, SceneBlendFactor.One); rs.SetAlphaRejectSettings(CompareFunction.AlwaysPass, 0, true); }
public void Initialize() { // Render system creation has been moved here ( like Ogre does in Install method ) // since the Plugin.ctor is called twice during startup. this._renderSystem = new D3D9RenderSystem(); // add an instance of this plugin to the list of available RenderSystems Root.Instance.RenderSystems.Add( "DirectX9", this._renderSystem ); }
public ConfigDialog() { _currentSystem = Root.Instance.RenderSystems[0]; _renderSystems = new ConfigOption("Render System", _currentSystem.Name, false); foreach (Axiom.Graphics.RenderSystem rs in Root.Instance.RenderSystems) { _renderSystems.PossibleValues.Add(_renderSystems.PossibleValues.Count, rs.ToString()); } BuildOptions(); }
public virtual void CreateRenderSystem() { if (this.Engine.RenderSystem == null) { this.RenderSystem = this.Engine.RenderSystem = this.Engine.RenderSystems.First().Value; } else { this.RenderSystem = this.Engine.RenderSystem; } }
public ConfigDialog() { Axiom.Core.Root root = Axiom.Core.Root.Instance; _renderSystemList = new List<RenderSystem>(root.RenderSystems.Values); _currentSystem = _renderSystemList[ 0 ]; _renderSystems = new ConfigOption("Render System", _currentSystem.Name, false); foreach ( RenderSystem rs in root.RenderSystems ) { _renderSystems.PossibleValues.Add(_renderSystems.PossibleValues.Count, rs.ToString()); } BuildOptions(); }
public void Initialize() { // Render system creation has been moved here since the Plugin.ctor is called twice // during startup _renderSystem = new XnaRenderSystem(); // add an instance of this plugin to the list of available RenderSystems Root.Instance.RenderSystems.Add( "Xna", _renderSystem ); ResourceGroupManager.Instance.Initialize( new[] { "png", "jpg", "bmp", "dds", "jpeg", "tiff" } ); //new XnaMaterialManager(); }
private bool ProcessKey(int key) { if (_currentOption == null) { if (key == -1) //ESCAPE { _result = DialogResult.Cancel; return(false); } if (key == -2) { Root.Instance.RenderSystem = _currentSystem; //for ( index = 0; index < _options.Count; index++ ) //{ // ConfigOption opt = (ConfigOption)_options[ index ]; // _currentSystem.ConfigOptions[ opt.Name ] = opt; //} _result = DialogResult.Ok; return(false); } if (key < _menuItems.Count) { _currentOption = (ConfigOption)_menuItems[key]; } } else { _currentOption.Value = _currentOption.PossibleValues.Values[key].ToString(); if (_currentOption.Name == "Render System") // About to change Renderers { _renderSystems = _currentOption; _currentSystem = Root.Instance.RenderSystems[key]; BuildOptions(); _currentOption = null; return(true); } _currentOption = null; } return(true); }
/// <summary> /// Reconfigures the context. Attempts to preserve the current sample state. /// </summary> /// <param name="renderer"></param> /// <param name="options"></param> protected virtual void Reconfigure(String renderer, NameValuePairList options) { // save current sample state this.LastSample = CurrentSample; if (CurrentSample != null) { CurrentSample.SaveState(this.LastSampleState); } this.NextRenderer = renderer; Axiom.Graphics.RenderSystem rs = this.Root.RenderSystems[renderer]; // set all given render system options foreach (var option in options) { rs.ConfigOptions[option.Key].Value = option.Value; } this.IsLastRun = false; // we want to go again with the new settings this.Root.QueueEndRendering(); // break from render loop }
private static void Render() { if (sprites.Count == 0) { return; } Axiom.Graphics.RenderSystem rs = Root.Instance.RenderSystem; var thisChunk = new Chunk(); var chunks = new List <Chunk>(); int newSize; newSize = sprites.Count * 6; if (newSize < MinimalHardwareBufferSize) { newSize = MinimalHardwareBufferSize; } // grow hardware buffer if needed if (hardwareBuffer == null || hardwareBuffer.VertexCount < newSize) { if (hardwareBuffer != null) { HardwareBuffer_Destroy(); } HardwareBuffer_Create(newSize); } // write quads to the hardware buffer, and remember chunks unsafe { var buffer = (Vertex *)hardwareBuffer.Lock(BufferLocking.Discard).Pin(); LinkedListNode <Sprite> node = sprites.First; Sprite currSpr; while (node != null) { currSpr = node.Value; thisChunk.Alpha = currSpr.Alpha; thisChunk.TexHandle = currSpr.TexHandle; for (int i = 0; i < 6; i++) { *buffer++ = new Vertex(currSpr.Pos[i], currSpr.UV[i]); } thisChunk.VertexCount += 6; node = node.Next; if (node == null || thisChunk.TexHandle != node.Value.TexHandle || thisChunk.Alpha != node.Value.Alpha) { chunks.Add(thisChunk); thisChunk.VertexCount = 0; } } } hardwareBuffer.Unlock(); // set up... RenderSystem_Setup(); // do the real render! // do the real render! Texture tp = null; renderOp.vertexData.vertexStart = 0; foreach (Chunk currChunk in chunks) { renderOp.vertexData.vertexCount = currChunk.VertexCount; tp = (Texture)TextureManager.Instance.GetByHandle(currChunk.TexHandle); rs.SetTexture(0, true, tp.Name); rs.SetTextureUnitFiltering(0, FilterOptions.Linear, FilterOptions.Linear, FilterOptions.Point); // set alpha var alphaBlendMode = new LayerBlendModeEx(); alphaBlendMode.alphaArg1 = 0; alphaBlendMode.alphaArg2 = currChunk.Alpha; alphaBlendMode.source1 = LayerBlendSource.Texture; alphaBlendMode.source2 = LayerBlendSource.Manual; alphaBlendMode.blendType = LayerBlendType.Alpha; alphaBlendMode.operation = LayerBlendOperationEx.Modulate; alphaBlendMode.blendFactor = currChunk.Alpha; rs.SetTextureBlendMode(0, alphaBlendMode); rs.Render(renderOp); renderOp.vertexData.vertexStart += currChunk.VertexCount; } if (tp != null) { tp.Dispose(); } // sprites go home! sprites.Clear(); }
public void Render(RenderSystem targetRenderSystem) { // exit early if the entire group is not visible if (!visible) { return; } int positionParamIndex; if (meterRenderingOfTrees) { renderGroupMeter.Enter(); } targetRenderSystem.BeginProfileEvent(ColorEx.White, "Render Branches : " + name); positionParamIndex = SetupBranchRenderMaterial(); foreach (Tree t in trees) { if (t.RenderFlag && t.BranchRenderArgs.Active) { RenderBranch(targetRenderSystem, positionParamIndex, t); } } // clear the constant from the previous material positionParameters.ClearFloatConstant(positionParamIndex); targetRenderSystem.EndProfileEvent(); targetRenderSystem.BeginProfileEvent(ColorEx.White, "Render Fronds : " + name); positionParamIndex = SetupFrondRenderMaterial(); foreach (Tree t in trees) { if (t.RenderFlag && t.FrondRenderArgs.Active) { RenderFrond(targetRenderSystem, positionParamIndex, t); } } // clear the constant from the previous material positionParameters.ClearFloatConstant(positionParamIndex); targetRenderSystem.EndProfileEvent(); targetRenderSystem.BeginProfileEvent(ColorEx.White, "Render Leaves : " + name); if (TerrainManager.Instance.RenderLeaves) { positionParamIndex = SetupLeafRenderMaterial(); foreach (Tree t in trees) { if (t.RenderFlag && (t.Leaf0RenderArgs.Active || t.Leaf1RenderArgs.Active)) { RenderLeaves(targetRenderSystem, positionParamIndex, t); } } // clear the constant from the previous material positionParameters.ClearFloatConstant(positionParamIndex); } targetRenderSystem.EndProfileEvent(); if (meterRenderingOfTrees) { renderGroupMeter.Exit(); } }
/// <summary> /// /// </summary> /// <param name="sm"></param> /// <param name="rs"></param> public override void Execute( SceneManager sm, RenderSystem rs ) { var matMgr = MaterialManager.Instance; PreviousSchemeName = matMgr.ActiveScheme; PreviousLateResolving = sm.IsLateMaterialResolving; sm.IsLateMaterialResolving = true; }
public void RenderLeaves(RenderSystem targetRenderSystem, int positionParamIndex, Tree t) { if (meterRenderingOfTrees) { renderLeavesMeter.Enter(); } // set the position register in the hardware positionParameters.SetConstant(positionParamIndex, t.Location.x, t.Location.y, t.Location.z, 0); targetRenderSystem.BindGpuProgramParameters(GpuProgramType.Vertex, positionParameters); if (t.Leaf0RenderArgs.Active) { targetRenderSystem.SetAlphaRejectSettings(CompareFunction.Greater, (byte)t.Leaf0RenderArgs.AlphaTestValue); int lod = t.Leaf0RenderArgs.LOD; leaf0RenderOp.vertexData = leafVertexBuffers[lod]; leaf0RenderOp.indexData = leafIndexBuffers[lod]; if (leaf0RenderOp.vertexData != null) { targetRenderSystem.Render(leaf0RenderOp); } } if (t.Leaf1RenderArgs.Active) { targetRenderSystem.SetAlphaRejectSettings(CompareFunction.Greater, (byte)t.Leaf1RenderArgs.AlphaTestValue); int lod = t.Leaf1RenderArgs.LOD; leaf1RenderOp.vertexData = leafVertexBuffers[lod]; leaf1RenderOp.indexData = leafIndexBuffers[lod]; if (leaf1RenderOp.vertexData != null) { targetRenderSystem.Render(leaf1RenderOp); } } if (meterRenderingOfTrees) { renderLeavesMeter.Exit(); } }
public override void Execute(SceneManager sm, RenderSystem rs) { // Fire listener instance.FireNotifyMaterialRender(pass_id, mat); // Queue passes from mat for (int i=0; i<technique.NumPasses; i++) { Pass pass = technique.GetPass(i); sm.InjectRenderWithPass(pass, CompositorManager.Instance.GetTexturedRectangle2D(), false // don't allow replacement of shadow passes ); } }
private void LoadRenderSystemConfiguration( object sender, RenderSystem rs ) { string renderSystemId = rs.GetType().FullName; EngineConfig.ConfigOptionDataTable codt = ( (EngineConfig.ConfigOptionDataTable)config.Tables[ "ConfigOption" ] ); foreach ( EngineConfig.ConfigOptionRow row in codt ) { if ( row.RenderSystem == renderSystemId ) { if ( rs.ConfigOptions.ContainsKey( row.Name ) ) { rs.ConfigOptions[ row.Name ].Value = row.Value; } } } }
///<summary> /// Set current operation and target */ ///</summary> public void SetOperation( CompositeTargetOperation op, SceneManager sm, RenderSystem rs ) { this.operation = op; this.sceneManager = sm; this.renderSystem = rs; this.currentOp = 0; this.lastOp = op.RenderSystemOperations.Count; }
/// <summary> /// Called to shutdown the engine and dispose of all it's resources. /// </summary> public void Dispose() { // force the engine to shutdown this.Shutdown(); if ( CompositorManager.Instance != null ) { CompositorManager.Instance.Dispose(); } if ( OverlayManager.Instance != null ) { OverlayManager.Instance.Dispose(); } if ( OverlayElementManager.Instance != null ) { OverlayElementManager.Instance.Dispose(); } if ( FontManager.Instance != null ) { FontManager.Instance.Dispose(); } if ( ArchiveManager.Instance != null ) { ArchiveManager.Instance.Dispose(); } if ( SkeletonManager.Instance != null ) { SkeletonManager.Instance.Dispose(); } if ( MeshManager.Instance != null ) { MeshManager.Instance.Dispose(); } if ( MaterialManager.Instance != null ) { MaterialManager.Instance.Dispose(); } if ( ParticleSystemManager.Instance != null ) { ParticleSystemManager.Instance.Dispose(); } if ( ControllerManager.Instance != null ) { ControllerManager.Instance.Dispose(); } if ( HighLevelGpuProgramManager.Instance != null ) { HighLevelGpuProgramManager.Instance.Dispose(); } if ( PluginManager.Instance != null ) { PluginManager.Instance.Dispose(); } Pass.ProcessPendingUpdates(); if ( ResourceGroupManager.Instance != null ) { ResourceGroupManager.Instance.Dispose(); } if (CodecManager.Instance != null) { if (!CodecManager.Instance.IsDisposed) CodecManager.Instance.Dispose(); } #if !XBOX360 if ( PlatformManager.Instance != null ) { PlatformManager.Instance.Dispose(); } #endif this.activeRenderSystem = null; if ( WindowEventMonitor.Instance != null ) { WindowEventMonitor.Instance.Dispose(); } if ( ObjectManager.Instance != null ) { ObjectManager.Instance.Dispose(); } if ( LogManager.Instance != null ) { LogManager.Instance.Dispose(); } instance = null; }
public static void RenderAllTrees(RenderSystem targetRenderSystem) { int positionParamIndex; if (!initialized) { return; } allTreeRenderMeter.Enter(); if (TerrainManager.Instance.RenderLeaves) { if (meterRenderingOfTrees) { leavesMeter.Enter(); } foreach (TreeGroup group in allGroups) { if (group.visibleLeaves.Count != 0) { targetRenderSystem.BeginProfileEvent(ColorEx.White, "Render Leaves : " + group.name); positionParamIndex = group.SetupLeafRenderMaterial(); foreach (Tree t in group.visibleLeaves) { group.RenderLeaves(targetRenderSystem, positionParamIndex, t); } // clear the constant from the previous material group.positionParameters.ClearFloatConstant(positionParamIndex); } targetRenderSystem.EndProfileEvent(); } if (meterRenderingOfTrees) { leavesMeter.Exit(); } } // // Render all fronds // if (meterRenderingOfTrees) { frondsMeter.Enter(); } foreach (TreeGroup group in allGroups) { if (group.visibleFronds.Count != 0) { targetRenderSystem.BeginProfileEvent(ColorEx.White, "Render Fronds : " + group.name); positionParamIndex = group.SetupFrondRenderMaterial(); foreach (Tree t in group.visibleFronds) { group.RenderFrond(targetRenderSystem, positionParamIndex, t); } // clear the constant from the previous material group.positionParameters.ClearFloatConstant(positionParamIndex); targetRenderSystem.EndProfileEvent(); } } if (meterRenderingOfTrees) { frondsMeter.Exit(); } // // Render all branches // if (meterRenderingOfTrees) { branchesMeter.Enter(); } foreach (TreeGroup group in allGroups) { if (group.visibleBranches.Count != 0) { targetRenderSystem.BeginProfileEvent(ColorEx.White, "Render Branches : " + group.name); positionParamIndex = group.SetupBranchRenderMaterial(); foreach (Tree t in group.visibleBranches) { group.RenderBranch(targetRenderSystem, positionParamIndex, t); } // clear the constant from the previous material group.positionParameters.ClearFloatConstant(positionParamIndex); targetRenderSystem.EndProfileEvent(); } } if (meterRenderingOfTrees) { branchesMeter.Exit(); } // // now deal with billboards // if (billboardsDirty) { if (meterRenderingOfTrees) { rebuildBillboardsMeter.Enter(); } // we need to rebuild the billboards TreeBillboardRenderer.Instance.StartRebuild(); foreach (TreeGroup group in allGroups) { foreach (Tree t in group.visibleBillboards) { if (t.Billboard0RenderArgs.Active) { TreeBillboardRenderer.Instance.AddBillboard(group.BillboardTextureName, t.Billboard0RenderArgs.AlphaTestValue, t.Billboard0); } if (t.Billboard1RenderArgs.Active) { TreeBillboardRenderer.Instance.AddBillboard(group.BillboardTextureName, t.Billboard1RenderArgs.AlphaTestValue, t.Billboard1); } } } TreeBillboardRenderer.Instance.FinishRebuild(); if (meterRenderingOfTrees) { rebuildBillboardsMeter.Exit(); } billboardsDirty = false; } if (meterRenderingOfTrees) { billboardsMeter.Enter(); } TreeBillboardRenderer.Instance.Render(targetRenderSystem); if (meterRenderingOfTrees) { billboardsMeter.Exit(); } allTreeRenderMeter.Exit(); }
private void SaveRenderSystemConfiguration( object sender, RenderSystem rs ) { string renderSystemId = rs.GetType().FullName; EngineConfig.ConfigOptionDataTable codt = ( (EngineConfig.ConfigOptionDataTable)config.Tables[ "ConfigOption" ] ); foreach ( ConfigOption opt in rs.ConfigOptions ) { EngineConfig.ConfigOptionRow coRow = codt.FindByNameRenderSystem( opt.Name, renderSystemId ); if ( coRow == null ) { coRow = codt.NewConfigOptionRow(); coRow.RenderSystem = renderSystemId; coRow.Name = opt.Name; codt.AddConfigOptionRow( coRow ); } coRow.Value = opt.Value; } config.AcceptChanges(); config.WriteXml( CONFIG_FILE ); }
public override void Execute(SceneManager sm, RenderSystem rs) { rs.ClearFrameBuffer(buffers, color, depth, stencil); }
public override void ReadCategoryData(XmlElement configNode) { try { int width = int.Parse(GetElementText(configNode, "Width")); int height = int.Parse(GetElementText(configNode, "Height")); int depth = int.Parse(GetElementText(configNode, "Depth")); bool fullScreen = bool.Parse(GetElementText(configNode, "Fullscreen")); renderSystemName = GetElementText(configNode, "RenderSystem"); vSync = bool.Parse(GetElementText(configNode, "VSync")); antiAliasing = GetElementText(configNode, "AntiAliasing"); allowNVPerfHUD = bool.Parse(GetElementText(configNode, "AllowNVPerfHUD")); displayMode = new DisplayMode(Math.Max(width, minScreenWidth), Math.Max(height, minScreenHeight), depth, allowFullScreen && fullScreen); List<RenderSystem> renderSystems = Root.Instance.RenderSystems; foreach (RenderSystem r in renderSystems) { if (r.Name == renderSystemName) { renderSystem = r; break; } } } catch (Exception) { log.WarnFormat("Unable to parse DisplayConfig configuration"); } }
public override void Execute(SceneManager sm, RenderSystem rs) { rs.StencilCheckEnabled = stencilCheck; rs.SetStencilBufferParams(func, refValue, mask, stencilFailOp, depthFailOp, passOp, twoSidedOperation); }
/// Set state to SceneManager and RenderSystem public abstract void Execute( SceneManager sm, RenderSystem rs );
public void Shutdown() { // nothing at the moment _renderSystem.SafeDispose(); _renderSystem = null; }
public override void Execute( SceneManager sm, RenderSystem rs ) { rs.StencilCheckEnabled = this.stencilCheck; rs.SetStencilBufferParams( this.func, this.refValue, this.mask, this.stencilFailOp, this.depthFailOp, this.passOp, this.twoSidedOperation ); }
public virtual void CreateRenderSystem() { if ( this.Engine.RenderSystem == null ) { this.RenderSystem = this.Engine.RenderSystem = this.Engine.RenderSystems.First().Value; } else { this.RenderSystem = this.Engine.RenderSystem; } }
public void RenderBranch(RenderSystem targetRenderSystem, int positionParamIndex, Tree t) { if (meterRenderingOfTrees) { renderBranchMeter.Enter(); } int lod = t.BranchRenderArgs.LOD; if ((branchVertexBuffers[lod] != null) && (branchIndexBuffers[lod] != null)) { targetRenderSystem.SetAlphaRejectSettings(CompareFunction.Greater, (byte)t.BranchRenderArgs.AlphaTestValue); // set the position register in the hardware positionParameters.SetConstant(positionParamIndex, t.Location.x, t.Location.y, t.Location.z, 0); targetRenderSystem.BindGpuProgramParameters(GpuProgramType.Vertex, positionParameters); branchRenderOp.vertexData = branchVertexBuffers[lod]; branchRenderOp.indexData = branchIndexBuffers[lod]; targetRenderSystem.Render(branchRenderOp); } if (meterRenderingOfTrees) { renderBranchMeter.Exit(); } }
public override void Execute( SceneManager sm, RenderSystem rs ) { rs.ClearFrameBuffer( this.buffers, this.color, this.depth, (ushort)this.stencil ); }
public void Initialize() { this._renderSystem = new GLES2RenderSystem(); Root.Instance.RenderSystems.Add( "OpenGLES2", this._renderSystem ); }
/// <summary> /// /// </summary> /// <param name="sm"></param> /// <param name="rs"></param> public override void Execute( SceneManager sm, RenderSystem rs ) { // Fire listener Instance.OnMaterialRender( new CompositorInstanceMaterialEventArgs( PassId, Material ) ); var vp = rs.Viewport; var rect = (Rectangle2D)CompositorManager.Instance.TexturedRectangle2D; if ( QuadCornerModified ) { // ensure positions are using peculiar render system offsets float hOffset = rs.HorizontalTexelOffset/( 0.5f*vp.ActualWidth ); float vOffset = rs.VerticalTexelOffset/( 0.5f*vp.ActualHeight ); rect.SetCorners( QuadLeft + hOffset, QuadTop - vOffset, QuadRight + hOffset, QuadBottom - vOffset ); } if ( QuadFarCorners ) { var corners = vp.Camera.WorldSpaceCorners; if ( QuadFarCornersViewSpace ) { var viewMat = vp.Camera.FrustumViewMatrix; rect.SetNormals( viewMat*corners[ 5 ], viewMat*corners[ 6 ], viewMat*corners[ 4 ], viewMat*corners[ 7 ] ); } else { rect.SetNormals( corners[ 5 ], corners[ 6 ], corners[ 4 ], corners[ 7 ] ); } } // Queue passes from mat for ( var i = 0; i < Technique.PassCount; i++ ) { var pass = Technique.GetPass( i ); sm.InjectRenderWithPass( pass, CompositorManager.Instance.TexturedRectangle2D, false /*don't allow replacement of shadow passes*/ ); } }
/// <summary> /// Called to shutdown the engine and dispose of all it's resources. /// </summary> public void Dispose() { // force the engine to shutdown Shutdown(); DDSCodec.Shutdown(); PVRTCCodec.Shutdown(); CompositorManager.Instance.SafeDispose(); OverlayManager.Instance.SafeDispose(); OverlayElementManager.Instance.SafeDispose(); FontManager.Instance.SafeDispose(); ArchiveManager.Instance.SafeDispose(); SkeletonManager.Instance.SafeDispose(); MeshManager.Instance.SafeDispose(); MaterialManager.Instance.SafeDispose(); ParticleSystemManager.Instance.SafeDispose(); ControllerManager.Instance.SafeDispose(); HighLevelGpuProgramManager.Instance.SafeDispose(); PluginManager.Instance.SafeDispose(); Pass.ProcessPendingUpdates(); ResourceGroupManager.Instance.SafeDispose(); // Note: The dispose method implementation of both ResourceBackgroundQueue and // DefaultWorkQueue internally calls Shutdown, so the direct call to Shutdown methods // isn't necessary in Root.Shutdown. ResourceBackgroundQueue.Instance.Dispose(); this._workQueue.Dispose(); this._workQueue = null; CodecManager.Instance.SafeDispose(); #if !XBOX360 PlatformManager.Instance.SafeDispose(); #endif this.activeRenderSystem = null; WindowEventMonitor.Instance.SafeDispose(); #if DEBUG ObjectManager.Instance.SafeDispose(); #endif LogManager.Instance.SafeDispose(); instance = null; }
/// <summary> /// /// </summary> /// <param name="sm"></param> /// <param name="rs"></param> public override void Execute( SceneManager sm, RenderSystem rs ) { MaterialManager.Instance.ActiveScheme = SetOperation.PreviousSchemeName; sm.IsLateMaterialResolving = SetOperation.PreviousLateResolving; }
public void Render(RenderSystem targetRenderSystem) { ((Axiom.SceneManagers.Multiverse.SceneManager)TerrainManager.Instance.SceneManager).SetTreeRenderPass(billboardMaterial.GetBestTechnique(0).GetPass(0), this); string lastTextureName = null; foreach (TreeBillboardRenderOp op in renderOps) { // set the texture if necessary if (op.textureName != lastTextureName) { targetRenderSystem.SetTexture(0, true, op.textureName); lastTextureName = op.textureName; } targetRenderSystem.SetAlphaRejectSettings(CompareFunction.Greater, (byte)op.alpha); targetRenderSystem.Render(op.renderOp); } }
public void Shutdown() { this._renderSystem.SafeDispose(); this._renderSystem = null; }
///<summary> /// Set current operation and target */ ///</summary> public void SetOperation(CompositorTargetOperation op, SceneManager sm, RenderSystem rs) { operation = op; sceneManager = sm; renderSystem = rs; currentOp = 0; lastOp = op.RenderSystemOperations.Count; }
/// <summary> /// Notifies all SceneManagers of the destination rendering system. /// </summary> /// <param name="system">Current destination render system.</param> public void SetRenderSystem(RenderSystem system) { // loop through each scene manager and set the new render system foreach(SceneManager sceneManager in sceneManagers.Values) { sceneManager.TargetRenderSystem = system; } }
private bool ProcessKey( int key ) { if ( key == -1 ) //ESCAPE { if ( _currentOption == null ) { // ESC at main menu _result = DialogResult.Cancel; return false; } else { // go back to main menu _currentOption = null; return true; } } if ( key == -2 ) //ENTER { if ( _currentOption == null ) { // at main menu if ( _numericInput == -1 ) { Axiom.Core.Root.Instance.RenderSystem = _currentSystem; _result = DialogResult.Ok; return false; } else if ( _numericInput >= 0 && _numericInput < _menuItems.Count ) { _currentOption = (ConfigOption)_menuItems[ _numericInput ]; return true; } return true; } else if ( _numericInput >= 0 && _numericInput < _currentOption.PossibleValues.Count ) { // at options menu and having an entered number _currentOption.Value = _currentOption.PossibleValues.Values[ _numericInput ].ToString(); if ( _currentOption.Name == "Render System" ) // About to change Renderers { _renderSystems = _currentOption; _currentSystem = _renderSystemList[ _numericInput ]; BuildOptions(); _currentOption = null; return true; } _currentOption = null; } return true; } return true; }