void InitDebugMenuGraphicsOption() { var graphicsOptionNode = new DebugMenuNodeInternal() { Label = "描画オプション", ExecFunc = GraphicsOptionBase.Instance.GetCurrentSetting, }; DebugMenu.AddChild(DebugMenu.RootNode.Label, graphicsOptionNode); var graphicsOptionLabel = DebugMenu.RootNode.Label + "." + graphicsOptionNode.Label; DebugMenu.AddChild(graphicsOptionLabel, new DebugMenuNodeExecutable() { Label = "適用", ExecFunc = GraphicsOptionBase.Instance.Apply, }); DebugMenu.AddChild(graphicsOptionLabel, new DebugMenuNodeTunableBool { Label = "VSync有効", Getter = () => { return GraphicsOptionBase.Instance.VSyncEnable; }, Setter = (value) => { GraphicsOptionBase.Instance.VSyncEnable = value; }, }); DebugMenu.AddChild(graphicsOptionLabel, new DebugMenuNodeTunableBool { Label = "MSAA有効", Getter = () => { return GraphicsOptionBase.Instance.MSAAEnable; }, Setter = (value) => { GraphicsOptionBase.Instance.MSAAEnable = value; }, }); DebugMenu.AddChild(graphicsOptionLabel, new DebugMenuNodeTunableBool { Label = "フルスクリーン", Getter = () => { return GraphicsOptionBase.Instance.IsFullScreen; }, Setter = (value) => { GraphicsOptionBase.Instance.IsFullScreen = value; }, }); var resolutionNode = new DebugMenuNodeSelectable { Label = "解像度", }; foreach (var resolution in GraphicsOptionBase.Instance.Resolutions) { resolutionNode.AddChoice( string.Format("{0}x{1}", resolution.Width, resolution.Height), () => { GraphicsOptionBase.Instance.Resolution.Width = resolution.Width; GraphicsOptionBase.Instance.Resolution.Height = resolution.Height; }); } DebugMenu.AddChild(graphicsOptionLabel, resolutionNode); }
void InitDebugMenu() { InitDebugMenuGraphicsOption(); var nodeShowTarget = new DebugMenuNodeSelectable() { Label = "レンダーターゲット表示", }; nodeShowTarget.AddChoice("なし", () => { ShowRenderTarget = false; }); nodeShowTarget.AddChoice("シャドウマップ", () => { ShowRenderTarget = true; TargetRenderParam.Texture = TextureFactory.Instance.CreateRenderTarget((int)RenderTargetType.ShadowMap0); }); nodeShowTarget.AddChoice("拡散反射マップ", () => { ShowRenderTarget = true; TargetRenderParam.Texture = TextureFactory.Instance.CreateRenderTarget((int)RenderTargetType.DiffuseLightMap); }); nodeShowTarget.AddChoice("鏡面反射マップ", () => { ShowRenderTarget = true; TargetRenderParam.Texture = TextureFactory.Instance.CreateRenderTarget((int)RenderTargetType.SpecularLightMap); }); nodeShowTarget.AddChoice("Gバッファ0", () => { ShowRenderTarget = true; TargetRenderParam.Texture = TextureFactory.Instance.CreateRenderTarget((int)RenderTargetType.GBuffer0); }); nodeShowTarget.AddChoice("Gバッファ1", () => { ShowRenderTarget = true; TargetRenderParam.Texture = TextureFactory.Instance.CreateRenderTarget((int)RenderTargetType.GBuffer1); }); /* nodeShowTarget.AddChoice("Gバッファ2", () => { ShowRenderTarget = true; TargetRenderParam.Texture = TextureFactory.Instance.CreateRenderTarget((int)RenderTargetType.GBuffer2); }); nodeShowTarget.AddChoice("Gバッファ3", () => { ShowRenderTarget = true; TargetRenderParam.Texture = TextureFactory.Instance.CreateRenderTarget((int)RenderTargetType.GBuffer3); }); */ DebugMenu.AddChild(DebugMenu.RootNode.Label, nodeShowTarget); var nodeExposure = new DebugMenuNodeTunableFloat() { Label = "HDR露出", Getter = () => { return ToneMappingRenderParameter.Exposure; }, Setter = (value) => { ToneMappingRenderParameter.Exposure = value; }, Interval = 0.1f, }; DebugMenu.AddChild(DebugMenu.RootNode.Label, nodeExposure); }