// -------------------------------------------------------------------- public virtual void InitializeBasicScene() { Scene = new Scene(OnyxInstance); Camera = new PerspectiveCamera("MainCamera", 0.5f, (float)mFrameBuffer.Width / (float)mFrameBuffer.Height); Camera.Transform.LocalPosition = new Vector3(0, 1.45f, 3f); Camera.Transform.LocalRotation = OpenTK.Quaternion.FromAxisAngle(new Vector3(1, 0, 0), -0.45f); Scene.ActiveCamera = Camera; mCamPivot = new SceneObject("camPivot"); mCamPivot.Parent = Scene.Root; Camera.Parent = mCamPivot; SceneObject grid = new SceneObject("Grid"); mGridRenderer = grid.AddComponent <GridRenderer>(); mGridRenderer.GenerateGridMesh(10, 10, 0.25f, 0.25f, new Vector3(0.8f, 0.8f, 0.8f)); mGridRenderer.Material = OnyxInstance.Resources.GetMaterial(BuiltInMaterial.UnlitVertexColor); SceneObject light = new SceneObject("Light"); Light lightC = light.AddComponent <Light>(); light.Parent = Scene.Root; light.Transform.LocalPosition = new Vector3(1, 2, 1); lightC.Intensity = 5; SceneObject test = new SceneObject("ReflectionProbe"); test.Parent = Scene.Root; test.Transform.LocalPosition = new Vector3(0, 0, 0); mReflectionProbe = test.AddComponent <ReflectionProbe>(); mReflectionProbe.Init(64); mReflectionProbe.Bake(OnyxInstance.Renderer); }
// -------------------------------------------------------------------- public void BakeReflection() { mReflectionProbe.Bake(OnyxInstance.Renderer); }