public MRenderDoubleLocalEst(MScene scene, IRayTracer rayTracer, int nRays, float wMin, ILog log = null) { NRays = nRays; WMin = wMin; Scene = scene; RayTracer = rayTracer; Log = log; }
public TempScene Initialize(MScene mScene, string path, CScene controller) { var sO = Create(path); sO.mScene = mScene; sO.path = path; sO.currentSceneController = controller; return(sO); }
public void Setup() { Globals.VERSION = MVersion.VERSION; Globals.SetProjectPath(@".\"); _scene = new MScene(false, true); _scene.SetupInitialObjects(); _scene.Play(); }
private void PrepareToSync(Avrs project, MScene newScene, MScene oldScene, AvrsDeserializer deserializer) { this.Repaint(); if (oldScene == null || project.root.transform.childCount == 0) { // Instanzia scena deserializer.InstantiateScene(project.root.transform, (GameObject go) => { }, (float p) => { }, (string e) => { UnityEngine.Debug.Log("error " + e); } ); } else { // Sync //s.mScene.assets.materialData.Clear(); _tempScene.mScene.assets.textureData.Clear(); _tempScene.mScene.assets.meshData.Clear(); SyncScene(project.root, ref newScene, ref deserializer); /*foreach (var vScene in viewsInScene) * { * if (vScene == null) * continue; * * var model = deserializer.sceneController.scene.mObjectWrapper.Find(m => m.id == vScene.model.id); * * if (model != null) * { * model = vScene.model; * } * } * * _tempScene.mScene = deserializer.sceneController.scene; * _tempScene.currentSceneController = deserializer.sceneController;*/ } }
private void btnViewIndependentDLE_Click(object sender, EventArgs e) { // Parameters Scene = new TestScenes.SceneCreatorSobolevEx().CreateScene(); // Сцена int maxDivideDeep = 10; // Максимальная глубина разбиения грани, больше 14 лучше не задавать даже для Соболева int nTheta = 8; // Число углов разбиения для расчета яркости по зенитному углу int nPhi = 16; // Число углов разбиения для расчета яркости по азимутальному углу int nSH = 8; // Число гармоник при аппроксимации через СГ (MVertexIlluminanceApproximationMode.SphericalHarmonics) int nRays = 100; // Число лучей для двойной локальной float wMin = 0.1f; // Минимульный вес луча марковской цепи для локальной // Create MScene var mscene = new MScene(Scene, new MeshSettings(maxDivideDeep, nTheta, nPhi, nSH)); sceneViewer.MScene = mscene; MScene.BuildStaticMinimalMesh(mscene); FormRenderLog formLog = new FormRenderLog(); formLog.Show(); Application.DoEvents(); using (IRayTracer rayTracer = new RayTracerEmbree(Scene)) { formLog.Message("Render direct"); var renderDirect = new MRenderDirectLight(mscene, rayTracer, formLog); renderDirect.Calculate(); formLog.Message("Render indirect"); var renderIndirect = new MRenderDoubleLocalEst(mscene, rayTracer, nRays, wMin, formLog); renderIndirect.Calculate(); formLog.Message("Start update statistics", 0); mscene.UpdateStatistics(); formLog.Message("End update statistics", 0); } sceneViewer.IlluminanceApproximationMode = MVertexIlluminanceApproximationMode.Spline; sceneViewer.IlluminanceMode = MVertexIlluminanceMode.Full; sceneViewer.DrawMode = DrawMode.CalculatedMScene; }
public MMouseHandler(GLControl c) { if (Globals._scene == null) { Console.WriteLine("MMouseHandler ERROR: Scene is not initialized"); return; } _Scene = Globals._scene; _glcontrol = c; c.MouseWheel += GlControl1_MouseWheel; c.MouseDown += C_MouseDown; c.MouseUp += C_MouseUp; c.MouseMove += C_MouseMove; c.MouseDoubleClick += C_MouseDoubleClick; MMessageBus.ChangeModeHandler += MMessageBus_ChangeModeHandler; Globals.Network.TeleportHandler += Network_TeleportHandler; MMessageBus.AvatarChangedHandler += MMessageBus_AvatarChangedHandler; }
private void SyncScene(GameObject root, ref MScene newSceneModel, ref AvrsDeserializer deserializer) { Sync(root, deserializer, newSceneModel.mObjectWrapper); }
public MRenderDirectLight(MScene scene, IRayTracer rayTracer, ILog log = null) { Scene = scene; RayTracer = rayTracer; Log = log; }