Пример #1
0
        public void Update(GameTime gameTime)
        {
            GameStats.UIWasUsed = false;
            if (GameSettings.ui_DrawUI)
            {
                screenCanvas.Update(gameTime, Input.GetMousePosition().ToVector2(), Vector2.Zero);

                _splitChance.Text.Clear();
                _splitChance.Text.Append("Split Chance: ");
                _splitChance.Text.Concat(_renderer.SplitChance, 2);

                _endChance.Text.Clear();
                _endChance.Text.Append("End Chance: ");
                _endChance.Text.Concat(_renderer.EndChance, 2);

                _scale.Text.Clear();
                _scale.Text.Append("Scale: 1 / ");
                _scale.Text.Concat(1 << _renderer.Scale);
                //_samplesBlock.Text.Clear();
                //_samplesBlock.Text.Append("Samples: ");
                //_samplesBlock.Text.Concat(_renderer.BlurSamples);

                //_passBlock.Text.Clear();
                //_passBlock.Text.Append("Passes: ");
                //_passBlock.Text.Concat(_renderer.BlurPasses);
            }

            //Safety
            if (!Input.IsLMBPressed() && GameStats.UIElementEngaged)
            {
                GameStats.UIElementEngaged = false;
            }
        }
Пример #2
0
        public void Update(GameTime gameTime)
        {
            GameStats.UIWasUsed = false;
            if (GameSettings.ui_DrawUI)
            {
                screenCanvas.Update(gameTime, Input.GetMousePosition().ToVector2(), Vector2.Zero);

                _intensityBlock.Text.Clear();
                _intensityBlock.Text.Append("Intensity: ");
                _intensityBlock.Text.Concat(_renderer.BlurIntensity, 2);

                _samplesBlock.Text.Clear();
                _samplesBlock.Text.Append("Samples: ");
                _samplesBlock.Text.Concat(_renderer.BlurSamples);

                _passBlock.Text.Clear();
                _passBlock.Text.Append("Passes: ");
                _passBlock.Text.Concat(_renderer.BlurPasses);
            }

            //Safety
            if (!Input.IsLMBPressed() && GameStats.UIElementEngaged)
            {
                GameStats.UIElementEngaged = false;
            }
        }
Пример #3
0
        public void Update(GameTime gameTime)
        {
            GameStats.UIWasUsed = false;
            if (GameSettings.ui_DrawUI)
            {
                screenCanvas.Update(gameTime, Input.GetMousePosition().ToVector2(), Vector2.Zero);

                _sizeBlock.Text.Clear();
                _sizeBlock.Text.Append("Bokeh Size: ");
                _sizeBlock.Text.Concat(_renderer.BokehSize, 2);


                _brightnessBlock.Text.Clear();
                _brightnessBlock.Text.Append("Brightness: ");
                _brightnessBlock.Text.Concat(_renderer.Brightness, 2);


                _downsizeBlock.Text.Clear();
                _downsizeBlock.Text.Append("Scale: 1 / ");
                _downsizeBlock.Text.Concat(1 << _renderer.Downsize);

                _polyCount.Text.Clear();
                _polyCount.Text.Append("PolyCount: ");
                _polyCount.Text.Concat(_renderer.PolyCount);
            }

            //Safety
            if (!Input.IsLMBPressed() && GameStats.UIElementEngaged)
            {
                GameStats.UIElementEngaged = false;
            }
        }
Пример #4
0
        public void Update(GameTime gameTime)
        {
            GUIControl.Update(Input.mouseLastState, Input.mouseState);
            if (GameSettings.ui_DrawUI)
            {
                _sizeBlock.Text.Clear();
                _sizeBlock.Text.Append("Model Size: ");
                _sizeBlock.Text.Concat((float)Math.Pow(10, GameSettings.m_size), 2);
                _sizeBlock.TextAlignment = GUIStyle.TextAlignment.Left;

                _roughnessBlock.Text.Clear();
                _roughnessBlock.Text.Append("Roughness: ");
                _roughnessBlock.Text.Concat(GameSettings.m_roughness, 2);

                _metallicBlock.Text.Clear();
                _metallicBlock.Text.Append("Metallic: ");
                _metallicBlock.Text.Concat(GameSettings.m_metallic, 2);

                _pomBlock.Text.Clear();
                _pomBlock.Text.Append("Height Scale: ");
                _pomBlock.Text.Concat(GameSettings.pomScale, 2);

                _pomQualityBlock.Text.Clear();
                _pomQualityBlock.Text.Append("POM Quality: ");
                _pomQualityBlock.Text.Concat(GameSettings.r_POMQuality, 2);

                _aoRadiiBlock.Text.Clear();
                _aoRadiiBlock.Text.Append("AO Radius: ");
                _aoRadiiBlock.Text.Concat(GameSettings.ao_Radii, 3);

                _aoSamplesBlock.Text.Clear();
                _aoSamplesBlock.Text.Append("AO Samples ppx: ");
                _aoSamplesBlock.Text.Concat(GameSettings.ao_Samples);

                _aoStrengthBlock.Text.Clear();
                _aoStrengthBlock.Text.Append("AO Strength: ");
                _aoStrengthBlock.Text.Concat(GameSettings.ao_Strength, 2);



                screenCanvas.Update(gameTime, Input.GetMousePosition().ToVector2(), Vector2.Zero);
            }

            ////Safety
            //if (!Input.IsLMBPressed() && GameStats.UIElementEngaged)
            //    GameStats.UIElementEngaged = false;
        }
