using UnityEngine; using System.Collections.Generic; #if UNITY_EDITOR using UnityEditor; #endif public class ftGlobalStorage : ScriptableObject { #if UNITY_EDITOR [System.Serializable] public struct AdjustedMesh { //[SerializeField] //public string assetPath; [SerializeField] public List meshName; [SerializeField] public List padding; [SerializeField] public List unwrapper; }; [System.Serializable] public struct TagData { [SerializeField] public int tag; [SerializeField] public int renderMode; [SerializeField] public int renderDirMode; [SerializeField] public int bitmask; [SerializeField] public bool computeSSS; [SerializeField] public int sssSamples; [SerializeField] public float sssDensity; [SerializeField] public Color sssColor; [SerializeField] public bool transparentSelfShadow; }; [System.Serializable] public enum Unwrapper { Default, xatlas }; [System.Serializable] public enum AtlasPacker { Default, xatlas } [System.Serializable] public enum DenoiserType { Optix5 = 5, // "Legacy denoiser" Optix6 = 6, // Default denoiser Optix7 = 7, // New denoiser OpenImageDenoise = 100 }; // UV adjustment [SerializeField] public List modifiedAssetPathList = new List(); [SerializeField] public List modifiedAssetPaddingHash = new List(); // Legacy [SerializeField] public List modifiedMeshList = new List(); [SerializeField] public List modifiedMeshPaddingList = new List(); [SerializeField] public List modifiedAssets = new List(); // UV overlap marks [SerializeField] public List assetList = new List(); [SerializeField] public List uvOverlapAssetList = new List(); // -1 = no UV1, 0 = no overlap, 1 = overlap [SerializeField] public bool xatlasWarningShown = false; [SerializeField] public bool foundCompatibleSetup = false; [SerializeField] public string gpuName = ""; [SerializeField] public bool runsNonRTX = true; [SerializeField] public bool runsOptix5 = true; [SerializeField] public bool runsOptix6 = true; [SerializeField] public bool runsOptix7 = true; [SerializeField] public bool runsOIDN = true; [SerializeField] public bool alwaysEnableRTX = false; [SerializeField] public bool checkerPreviewOn = false; [SerializeField] public bool rtSceneViewPreviewOn = false; // Defaults [SerializeField] public int renderSettingsBounces = 5; [SerializeField] public int renderSettingsGISamples = 16; [SerializeField] public float renderSettingsGIBackFaceWeight = 0; [SerializeField] public int renderSettingsTileSize = 512; [SerializeField] public float renderSettingsPriority = 2; [SerializeField] public float renderSettingsTexelsPerUnit = 20; [SerializeField] public bool renderSettingsForceRefresh = true; [SerializeField] public bool renderSettingsForceRebuildGeometry = true; [SerializeField] public bool renderSettingsPerformRendering = true; [SerializeField] public int renderSettingsUserRenderMode = 0; [SerializeField] public bool renderSettingsDistanceShadowmask = false; [SerializeField] public int renderSettingsSettingsMode = 0; [SerializeField] public bool renderSettingsFixSeams = true; [SerializeField] public bool renderSettingsDenoise = true; [SerializeField] public bool renderSettingsDenoise2x = false; [SerializeField] public bool renderSettingsEncode = true; [SerializeField] public int renderSettingsEncodeMode = 0; [SerializeField] public bool renderSettingsOverwriteWarning = false; [SerializeField] public bool renderSettingsAutoAtlas = true; [SerializeField] public bool renderSettingsUnwrapUVs = true; [SerializeField] public bool renderSettingsForceDisableUnwrapUVs = false; [SerializeField] public int renderSettingsMaxAutoResolution = 4096; [SerializeField] public int renderSettingsMinAutoResolution = 16; [SerializeField] public bool renderSettingsUnloadScenes = true; [SerializeField] public bool renderSettingsAdjustSamples = true; [SerializeField] public int renderSettingsGILODMode = 2; [SerializeField] public bool renderSettingsGILODModeEnabled = false; [SerializeField] public bool renderSettingsCheckOverlaps = false; [SerializeField] public bool renderSettingsSkipOutOfBoundsUVs = true; [SerializeField] public float renderSettingsHackEmissiveBoost = 1; [SerializeField] public float renderSettingsHackIndirectBoost = 1; [SerializeField] public string renderSettingsTempPath = ""; [SerializeField] public string renderSettingsOutPath = ""; [SerializeField] public bool renderSettingsUseScenePath = false; [SerializeField] public float renderSettingsHackAOIntensity = 0; [SerializeField] public int renderSettingsHackAOSamples = 16; [SerializeField] public float renderSettingsHackAORadius = 1; [SerializeField] public bool renderSettingsShowAOSettings = false; [SerializeField] public bool renderSettingsShowTasks = true; [SerializeField] public bool renderSettingsShowTasks2 = false; [SerializeField] public bool renderSettingsShowPaths = true; [SerializeField] public bool renderSettingsShowNet = true; [SerializeField] public bool renderSettingsOcclusionProbes = false; [SerializeField] public bool renderSettingsTexelsPerMap = false; [SerializeField] public float renderSettingsTexelsColor = 1; [SerializeField] public float renderSettingsTexelsMask = 1; [SerializeField] public float renderSettingsTexelsDir = 1; [SerializeField] public bool renderSettingsShowDirWarning = true; [SerializeField] public int renderSettingsRenderDirMode = 0; [SerializeField] public bool renderSettingsShowCheckerSettings = false; [SerializeField] public bool renderSettingsSamplesWarning = true; [SerializeField] public bool renderSettingsSuppressPopups = false; [SerializeField] public bool renderSettingsPrefabWarning = true; [SerializeField] public bool renderSettingsSplitByScene = false; [SerializeField] public bool renderSettingsSplitByTag = false; [SerializeField] public bool renderSettingsUVPaddingMax = false; [SerializeField] public bool renderSettingsPostPacking = true; [SerializeField] public bool renderSettingsHoleFilling = false; [SerializeField] public bool renderSettingsBeepOnFinish = false; [SerializeField] public bool renderSettingsExportTerrainAsHeightmap = true; [SerializeField] public bool renderSettingsRTXMode = false; [SerializeField] public int renderSettingsLightProbeMode = 1; [SerializeField] public bool renderSettingsClientMode = false; [SerializeField] public string renderSettingsServerAddress = "127.0.0.1"; [SerializeField] public int renderSettingsUnwrapper = 0; [SerializeField] public int renderSettingsDenoiserType = (int)DenoiserType.OpenImageDenoise; [SerializeField] public bool renderSettingsExportTerrainTrees = false; [SerializeField] public bool renderSettingsShowPerf = true; [SerializeField] public int renderSettingsSampleDiv = 1; //[SerializeField] //public bool renderSettingsLegacyDenoiser = false; [SerializeField] public AtlasPacker renderSettingsAtlasPacker = AtlasPacker.Default; [SerializeField] public bool renderSettingsBatchPoints = true; [SerializeField] public bool renderSettingsCompressVolumes = false; [SerializeField] public bool renderSettingsRTPVExport = true; [SerializeField] public bool renderSettingsRTPVSceneView = false; [SerializeField] public bool renderSettingsRTPVHDR = false; [SerializeField] public int renderSettingsRTPVWidth = 640; [SerializeField] public int renderSettingsRTPVHeight = 360; // Tag overrides [SerializeField] public List tagOverrides = new List(); // Temp public Dictionary modifiedMeshMap; //public string modifiedMeshPaddingMapAssetName; public List modifiedMeshPaddingArray; public List modifiedMeshUnwrapperArray; // For parallel import public List texSettingsKey; public List texSettingsVal; public void InitModifiedMeshMap(string assetPath) { modifiedMeshMap = new Dictionary(); var index = modifiedAssetPathList.IndexOf(assetPath); if (index < 0) return; var m = modifiedAssets[index]; for(int j=0; j(); str.padding = new List(); modifiedAssets.Add(str); } var assetPath = modifiedAssetPathList[a]; for(int i=0; i(); modifiedMeshPaddingList = new List(); } public int CalculatePaddingHash(int id) { string s = ""; var list = modifiedAssets[id].padding; for(int i=0; i(); for(int i=0; i