Beispiel #1
0
        public static void DrawRTP(RTPOutput200 gen)
        {
                        #if RTP
            GeneratorEditors.UpdateMaterial();
            gen.rtp = GraphWindow.current.mapMagic?.GetComponent <ReliefTerrain>();

            if (gen.rtp != null)
            {
                if (textureNames == null || textureNames.Length != gen.rtp.globalSettingsHolder.numLayers)
                {
                    textureNames = new string[gen.rtp.globalSettingsHolder.numLayers];
                }
                textureNames.Process(i => gen.rtp.globalSettingsHolder.splats[i] != null ? gen.rtp.globalSettingsHolder.splats[i].name : null);             //nb linq?
            }

            using (Cell.Line)
            {
                //Cell.current.margins = new Padding(4);
                //DrawCustomMaterialWarning(MapMagic.instance.terrainSettings);
                DrawRTPComponentWarning();
            }
                        #else
            using (Cell.LinePx(36)) Draw.Label("RTP is not installed or RTP \ncompatibility is disabled");
                        #endif

            using (Cell.LinePx(20)) GeneratorDraw.DrawLayersAddRemove(gen, ref gen.layers, inversed: true, unlinkBackground: true);
            using (Cell.LinePx(0)) GeneratorDraw.DrawLayersThemselves(gen, gen.layers, inversed: true, layerEditor: DrawRTPLayer);
        }
Beispiel #2
0
        public static void DrawMegaSplat(MegaSplatOutput200 gen)
        {
                        #if !__MEGASPLAT__
            using (Cell.LinePx(60))
                Draw.Helpbox("MicroSplat doesn't seem to be installed, or MicroSplat compatibility is not enabled in settings");
                        #endif
            if (GraphWindow.current.mapMagic != null)
            {
                using (Cell.LineStd)
                {
                    GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.terrainSettings.material, "Material");

                    if (Cell.current.valChanged)
                    {
                        GraphWindow.current.mapMagic.ApplyTerrainSettings();
                    }
                }

                using (Cell.LineStd)
                {
                                        #if __MEGASPLAT__
                    MegaSplatTextureList texList = GraphWindow.current.mapMagic.globals.megaSplatTexList as MegaSplatTextureList;
                    GeneratorDraw.DrawGlobalVar(ref texList, "TexList");
                    GraphWindow.current.mapMagic.globals.megaSplatTexList = texList;
                                        #endif
                }
            }

            using (Cell.LinePx(0)) CheckShader(gen);

            using (Cell.LinePx(20)) GeneratorDraw.DrawLayersAddRemove(gen, ref gen.layers, inversed: true);
            using (Cell.LinePx(0)) GeneratorDraw.DrawLayersThemselves(gen, gen.layers, inversed: true, layerEditor: DrawCTSLayer);
        }
