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); }
public static void MakeInstance() { if (Instance == null) { Instance = new ForShadowDirShader(); } }
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); }