Пример #1
0
        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"));
        }
Пример #2
0
        private YAMLNode ExportLegacyDeferred(IExportContainer container)
        {
            const string PrePassLighting = "Hidden/Internal-PrePassLighting";

            return(IsReadLegacyDeferred(container.Version) ? LegacyDeferred.ExportYAML(container) : LegacyDeferred.ExportYAML(container, PrePassLighting));
        }
Пример #3
0
        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();
            }
        }