void InitializeThreadPool() { if (WorkerThreads <= 0) { WorkerThreads = Mathf.Max(Environment.ProcessorCount / 2, 1); // half of CPU threads; non-busy idle } m_workerThreadPool = new AmplifyMotion.WorkerThreadPool(); m_workerThreadPool.InitializeAsyncUpdateThreads(WorkerThreads, SystemThreadPool); }
void OnEnable() { m_camera = GetComponent <Camera>(); if (!CheckSupport()) { enabled = false; return; } if (WorkerThreads <= 0) { WorkerThreads = Mathf.Max(Environment.ProcessorCount / 2, 1); // half of CPU threads; non-busy idle } m_workerThreadPool = new AmplifyMotion.WorkerThreadPool(); m_workerThreadPool.InitializeAsyncUpdateThreads(WorkerThreads, SystemThreadPool); m_starting = true; if (!CreateMaterials()) { Debug.LogError("[AmplifyMotion] Failed loading or compiling necessary shaders. Please try reinstalling Amplify Motion or contact [email protected]"); enabled = false; return; } if (AutoRegisterObjs) { UpdateActiveObjects(); } InitializeCameras(); UpdateRenderTextures(true); m_linkedCameras.TryGetValue(m_camera, out m_baseCamera); if (m_baseCamera == null) { Debug.LogError("[AmplifyMotion] Failed setting up Base Camera. Please contact [email protected]"); enabled = false; return; } if (m_currentPostProcess != null) { m_currentPostProcess.enabled = true; } m_qualityLevel = QualityLevel; }
void OnEnable() { if (!CheckSupport()) { enabled = false; return; } if (workerThreads <= 0) { workerThreads = Mathf.Max(Environment.ProcessorCount / 2, 1); // half of CPU threads; non-busy idle } m_workerThreadPool = new AmplifyMotion.WorkerThreadPool(); m_workerThreadPool.InitializeAsyncUpdateThreads(workerThreads); m_starting = true; CreateMaterials(); if (AutoRegisterObjs) { UpdateActiveObjects(); } InitializeCameras(); UpdateRenderTextures(); m_linkedCameras.TryGetValue(this.GetComponent <Camera>(), out m_baseCamera); if (m_baseCamera == null) { Debug.LogError("[AmplifyMotion] Failed miserably during initialization. Disabling."); enabled = false; return; } if (m_currentPostProcess != null) { m_currentPostProcess.enabled = true; } m_qualityLevel = QualityLevel; }
void OnEnable() { if (!CheckSupport()) { enabled = false; return; } if (workerThreads <= 0) { workerThreads = Environment.ProcessorCount; } m_workerThreadPool = new AmplifyMotion.WorkerThreadPool(); m_workerThreadPool.InitializeAsyncUpdateThreads(workerThreads); m_starting = true; CreateMaterials(); if (AutoRegisterObjs) { UpdateActiveObjects(); } InitializeCameras(); UpdateRenderTextures(); m_linkedCameras.TryGetValue(this.GetComponent <Camera>(), out m_baseCamera); if (m_currentPostProcess != null) { m_currentPostProcess.enabled = true; } m_qualityLevel = QualityLevel; }
void InitializeThreadPool() { if ( WorkerThreads <= 0 ) WorkerThreads = Mathf.Max( Environment.ProcessorCount / 2, 1 ); // half of CPU threads; non-busy idle m_workerThreadPool = new AmplifyMotion.WorkerThreadPool(); m_workerThreadPool.InitializeAsyncUpdateThreads( WorkerThreads, SystemThreadPool ); }
void OnEnable() { m_camera = GetComponent<Camera>(); if ( !CheckSupport() ) { enabled = false; return; } if ( WorkerThreads <= 0 ) WorkerThreads = Mathf.Max( Environment.ProcessorCount / 2, 1 ); // half of CPU threads; non-busy idle m_workerThreadPool = new AmplifyMotion.WorkerThreadPool(); m_workerThreadPool.InitializeAsyncUpdateThreads( WorkerThreads, SystemThreadPool ); m_starting = true; if ( !CreateMaterials() ) { Debug.LogError( "[AmplifyMotion] Failed loading or compiling necessary shaders. Please try reinstalling Amplify Motion or contact [email protected]" ); enabled = false; return; } if ( AutoRegisterObjs ) UpdateActiveObjects(); InitializeCameras(); UpdateRenderTextures( true ); m_linkedCameras.TryGetValue( m_camera, out m_baseCamera ); if ( m_baseCamera == null ) { Debug.LogError( "[AmplifyMotion] Failed setting up Base Camera. Please contact [email protected]" ); enabled = false; return; } if ( m_currentPostProcess != null ) m_currentPostProcess.enabled = true; m_qualityLevel = QualityLevel; }