Пример #1
0
 /// <summary>
 /// Loads any additional final data.
 /// </summary>
 public override void PostLoad()
 {
     MainContext.Engine = this;
     FogMaxDist         = () => ZFar();
     GraphicsUtil.CheckError("PostLoad - Pre");
     SysConsole.Output(OutputType.INIT, "GameEngine configuring graphics...");
     GL.Enable(EnableCap.CullFace);
     GL.CullFace(CullFaceMode.Front);
     SysConsole.Output(OutputType.INIT, "GameEngine loading main 3D view...");
     if (!IsSubEngine)
     {
         SubSize = new Vector2i(Window.Width, Window.Height);
     }
     MainView.Width  = SubSize.X;
     MainView.Height = SubSize.Y;
     if (IsSubEngine)
     {
         MainView.GenerateFBO();
     }
     MainView.Generate(this, SubSize.X, SubSize.Y);
     MainView.Render3D        = Render3D;
     MainView.PostFirstRender = ReverseEntities;
     MainView.CameraUp        = () => MainCamera.Up;
     AudioCamera = MainCamera;
     ZFar        = () => MainCamera.ZFar;
     GraphicsUtil.CheckError("PostLoad - Post");
 }
Пример #2
0
        public void FixInvRender()
        {
            MainItemView.Render3D = RenderMainItem;
            foreach (LightObject light in MainItemView.Lights)
            {
                foreach (Light li in light.InternalLights)
                {
                    li.Destroy();
                }
            }
            MainItemView.Lights.Clear();
            MainItemView.RenderClearAlpha = 0f;
            SkyLight tlight = new SkyLight(new Location(0, 0, 10), 64, Location.One, new Location(0, -1, -1).Normalize(), 64, false);

            MainItemView.Lights.Add(tlight);
            MainItemView.GenerateFBO();
            MainItemView.Generate(this, Window.Width, Window.Height);
        }
Пример #3
0
        public void FixInvRender()
        {
            MainItemView.Render3D = RenderMainItem;
            foreach (LightObject light in MainItemView.Lights)
            {
                foreach (Light li in light.InternalLights)
                {
                    li.Destroy();
                }
            }
            MainItemView.FastOnly = true;
            MainItemView.Lights.Clear();
            MainItemView.RenderClearAlpha = 0f;
            SkyLight tlight = new SkyLight(new Location(0, 0, 10), 64, Location.One, new Location(0, -1, -1).Normalize(), 64, false, 64);

            MainItemView.Lights.Add(tlight);
            MainItemView.Width  = Window.Width;
            MainItemView.Height = Window.Height;
            MainItemView.GenerateFBO();
            MainItemView.Generate(this, Window.Width, Window.Height); // TODO: Change Width/Height here and above to actual viewed size?
        }