示例#1
0
        public void Init()
        {
            Console.WriteLine("GL version: " + GL.GetString(StringName.Version));
            TextureCollection.Load();
            MeshCollection.Load();
            BasicShader.MakeInstance();
            ForAmbientShader.MakeInstance();
            ForDirectionalShader.MakeInstance();
            ForShadowDirShader.MakeInstance();
            ForPointShader.MakeInstance();
            ShadowGenShader.MakeInstance();
            ColorShader.MakeInstance();
            TextureShader.MakeInstance();
            LiquidShader.MakeInstance(new Texture(Util.PATH + "res/textures/liquid.png"));
            BladeShader.MakeInstance();
            OrthoRenderEngine.Init();
            TooltipHelper  = new TooltipHelper();
            ErrortipHelper = new ErrorTooltipHelper();
            Localization.LoadFromFile(Util.PATH + "res/localization/no_NO.txt");
            MainMenu  = new MainMenuView(this);
            PauseMenu = new PauseMenuView(this);

            CurrentScene = MakeMenuScene();
            CurrentView  = MainMenu;
            CurrentView.OnViewUsed(null);
        }
示例#2
0
 public static void MakeInstance()
 {
     if (Instance == null)
     {
         Instance = new ForShadowDirShader();
     }
 }
示例#3
0
        public INormalShader GetUseShader(Scene s, Vector3 eyePos)
        {
            VP = Matrix4.LookAt(stdPos, stdPos + LightDirection, Vector3.UnitY) * orthoMatrix;

            shadowMap.UpdateShadowMap(s, VP);

            //OrthoRenderEngine.DrawColoredTextureOnEntireScreen (Util.White, shadowMap.ShadowMapId);

            ForShadowDirShader shader = ForShadowDirShader.Instance;

            shader.Bind();
            shader.SetLightColor(LightColor);
            shader.SetLightIntensity(LightIntensity);
            shader.SetLightDirection(LightDirection);
            shader.SetShadowMap(shadowMap.ShadowMapId);
            shader.SetShadowMapMatrix(ref VP);
            return(shader);
        }