Пример #5
0
        public void Update(GameTime gameTime)
        {
            GameStats.UIWasUsed = false;
            if (GameSettings.ui_DrawUI)
            {
                //_sizeBlock.Text.Clear();
                //_sizeBlock.Text.Append("Model Size: ");
                //_sizeBlock.Text.Concat((float)Math.Pow(10, GameSettings.m_size), 2);

                screenCanvas.Update(gameTime, Input.GetMousePosition().ToVector2(), Vector2.Zero);
            }

            //Safety
            if (!Input.IsLMBPressed() && GameStats.UIElementEngaged)
            {
                GameStats.UIElementEngaged = false;
            }
        }
        public void Update(GameTime gameTime)
        {
            GameStats.UIWasUsed = false;
            if (GameSettings.ui_DrawUI)
            {
                screenCanvas.Update(gameTime, Input.GetMousePosition().ToVector2(), Vector2.Zero);

                //_sizeBlock.Text.Clear();
                //_sizeBlock.Text.Append("Bokeh Size: ");
                //_sizeBlock.Text.Concat(_renderer.BokehSize, 2);
            }

            //Safety
            if (!Input.IsLMBPressed() && GameStats.UIElementEngaged)
            {
                GameStats.UIElementEngaged = false;
            }
        }
Пример #7
0
        public void Update(GameTime gameTime, bool isActive, TransformableObject selectedObject)
        {
            GameStats.UIIsHovered = false;
            if (!isActive || !GameSettings.e_enableeditor || !GameSettings.ui_enabled) return;

            if (GameStats.e_gizmoMode != _gizmoModePrevious)
            {
                _gizmoModePrevious = GameStats.e_gizmoMode;
                UpdateGizmoSelection(_gizmoModePrevious);
            }
            
            GUIControl.Update(Input.mouseLastState, Input.mouseState);

            if (GUIControl.GetMousePosition().X > _rightSideList.Position.X &&
                GUIControl.GetMousePosition().Y < _rightSideList.Dimensions.Y)
            {
                GameStats.UIIsHovered = true;
            }

             _leftSideList.IsHidden = !GameStats.e_EnableSelection;

            if (selectedObject != null)
            {
                //Check if cached, otherwise apply

                if (activeObjectName != selectedObject.Name || activeObjectPos != selectedObject.Position)
                {
                    _objectDescriptionList.IsHidden = false;
                    _objectDescriptionName.Text.Clear();
                    _objectDescriptionName.Text.Append(selectedObject.Name);
                    _objectDescriptionName.TextAlignment = GUIStyle.TextAlignment.Center;

                    _objectDescriptionPos.Text.Clear();
                    _objectDescriptionPos.Text.AppendVector3(selectedObject.Position);
                    _objectDescriptionPos.TextAlignment = GUIStyle.TextAlignment.Center;

                    activeObjectName = selectedObject.Name;
                    activeObjectPos = selectedObject.Position;
                }

                _objectButton1.IsHidden = true;
                _objectToggle0.IsHidden = true;
                _objectToggle1.IsHidden = true;
                _objectToggle2.IsHidden = true;
                _objectToggle3.IsHidden = true;
                _objectSlider0.IsHidden = true;
                _objectSlider1.IsHidden = true;
                _objectSlider2.IsHidden = true;
                _objectColorPicker1.IsHidden = true;

                if (selectedObject is PointLight)
                {
                    _objectToggle0.IsHidden = false;
                    _objectToggle1.IsHidden = false;
                    _objectToggle2.IsHidden = false;
                    _objectToggle3.IsHidden = false;
                    _objectSlider0.IsHidden = false;
                    _objectSlider1.IsHidden = false;
                    _objectSlider2.IsHidden = false;
                    _objectColorPicker1.IsHidden = false;

                    if (activeObject != selectedObject)
                    {
                        _objectToggle0.SetProperty(selectedObject, "IsEnabled");
                        _objectToggle0.Text = new StringBuilder("IsEnabled");

                        _objectToggle1.SetField(selectedObject, "IsVolumetric");
                        _objectToggle1.Text = new StringBuilder("Volumetric");

                        _objectToggle2.SetField(selectedObject, "CastShadows");
                        _objectToggle2.Text = new StringBuilder("Cast Shadows");

                        _objectToggle3.SetField(selectedObject, "CastSDFShadows");
                        _objectToggle3.Text = new StringBuilder("Cast SDF Shadows");

                        _objectSlider0.MinValue = 1.1f;
                        _objectSlider0.MaxValue = 200;

                        _objectSlider0.SetProperty(selectedObject, "Radius");
                        _objectSlider0.SetText(new StringBuilder("Radius: "));

                        _objectSlider1.MinValue = 0.01f;
                        _objectSlider1.MaxValue = 1000;

                        _objectSlider1.SetField(selectedObject, "Intensity");
                        _objectSlider1.SetText(new StringBuilder("Intensity: "));

                        _objectSlider2.SetValues("Shadow Softness: ", 1, 20, 1);
                        _objectSlider2.SetField(selectedObject, "ShadowMapRadius");

                        _objectColorPicker1.SetProperty(selectedObject, "Color");
                    }
                }

                else if (selectedObject is DirectionalLight)
                {
                    _objectToggle0.IsHidden = false;
                    _objectToggle2.IsHidden = false;
                    _objectSlider1.IsHidden = false;
                    _objectColorPicker1.IsHidden = false;

                    if (activeObject != selectedObject)
                    {
                        _objectToggle0.SetProperty(selectedObject, "IsEnabled");
                        _objectToggle0.Text = new StringBuilder("IsEnabled");

                        _objectToggle2.SetField(selectedObject, "CastShadows");
                        _objectToggle2.Text = new StringBuilder("Cast Shadows");
                        
                        _objectSlider1.MinValue = 0.01f;
                        _objectSlider1.MaxValue = 1000;

                        _objectSlider1.SetField(selectedObject, "Intensity");
                        _objectSlider1.SetText(new StringBuilder("Intensity: "));

                        _objectColorPicker1.SetProperty(selectedObject, "Color");
                    }
                }

                // Environment Sample!
                else if(selectedObject is EnvironmentSample)
                {
                    _objectButton1.IsHidden = false;
                    _objectToggle1.IsHidden = false;
                    _objectToggle2.IsHidden = false;

                    _objectSlider0.IsHidden = false;
                    _objectSlider1.IsHidden = false;

                    if (activeObject != selectedObject)
                    {
                        _objectButton1.ButtonObject = selectedObject;
                        _objectButton1.ButtonMethod = selectedObject.GetType().GetMethod("Update");

                        _objectButton1.Text = new StringBuilder("Update Cubemap");

                        _objectToggle1.ToggleObject = selectedObject;
                        _objectToggle1.ToggleField = selectedObject.GetType().GetField("AutoUpdate");

                        _objectToggle1.Toggle = (selectedObject as EnvironmentSample).AutoUpdate;

                        _objectToggle1.Text = new StringBuilder("Update on move");
                        
                        _objectToggle2.SetField(selectedObject, "UseSDFAO");
                        _objectToggle2.Text = new StringBuilder("Use SDFAO");

                        _objectSlider0.SetField(selectedObject, "SpecularStrength");
                        _objectSlider0.SetValues("Specular Strength: ", 0.01f, 1, 2);

                        _objectSlider1.SetField(selectedObject, "DiffuseStrength");
                        _objectSlider1.SetValues("Diffuse Strength: ", 0, 1, 2);
                    }
                }

                else if (selectedObject is DebugEntity)
                {
                    _objectSlider0.IsHidden = false;
                    _objectSlider1.IsHidden = false;
                    _objectSlider2.IsHidden = false;
                    if (activeObject != selectedObject)
                    {
                        //_objectSlider0.SetProperty(selectedObject, "SizeX");
                        //_objectSlider0.SetValues("Size X: ", 0.1f, 200, 2);
                        //_objectSlider1.SetProperty(selectedObject, "SizeY");
                        //_objectSlider1.SetValues("Size Y: ", 0.1f, 200, 2);
                        //_objectSlider2.SetProperty(selectedObject, "SizeZ");
                        //_objectSlider2.SetValues("Size Z: ", 0.1f, 200, 2);
                    }
                }

                activeObject = selectedObject;
            }
            else
            {
                _objectDescriptionList.IsHidden = true;
            }

            GuiCanvas.Update(gameTime, GUIControl.GetMousePosition(), Vector2.Zero);
        }