Пример #1
0
        public DayLight(Map map, double timeOfDay, TimeSpan startTime)
        {
            m_graphics = new Graphics();
            m_timeOfDay = timeOfDay;
            //m_currentTime = timeOfDay;
            m_map = map;
            m_maxLight = new Color4(1, 1, 1, 1);
            //m_maxLight = new Color4(0.6f, 0.6f, 0.6f, 1);
            m_maxDark = new Color4(0.1f, 0.1f, 0.05f, 1);

            m_startTime = startTime;
            m_currentTime = (1 - ConvertTimeToDayProgress(m_startTime)) * m_timeOfDay;
            m_timeStartDay = new TimeSpan(07, 0, 0);
            m_timeStartNight = new TimeSpan(19, 0, 0);
            m_timeTransition = new TimeSpan(2, 0, 0);

            //Framebuffers
            m_framebufferAllLight = new Framebuffer();
            m_textureLight = new Texture2D();
            var size = Engine.Display.GetSize();
            m_textureLight.SetData<Color4ub>(size.X, size.Y, null);
            m_framebufferAllLight.Attach(m_textureLight);
        }
Пример #2
0
 public static void BindFramebuffer(Framebuffer framebuffer, uint target = FRAMEBUFFER)
 {
     BindFramebuffer(target, framebuffer == null ? 0 : framebuffer.Name);
 }