Beispiel #3
0
        public static void DrawCTS(MatrixGenerators.CTSOutput200 gen)
        {
                        #if CTS_PRESENT
            CTS.CTSProfile profile = GraphWindow.current.mapMagic?.globals.ctsProfile as CTS.CTSProfile;

            if (GraphWindow.current.mapMagic != null)
            {
                using (Cell.LineStd)
                {
                    CTS.CTSProfile newProfile = Draw.ObjectField(profile, "Profile");
                    if (profile != newProfile)
                    {
                        GraphWindow.current.mapMagic.globals.ctsProfile = newProfile;
                        profile = newProfile;
                    }
                }
            }
            else
            {
                using (Cell.LinePx(18 + 18)) Draw.Label("Not assigned to current \nMapMagic object");
            }

//			using (Cell.LineStd)
//				if (Draw.Button("Update Shader"))
//					CTS_UpdateShader(ctsProfile, MapMagic.instance.terrainSettings.material);

            //populating texture names
            if (profile != null)
            {
                List <CTS.CTSTerrainTextureDetails> textureDetails = profile.TerrainTextures;
                if (textureNames == null || textureNames.Length != textureDetails.Count)
                {
                    textureNames = new string[textureDetails.Count];
                }
                textureNames.Process(i => textureDetails[i].m_name);
            }
                        #else
            using (Cell.LinePx(60))
                Draw.Helpbox("CTS doesn't seem to be installed, or CTS compatibility is not enabled in settings");
                        #endif

            using (Cell.LinePx(20)) GeneratorDraw.DrawLayersAddRemove(gen, ref gen.layers, inversed: true, unlinkBackground: true);
            using (Cell.LinePx(0)) GeneratorDraw.DrawLayersThemselves(gen, gen.layers, inversed: true, layerEditor: DrawCTSLayer);
        }
        public static void DrawMicroSplat(MicroSplatOutput200 gen)
        {
                        #if !__MICROSPLAT__
            using (Cell.LinePx(60))
                Draw.Helpbox("MicroSplat doesn't seem to be installed, or MicroSplat compatibility is not enabled in settings");
                        #endif
            if (GraphWindow.current.mapMagic != null)
            {
                using (Cell.LineStd)
                {
                    //Cell.current.fieldWidth = 0.5f;
                    using (Cell.LineStd) GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.terrainSettings.material, "Material");

                    using (Cell.LineStd)
                    {
                        Cell.current.fieldWidth = 0.15f;
                        GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.globals.assignComponent, "Set Component");
                    }

                                        #if __MICROSPLAT__
                    if (GraphWindow.current.mapMagic.globals.assignComponent)
                    {
                        using (Cell.LineStd)
                            GraphWindow.current.mapMagic.globals.microSplatPropData = GeneratorDraw.DrawGlobalVar <MicroSplatPropData>(
                                GraphWindow.current.mapMagic.globals.microSplatPropData == null ? null : (MicroSplatPropData)GraphWindow.current.mapMagic.globals.microSplatPropData,
                                "PropData");
                    }
                                        #endif

                    if (Cell.current.valChanged)
                    {
                        GraphWindow.current.mapMagic.ApplyTerrainSettings();
                    }
                }
            }

            using (Cell.LinePx(0)) CheckShader(gen);
            using (Cell.LinePx(0)) CheckCustomSplatmaps(gen);

            using (Cell.LinePx(20)) GeneratorDraw.DrawLayersAddRemove(gen, ref gen.layers, inversed: true);
            using (Cell.LinePx(0)) GeneratorDraw.DrawLayersThemselves(gen, gen.layers, inversed: true, layerEditor: DrawMicroSplatLayer);
        }
Beispiel #5
0
        public static void DrawCustomShaderOutput(MatrixGenerators.CustomShaderOutput200 gen)
        {
            MatrixGenerators.CustomShaderOutput200 cso = (MatrixGenerators.CustomShaderOutput200)gen;
            string[] controlTextureNames        = MatrixGenerators.CustomShaderOutput200.controlTextureNames;
            string[] controlTextureChannelNames = MatrixGenerators.CustomShaderOutput200.controlTextureNames;

            int texturesCount = MatrixGenerators.CustomShaderOutput200.controlTextureNames.Length;

            using (Cell.LineStd) Draw.Field(ref texturesCount, "Textures Count");
            if (texturesCount != MatrixGenerators.CustomShaderOutput200.controlTextureNames.Length)
            {
                ArrayTools.Resize(ref controlTextureNames, texturesCount, i => "_ControlTexture" + i);
            }

            using (Cell.LineStd) Draw.Label("Texture Names:");
            for (int i = 0; i < controlTextureNames.Length; i++)
            {
                using (Cell.LinePx(20))
                {
                    Cell.current.fieldWidth = 0.9f;
                    Draw.Field(ref controlTextureNames[i], i + ":");
                }
            }

            if (controlTextureNames == null || controlTextureChannelNames.Length != controlTextureNames.Length * 4)
            {
                controlTextureChannelNames = new string[controlTextureNames.Length * 4];
            }
            for (int i = 0; i < controlTextureNames.Length; i++)
            {
                controlTextureChannelNames[i * 4]     = controlTextureNames[i] + " R";
                controlTextureChannelNames[i * 4 + 1] = controlTextureNames[i] + " G";
                controlTextureChannelNames[i * 4 + 2] = controlTextureNames[i] + " B";
                controlTextureChannelNames[i * 4 + 3] = controlTextureNames[i] + " A";
            }

            //using (Cell.Line)
            //	DrawCustomMaterialWarning();

            using (Cell.LinePx(20)) GeneratorDraw.DrawLayersAddRemove(gen, ref gen.layers, inversed: true);
            using (Cell.LinePx(0)) GeneratorDraw.DrawLayersThemselves(gen, gen.layers, inversed: true, layerEditor: DrawCustomShaderLayer);
        }
Beispiel #6
0
 public static void TexturesGeneratorEditor(TexturesOutput200 gen)
 {
     using (Cell.LinePx(20)) GeneratorDraw.DrawLayersAddRemove(gen, ref gen.layers, inversed: true);
     using (Cell.LinePx(0)) GeneratorDraw.DrawLayersThemselves(gen, gen.layers, inversed: true, layerEditor: DrawTexturesLayer);
 }
