public override IEnumerable <Object> FetchDependencies(ISerializedFile file, bool isLog = false) { foreach (Object asset in base.FetchDependencies(file, isLog)) { yield return(asset); } foreach (Object asset in Deferred.FetchDependencies(file, isLog)) { yield return(asset); } foreach (Object asset in DeferredReflections.FetchDependencies(file, isLog)) { yield return(asset); } foreach (Object asset in ScreenSpaceShadows.FetchDependencies(file, isLog)) { yield return(asset); } foreach (Object asset in LegacyDeferred.FetchDependencies(file, isLog)) { yield return(asset); } foreach (Object asset in DepthNormals.FetchDependencies(file, isLog)) { yield return(asset); } foreach (Object asset in MotionVectors.FetchDependencies(file, isLog)) { yield return(asset); } foreach (Object asset in LightHalo.FetchDependencies(file, isLog)) { yield return(asset); } foreach (Object asset in LensFlare.FetchDependencies(file, isLog)) { yield return(asset); } if (IsReadAlwaysIncludedShaders(file.Version)) { foreach (PPtr <Shader> alwaysIncludedShader in AlwaysIncludedShaders) { yield return(alwaysIncludedShader.FetchDependency(file, isLog, ToLogString, "m_AlwaysIncludedShaders")); } } if (IsReadPreloadedShaders(file.Version)) { foreach (PPtr <ShaderVariantCollection> preloadedShader in PreloadedShaders) { yield return(preloadedShader.FetchDependency(file, isLog, ToLogString, "m_PreloadedShaders")); } } yield return(SpritesDefaultMaterial.FetchDependency(file, isLog, ToLogString, "m_SpritesDefaultMaterial")); yield return(CustomRenderPipeline.FetchDependency(file, isLog, ToLogString, "m_CustomRenderPipeline")); }
public YAMLNode ExportYAML(IExportContainer container) { YAMLMappingNode node = new YAMLMappingNode(); node.AddSerializedVersion(ToSerializedVersion(container.ExportVersion)); node.Add(NameName, Name); node.Add(PixelLightCountName, PixelLightCount); node.Add(ShadowsName, (int)Shadows); node.Add(ShadowResolutionName, (int)ShadowResolution); node.Add(ShadowProjectionName, (int)ShadowProjection); node.Add(ShadowCascadesName, (int)ShadowCascades); node.Add(ShadowDistanceName, ShadowDistance); node.Add(ShadowNearPlaneOffsetName, ShadowNearPlaneOffset); node.Add(ShadowCascade2SplitName, ShadowCascade2Split); node.Add(ShadowCascade4SplitName, ShadowCascade4Split.ExportYAML(container)); node.Add(ShadowmaskModeName, (int)ShadowmaskMode); node.Add(GetSkinWeightsName(container.ExportVersion), (int)SkinWeights); node.Add(TextureQualityName, (int)TextureQuality); node.Add(AnisotropicTexturesName, (int)AnisotropicTextures); node.Add(AntiAliasingName, (int)AntiAliasing); node.Add(SoftParticlesName, SoftParticles); node.Add(SoftVegetationName, SoftVegetation); node.Add(RealtimeReflectionProbesName, RealtimeReflectionProbes); node.Add(BillboardsFaceCameraPositionName, BillboardsFaceCameraPosition); node.Add(VSyncCountName, (int)VSyncCount); node.Add(LodBiasName, LodBias); node.Add(MaximumLODLevelName, MaximumLODLevel); if (HasStreamingMipmapsActive(container.ExportVersion)) { node.Add(StreamingMipmapsActiveName, StreamingMipmapsActive); node.Add(StreamingMipmapsAddAllCamerasName, GetStreamingMipmapsAddAllCameras(container.Version)); node.Add(StreamingMipmapsMemoryBudgetName, GetStreamingMipmapsMemoryBudget(container.Version)); node.Add(StreamingMipmapsRenderersPerFrameName, GetStreamingMipmapsRenderersPerFrame(container.Version)); node.Add(StreamingMipmapsMaxLevelReductionName, GetStreamingMipmapsMaxLevelReduction(container.Version)); node.Add(StreamingMipmapsMaxFileIORequestsName, GetStreamingMipmapsMaxFileIORequests(container.Version)); } node.Add(ParticleRaycastBudgetName, ParticleRaycastBudget); node.Add(AsyncUploadTimeSliceName, AsyncUploadTimeSlice); node.Add(AsyncUploadBufferSizeName, AsyncUploadBufferSize); if (HasAsyncUploadPersistentBuffer(container.ExportVersion)) { node.Add(AsyncUploadPersistentBufferName, AsyncUploadPersistentBuffer); } node.Add(ResolutionScalingFixedDPIFactorName, ResolutionScalingFixedDPIFactor); if (HasCustomRenderPipeline(container.ExportVersion)) { node.Add(CustomRenderPipelineName, CustomRenderPipeline.ExportYAML(container)); } node.Add(ExcludedTargetPlatformsName, GetExcludedTargetPlatforms(container.Version, container.Flags).ExportYAML()); return(node); }
protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container) { YAMLMappingNode node = base.ExportYAMLRoot(container); node.AddSerializedVersion(ToSerializedVersion(container.ExportVersion)); node.Add(DeferredName, ExportDeferred(container)); node.Add(DeferredReflectionsName, ExportDeferredReflections(container)); node.Add(ScreenSpaceShadowsName, ExportScreenSpaceShadows(container)); node.Add(LegacyDeferredName, ExportLegacyDeferred(container)); node.Add(DepthNormalsName, ExportDepthNormals(container)); node.Add(MotionVectorsName, ExportMotionVectors(container)); node.Add(LightHaloName, ExportLightHalo(container)); node.Add(LensFlareName, ExportLensFlare(container)); node.Add(AlwaysIncludedShadersName, ExportAlwaysIncludedShaders(container)); node.Add(PreloadedShadersName, GetPreloadedShaders(container.Version).ExportYAML(container)); node.Add(SpritesDefaultMaterialName, GetSpritesDefaultMaterial(container.Version).ExportYAML(container)); node.Add(CustomRenderPipelineName, CustomRenderPipeline.ExportYAML(container)); node.Add(TransparencySortModeName, (int)TransparencySortMode); node.Add(TransparencySortAxisName, GetTransparencySortAxis(container.Version).ExportYAML(container)); node.Add(DefaultRenderingPathName, (int)GetDefaultRenderingPath(container.Version, container.Flags)); node.Add(DefaultMobileRenderingPathName, (int)GetDefaultMobileRenderingPath(container.Version, container.Flags)); node.Add(TierSettingsName, GetTierSettings(container.Version, container.Platform, container.Flags).ExportYAML(container)); node.Add(LightmapStrippingName, (int)GetLightmapStripping(container.Flags)); node.Add(FogStrippingName, (int)GetFogStripping(container.Flags)); node.Add(InstancingStrippingName, (int)GetInstancingStripping(container.Flags)); node.Add(LightmapKeepPlainName, GetLightmapKeepPlain(container.Version, container.Flags)); node.Add(LightmapKeepDirCombinedName, GetLightmapKeepDirCombined(container.Version, container.Flags)); node.Add(LightmapKeepDynamicPlainName, GetLightmapKeepDynamicPlain(container.Version, container.Flags)); node.Add(LightmapKeepDynamicDirCombinedName, GetLightmapKeepDynamicDirCombined(container.Version, container.Flags)); node.Add(LightmapKeepShadowMaskName, GetLightmapKeepShadowMask(container.Version, container.Flags)); node.Add(LightmapKeepSubtractiveName, GetLightmapKeepSubtractive(container.Version, container.Flags)); node.Add(FogKeepLinearName, GetFogKeepLinear(container.Version, container.Flags)); node.Add(FogKeepExpName, GetFogKeepExp(container.Version, container.Flags)); node.Add(FogKeepExp2Name, GetFogKeepExp2(container.Version, container.Flags)); node.Add(AlbedoSwatchInfosName, GetAlbedoSwatchInfos(container.Version, container.Flags).ExportYAML(container)); node.Add(LightsUseLinearIntensityName, LightsUseLinearIntensity); node.Add(LightsUseColorTemperatureName, LightsUseColorTemperature); if (HasLogWhenShaderIsCompiled(container.ExportVersion)) { node.Add(LogWhenShaderIsCompiledName, LogWhenShaderIsCompiled); } if (HasAllowEnlightenSupportForUpgradedProject(container.ExportVersion)) { node.Add(AllowEnlightenSupportForUpgradedProjectName, GetAllowEnlightenSupportForUpgradedProject(container.Version)); } return(node); }
protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container) { YAMLMappingNode node = base.ExportYAMLRoot(container); node.AddSerializedVersion(GetSerializedVersion(container.Version)); node.Add("m_Deferred", ExportDeferred(container)); node.Add("m_DeferredReflections", ExportDeferredReflections(container)); node.Add("m_ScreenSpaceShadows", ExportScreenSpaceShadows(container)); node.Add("m_LegacyDeferred", ExportLegacyDeferred(container)); node.Add("m_DepthNormals", ExportDepthNormals(container)); node.Add("m_MotionVectors", ExportMotionVectors(container)); node.Add("m_LightHalo", ExportLightHalo(container)); node.Add("m_LensFlare", ExportLensFlare(container)); node.Add("m_AlwaysIncludedShaders", ExportAlwaysIncludedShaders(container)); node.Add("m_PreloadedShaders", GetPreloadedShaders(container.Version).ExportYAML(container)); node.Add("m_SpritesDefaultMaterial", GetSpritesDefaultMaterial(container.Version).ExportYAML(container)); node.Add("m_CustomRenderPipeline", CustomRenderPipeline.ExportYAML(container)); node.Add("m_TransparencySortMode", (int)TransparencySortMode); node.Add("m_TransparencySortAxis", GetTransparencySortAxis(container.Version).ExportYAML(container)); node.Add("m_DefaultRenderingPath", (int)GetDefaultRenderingPath(container.Version, container.Flags)); node.Add("m_DefaultMobileRenderingPath", (int)GetDefaultMobileRenderingPath(container.Version, container.Flags)); node.Add("m_TierSettings", GetTierSettings(container.Version, container.Platform, container.Flags).ExportYAML(container)); node.Add("m_LightmapStripping", (int)GetLightmapStripping(container.Flags)); node.Add("m_FogStripping", (int)GetFogStripping(container.Flags)); node.Add("m_InstancingStripping", (int)GetInstancingStripping(container.Flags)); node.Add("m_LightmapKeepPlain", GetLightmapKeepPlain(container.Version, container.Flags)); node.Add("m_LightmapKeepDirCombined", GetLightmapKeepDirCombined(container.Version, container.Flags)); node.Add("m_LightmapKeepDynamicPlain", GetLightmapKeepDynamicPlain(container.Version, container.Flags)); node.Add("m_LightmapKeepDynamicDirCombined", GetLightmapKeepDynamicDirCombined(container.Version, container.Flags)); node.Add("m_LightmapKeepShadowMask", GetLightmapKeepShadowMask(container.Version, container.Flags)); node.Add("m_LightmapKeepSubtractive", GetLightmapKeepSubtractive(container.Version, container.Flags)); node.Add("m_FogKeepLinear", GetFogKeepLinear(container.Version, container.Flags)); node.Add("m_FogKeepExp", GetFogKeepExp(container.Version, container.Flags)); node.Add("m_FogKeepExp2", GetFogKeepExp2(container.Version, container.Flags)); node.Add("m_AlbedoSwatchInfos", GetAlbedoSwatchInfos(container.Version, container.Flags).ExportYAML(container)); node.Add("m_LightsUseLinearIntensity", LightsUseLinearIntensity); node.Add("m_LightsUseColorTemperature", LightsUseColorTemperature); return(node); }
public override void Read(AssetReader reader) { base.Read(reader); if (IsReadDeferred(reader.Version)) { Deferred.Read(reader); } if (IsReadDeferredReflections(reader.Version)) { DeferredReflections.Read(reader); } if (IsReadScreenSpaceShadows(reader.Version)) { ScreenSpaceShadows.Read(reader); } if (IsReadLegacyDeferred(reader.Version)) { LegacyDeferred.Read(reader); } if (IsReadDepthNormals(reader.Version)) { DepthNormals.Read(reader); MotionVectors.Read(reader); LightHalo.Read(reader); LensFlare.Read(reader); } if (IsReadAlwaysIncludedShaders(reader.Version)) { m_alwaysIncludedShaders = reader.ReadAssetArray <PPtr <Shader> >(); } if (IsReadPreloadedShaders(reader.Version)) { m_preloadedShaders = reader.ReadAssetArray <PPtr <ShaderVariantCollection> >(); } if (IsReadSpritesDefaultMaterial(reader.Version)) { SpritesDefaultMaterial.Read(reader); } if (IsReadCustomRenderPipeline(reader.Version)) { CustomRenderPipeline.Read(reader); TransparencySortMode = (TransparencySortMode)reader.ReadInt32(); TransparencySortAxis.Read(reader); } if (IsReadTierSettings(reader.Version)) { if (IsReadPlatformSettings(reader.Version)) { if (IsReadPlatformSettingsTiers(reader.Version)) { m_platformSettings = new PlatformShaderSettings[3]; m_platformSettings[0] = reader.ReadAsset <PlatformShaderSettings>(); m_platformSettings[1] = reader.ReadAsset <PlatformShaderSettings>(); m_platformSettings[2] = reader.ReadAsset <PlatformShaderSettings>(); } else { m_platformSettings = new PlatformShaderSettings[1]; m_platformSettings[0] = reader.ReadAsset <PlatformShaderSettings>(); } } else { if (IsReadStaticTierGraphicsSettings(reader.Version, reader.Flags)) { m_tierGraphicSettings = new TierGraphicsSettings[3]; m_tierGraphicSettings[0] = reader.ReadAsset <TierGraphicsSettings>(); m_tierGraphicSettings[1] = reader.ReadAsset <TierGraphicsSettings>(); m_tierGraphicSettings[2] = reader.ReadAsset <TierGraphicsSettings>(); } } } #if UNIVERSAL if (IsReadEditorSettings(reader.Flags)) { if (IsReadDefaultRenderingPath(reader.Version)) { DefaultRenderingPath = (RenderingPath)reader.ReadInt32(); DefaultMobileRenderingPath = (RenderingPath)reader.ReadInt32(); } if (IsReadTierSettings(reader.Version)) { m_tierSettings = reader.ReadAssetArray <TierSettings>(); } if (IsReadLightmapStripping(reader.Version)) { LightmapStripping = (LightmapStrippingMode)reader.ReadInt32(); } if (IsReadFogStripping(reader.Version)) { if (IsReadFogStrippingFirst(reader.Version)) { FogStripping = (LightmapStrippingMode)reader.ReadInt32(); } } if (IsReadInstancingStripping(reader.Version)) { InstancingStripping = (InstancingStrippingVariant)reader.ReadInt32(); } if (IsReadLightmapKeepPlain(reader.Version)) { LightmapKeepPlain = reader.ReadBoolean(); LightmapKeepDirCombined = reader.ReadBoolean(); } if (IsReadLightmapKeepDirSeparate(reader.Version)) { LightmapKeepDirSeparate = reader.ReadBoolean(); } if (IsReadLightmapKeepDynamicPlain(reader.Version)) { if (IsReadLightmapKeepDynamic(reader.Version)) { bool lightmapKeepDynamic = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); LightmapKeepDynamicPlain = lightmapKeepDynamic; LightmapKeepDynamicDirCombined = lightmapKeepDynamic; LightmapKeepDynamicDirSeparate = lightmapKeepDynamic; } else { LightmapKeepDynamicPlain = reader.ReadBoolean(); LightmapKeepDynamicDirCombined = reader.ReadBoolean(); } } if (IsReadLightmapKeepDynamicDirSeparate(reader.Version)) { LightmapKeepDynamicDirSeparate = reader.ReadBoolean(); } if (IsAlign(reader.Version)) { reader.AlignStream(AlignType.Align4); } if (IsReadLightmapKeepShadowMask(reader.Version)) { LightmapKeepShadowMask = reader.ReadBoolean(); LightmapKeepSubtractive = reader.ReadBoolean(); } if (IsReadFogStripping(reader.Version)) { if (!IsReadFogStrippingFirst(reader.Version)) { FogStripping = (LightmapStrippingMode)reader.ReadInt32(); } } if (IsReadFogKeepLinear(reader.Version)) { FogKeepLinear = reader.ReadBoolean(); FogKeepExp = reader.ReadBoolean(); FogKeepExp2 = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); } if (IsReadAlbedoSwatchInfos(reader.Version)) { m_albedoSwatchInfos = reader.ReadAssetArray <AlbedoSwatchInfo>(); } } else #endif { if (IsReadShaderDefinesPerShaderCompiler(reader.Version)) { m_shaderDefinesPerShaderCompiler = reader.ReadAssetArray <PlatformShaderDefines>(); } } if (IsReadLightsUseLinearIntensity(reader.Version)) { LightsUseLinearIntensity = reader.ReadBoolean(); LightsUseColorTemperature = reader.ReadBoolean(); } }
public void Read(AssetReader reader) { if (HasName(reader.Version)) { Name = reader.ReadString(); } PixelLightCount = reader.ReadInt32(); if (HasShadows(reader.Version)) { Shadows = (ShadowQuality)reader.ReadInt32(); ShadowResolution = (ShadowResolution)reader.ReadInt32(); } if (HasShadowProjection(reader.Version)) { ShadowProjection = (ShadowProjection)reader.ReadInt32(); } if (HasShadowCascades(reader.Version)) { ShadowCascades = (ShadowCascades)reader.ReadInt32(); ShadowDistance = reader.ReadSingle(); } if (HasShadowNearPlaneOffset(reader.Version)) { ShadowNearPlaneOffset = reader.ReadSingle(); } if (HasShadowCascade2Split(reader.Version)) { ShadowCascade2Split = reader.ReadSingle(); ShadowCascade4Split.Read(reader); } if (HasShadowmaskMode(reader.Version)) { ShadowmaskMode = (ShadowmaskMode)reader.ReadInt32(); } SkinWeights = (SkinWeights)reader.ReadInt32(); TextureQuality = (TextureQuality)reader.ReadInt32(); AnisotropicTextures = (AnisotropicFiltering)reader.ReadInt32(); AntiAliasing = (AntiAliasing)reader.ReadInt32(); if (HasSoftParticles(reader.Version)) { SoftParticles = reader.ReadBoolean(); } if (HasSoftVegetation(reader.Version)) { SoftVegetation = reader.ReadBoolean(); } if (HasRealtimeReflectionProbes(reader.Version)) { RealtimeReflectionProbes = reader.ReadBoolean(); } if (HasBillboardsFaceCameraPosition(reader.Version)) { BillboardsFaceCameraPosition = reader.ReadBoolean(); } if (HasSyncToVBL(reader.Version)) { SyncToVBL = reader.ReadBoolean(); } if (IsAlign(reader.Version)) { reader.AlignStream(); } if (HasVSyncCount(reader.Version)) { VSyncCount = (VSyncCount)reader.ReadInt32(); } if (HasLodBias(reader.Version)) { LodBias = reader.ReadSingle(); MaximumLODLevel = reader.ReadInt32(); } if (HasStreamingMipmapsActive(reader.Version)) { StreamingMipmapsActive = reader.ReadBoolean(); StreamingMipmapsAddAllCameras = reader.ReadBoolean(); reader.AlignStream(); StreamingMipmapsMemoryBudget = reader.ReadSingle(); StreamingMipmapsRenderersPerFrame = reader.ReadInt32(); StreamingMipmapsMaxLevelReduction = reader.ReadInt32(); StreamingMipmapsMaxFileIORequests = reader.ReadInt32(); } if (HasParticleRaycastBudget(reader.Version)) { ParticleRaycastBudget = reader.ReadInt32(); } if (HasAsyncUploadTimeSlice(reader.Version)) { AsyncUploadTimeSlice = reader.ReadInt32(); AsyncUploadBufferSize = reader.ReadInt32(); } if (HasAsyncUploadPersistentBuffer(reader.Version)) { AsyncUploadPersistentBuffer = reader.ReadBoolean(); reader.AlignStream(); } if (HasResolutionScalingFixedDPIFactor(reader.Version)) { ResolutionScalingFixedDPIFactor = reader.ReadSingle(); } if (HasCustomRenderPipeline(reader.Version)) { CustomRenderPipeline.Read(reader); } if (HasVSyncCount(reader.Version)) { reader.AlignStream(); } #if UNIVERSAL if (HasExcludedTargetPlatforms(reader.Version, reader.Flags)) { ExcludedTargetPlatforms = reader.ReadStringArray(); } #endif }