Beispiel #1
0
        /// <summary>
        /// Sets the environment render targets.
        /// </summary>
        private static void SetEnvironmentRenderTargets()
        {
            var rt1 = MyRender.GetRenderTargetCube(MyRenderTargets.EnvironmentCube);
            var rt2 = MyRender.GetRenderTargetCube(MyRenderTargets.EnvironmentCubeAux);
            var rt3 = MyRender.GetRenderTargetCube(MyRenderTargets.AmbientCube);
            var rt4 = MyRender.GetRenderTargetCube(MyRenderTargets.AmbientCubeAux);
            var rt5 = MyRender.GetRenderTarget(MyRenderTargets.EnvironmentMap);

            MyEnvironmentMap.SetRenderTargets((CubeTexture)rt1, (CubeTexture)rt2, (CubeTexture)rt3, (CubeTexture)rt4, (Texture)rt5);
        }
        public override void RecreateControls(bool contructor)
        {
            Controls.Clear();



            m_scale = 0.7f;

            AddCaption(new System.Text.StringBuilder("Render Model FX"), Color.Yellow.ToVector4());

            MyGuiControlLabel label = new MyGuiControlLabel(this, new Vector2(0.01f, -m_size.Value.Y / 2.0f + 0.07f), null, new System.Text.StringBuilder("(press ALT to share focus)"), Color.Yellow.ToVector4(), MyGuiConstants.LABEL_TEXT_SCALE * 0.7f,
                                                            MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_TOP);

            Controls.Add(label);

            m_currentPosition = -m_size.Value / 2.0f + new Vector2(0.02f, 0.10f);


            m_currentPosition.Y += 0.01f;

            /*
             * AddLabel(new StringBuilder("Channels"), Color.Yellow.ToVector4(), 1.2f);
             * AddSlider(new StringBuilder("Channel0"), 0, 1.0f, null, MemberHelper.GetMember(() => MyRender.Channel0Intensity));
             * AddSlider(new StringBuilder("Channel1"), 0, 1.0f, null, MemberHelper.GetMember(() => MyRender.Channel1Intensity));
             */
            AddLabel(new StringBuilder("Environmental maps"), Color.Yellow.ToVector4(), 1.2f);
            AddSlider(new StringBuilder("LOD0 max distance"), 50.0f, 1000.0f, null, MemberHelper.GetMember(() => MyEnvironmentMap.NearDistance));
            AddSlider(new StringBuilder("LOD1 max distance"), 50.0f, 1000.0f, null, MemberHelper.GetMember(() => MyEnvironmentMap.FarDistance));
            AddButton(new StringBuilder("Rebuild"), delegate { MyEnvironmentMap.Reset(); });

            var listbox = AddListbox();

            listbox.ItemSelect += new OnListboxItemSelect(listbox_ItemSelect);
            listbox.AddItem(-1, new StringBuilder("None"));
            for (int i = 0; i < MyVoxelMaterials.GetMaterialsCount(); i++)
            {
                MyMwcVoxelMaterialsEnum mat = (MyMwcVoxelMaterialsEnum)i;
                listbox.AddItem((int)mat, new StringBuilder(mat.ToString()));
            }
            listbox.SetSelectedItem(-1);
        }