Beispiel #7
0
 public static void NormalizeGeneratorEditor(Normalize200 gen)
 {
     using (Cell.LinePx(20)) GeneratorDraw.DrawLayersAddRemove(gen, ref gen.layers, inversed: true);
     using (Cell.LinePx(0)) GeneratorDraw.DrawLayersThemselves(gen, gen.layers, inversed: true, layerEditor: DrawNormalizeLayer);
 }
Beispiel #8
0
 public static void BlendGeneratorEditor(Blend200 gen)
 {
     using (Cell.LinePx(20)) GeneratorDraw.DrawLayersAddRemove(gen, ref gen.layers, inversed: true);
     using (Cell.LinePx(0)) GeneratorDraw.DrawLayersThemselves(gen, gen.layers, inversed: true, layerEditor: DrawBlendLayer);
 }
Beispiel #9
0
        public static void DrawMicroSplat(MicroSplatOutput200 gen)
        {
                        #if !__MICROSPLAT__
            using (Cell.LinePx(60))
                Draw.Helpbox("MicroSplat doesn't seem to be installed, or MicroSplat compatibility is not enabled in settings");
                        #endif
            if (GraphWindow.current.mapMagic != null)
            {
                using (Cell.LineStd)
                {
                    //Cell.current.fieldWidth = 0.5f;
                    using (Cell.LineStd) GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.terrainSettings.material, "Material");

                    using (Cell.LinePx(0))
                        using (new Draw.FoldoutGroup(ref gen.guiAdvanced, "Advanced"))
                            if (gen.guiAdvanced)
                            {
                                using (Cell.LineStd)
                                {
                                    Cell.current.fieldWidth = 0.15f;
                                    GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.globals.assignComponent, "Set Component");
                                }

                                                        #if __MICROSPLAT__
                                if (GraphWindow.current.mapMagic.globals.assignComponent)
                                {
                                    using (Cell.LineStd)
                                        GraphWindow.current.mapMagic.globals.microSplatPropData = GeneratorDraw.DrawGlobalVar <MicroSplatPropData>(
                                            GraphWindow.current.mapMagic.globals.microSplatPropData == null ? null : (MicroSplatPropData)GraphWindow.current.mapMagic.globals.microSplatPropData,
                                            "PropData");
                                }
                                                        #endif

                                //using (Cell.LineStd)
                                //	Draw.Label("Apply Type");

                                using (Cell.LineStd)
                                    GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.globals.microSplatApplyType, "Apply Type");

                                using (Cell.LineStd)
                                {
                                    Cell.current.fieldWidth = 0.15f;
                                    Cell.current.disabled   = GraphWindow.current.mapMagic.globals.microSplatApplyType == Globals.MicroSplatApplyType.Splats;                         //no tex names when applying
                                    GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.globals.useCustomControlTextures, "Custom Splatmaps");
                                }

                                using (Cell.LineStd)
                                {
                                    Cell.current.fieldWidth = 0.15f;
                                    Cell.current.disabled   = GraphWindow.current.mapMagic.globals.microSplatApplyType == Globals.MicroSplatApplyType.Splats;                         //no normals texture when applying only splats
                                    GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.globals.microSplatNormals, "Add Normals Tex");
                                }

                                //using (Cell.LineStd)
                                //	{ Cell.current.fieldWidth = 0.15f; GeneratorDraw.DrawGlobalVar(ref GraphWindow.current.mapMagic.globals.microSplatTerrainDescriptor, "Add Descriptor"); }
                            }

                    if (Cell.current.valChanged)
                    {
                        GraphWindow.current.mapMagic.ApplyTerrainSettings();
                    }
                }
            }
            else
            {
                using (Cell.LinePx(18 + 18)) Draw.Label("Not assigned to current \nMapMagic object");
            }

            using (Cell.LinePx(0)) CheckShader(gen);
            //using (Cell.LinePx(0)) CheckCustomSplatmaps(gen);

            using (Cell.LinePx(20)) GeneratorDraw.DrawLayersAddRemove(gen, ref gen.layers, inversed: true, unlinkBackground: true);
            using (Cell.LinePx(0)) GeneratorDraw.DrawLayersThemselves(gen, gen.layers, inversed: true, layerEditor: DrawMicroSplatLayer);
        }