示例#1
0
        public LightCookieManager(HDRenderPipelineAsset hdAsset, int maxCacheSize)
        {
            // Keep track of the render pipeline asset
            m_RenderPipelineAsset = hdAsset;
            var hdResources = HDRenderPipeline.defaultAsset.renderPipelineResources;

            // Create the texture cookie cache that we shall be using for the area lights
            GlobalLightLoopSettings gLightLoopSettings = hdAsset.currentPlatformRenderPipelineSettings.lightLoopSettings;

            // Also make sure to create the engine material that is used for the filtering
            m_MaterialFilterAreaLights = CoreUtils.CreateEngineMaterial(hdResources.shaders.filterAreaLightCookiesPS);

            int cookieCubeSize  = gLightLoopSettings.cubeCookieTexArraySize;
            int cookieAtlasSize = (int)gLightLoopSettings.cookieAtlasSize;

            cookieFormat            = (GraphicsFormat)gLightLoopSettings.cookieFormat;
            cookieAtlasLastValidMip = gLightLoopSettings.cookieAtlasLastValidMip;

            m_CookieAtlas = new PowerOfTwoTextureAtlas(cookieAtlasSize, gLightLoopSettings.cookieAtlasLastValidMip, cookieFormat, name: "Cookie Atlas (Punctual Lights)", useMipMap: true);

            m_CubeToPanoMaterial = CoreUtils.CreateEngineMaterial(hdResources.shaders.cubeToPanoPS);

            m_CubeCookieTexArray = new TextureCacheCubemap("Cookie");
            int cookieCubeResolution = (int)gLightLoopSettings.pointCookieSize;

            if (TextureCacheCubemap.GetApproxCacheSizeInByte(cookieCubeSize, cookieCubeResolution, 1) > HDRenderPipeline.k_MaxCacheSize)
            {
                cookieCubeSize = TextureCacheCubemap.GetMaxCacheSizeForWeightInByte(HDRenderPipeline.k_MaxCacheSize, cookieCubeResolution, 1);
            }

            // For now the cubemap cookie array format is hardcoded to R8G8B8A8 SRGB.
            m_CubeCookieTexArray.AllocTextureArray(cookieCubeSize, cookieCubeResolution, cookieFormat, true, m_CubeToPanoMaterial);
        }
        internal static RenderPipelineSettings NewDefault() => new RenderPipelineSettings()
        {
            supportShadowMask           = true,
            supportSSAO                 = true,
            supportSubsurfaceScattering = true,
            sssSampleBudget             = new IntScalableSetting(new[] { (int)DefaultSssSampleBudgetForQualityLevel.Low,
                                                                         (int)DefaultSssSampleBudgetForQualityLevel.Medium,
                                                                         (int)DefaultSssSampleBudgetForQualityLevel.High }, ScalableSettingSchemaId.With3Levels),
            supportVolumetrics              = true,
            supportDistortion               = true,
            supportTransparentBackface      = true,
            supportTransparentDepthPrepass  = true,
            supportTransparentDepthPostpass = true,
            colorBufferFormat               = ColorBufferFormat.R11G11B10,
            supportCustomPass               = true,
            customBufferFormat              = CustomBufferFormat.R8G8B8A8,
            supportedLitShaderMode          = SupportedLitShaderMode.DeferredOnly,
            supportDecals              = true,
            supportDecalLayers         = false,
            decalLayerName0            = "Decal Layer default",
            decalLayerName1            = "Decal Layer 1",
            decalLayerName2            = "Decal Layer 2",
            decalLayerName3            = "Decal Layer 3",
            decalLayerName4            = "Decal Layer 4",
            decalLayerName5            = "Decal Layer 5",
            decalLayerName6            = "Decal Layer 6",
            decalLayerName7            = "Decal Layer 7",
            msaaSampleCount            = MSAASamples.None,
            supportMotionVectors       = true,
            supportRuntimeDebugDisplay = false,
            supportRuntimeAOVAPI       = false,
            supportDitheringCrossFade  = true,
            supportTerrainHole         = false,

            lightLoopSettings         = GlobalLightLoopSettings.NewDefault(),
            hdShadowInitParams        = HDShadowInitParameters.NewDefault(),
            decalSettings             = GlobalDecalSettings.NewDefault(),
            postProcessSettings       = GlobalPostProcessSettings.NewDefault(),
            dynamicResolutionSettings = GlobalDynamicResolutionSettings.NewDefault(),
            lowresTransparentSettings = GlobalLowResolutionTransparencySettings.NewDefault(),
            xrSettings = GlobalXRSettings.NewDefault(),
            postProcessQualitySettings = GlobalPostProcessingQualitySettings.NewDefault(),
            lightingQualitySettings    = GlobalLightingQualitySettings.NewDefault(),
            lightSettings = LightSettings.NewDefault(),

            supportRayTracing       = false,
            supportedRayTracingMode = SupportedRayTracingMode.Both,
            lodBias             = new FloatScalableSetting(new[] { 1.0f, 1, 1 }, ScalableSettingSchemaId.With3Levels),
            maximumLODLevel     = new IntScalableSetting(new[] { 0, 0, 0 }, ScalableSettingSchemaId.With3Levels),
            lightLayerName0     = "Light Layer default",
            lightLayerName1     = "Light Layer 1",
            lightLayerName2     = "Light Layer 2",
            lightLayerName3     = "Light Layer 3",
            lightLayerName4     = "Light Layer 4",
            lightLayerName5     = "Light Layer 5",
            lightLayerName6     = "Light Layer 6",
            lightLayerName7     = "Light Layer 7",
            supportProbeVolume  = false,
            probeVolumeSettings = GlobalProbeVolumeSettings.@default,
        };
示例#3
0
        internal static RenderPipelineSettings NewDefault()
        {
            RenderPipelineSettings settings = new RenderPipelineSettings()
            {
                supportShadowMask           = true,
                supportSSAO                 = true,
                supportSubsurfaceScattering = true,
                sssSampleBudget             = new IntScalableSetting(new[] { (int)DefaultSssSampleBudgetForQualityLevel.Low,
                                                                             (int)DefaultSssSampleBudgetForQualityLevel.Medium,
                                                                             (int)DefaultSssSampleBudgetForQualityLevel.High }, ScalableSettingSchemaId.With3Levels),
                supportVolumetrics              = true,
                supportDistortion               = true,
                supportTransparentBackface      = true,
                supportTransparentDepthPrepass  = true,
                supportTransparentDepthPostpass = true,
                colorBufferFormat               = ColorBufferFormat.R11G11B10,
                supportCustomPass               = true,
                customBufferFormat              = CustomBufferFormat.R8G8B8A8,
                supportedLitShaderMode          = SupportedLitShaderMode.DeferredOnly,
                supportDecals             = true,
                supportDecalLayers        = false,
                supportSurfaceGradient    = true,
                decalNormalBufferHP       = false,
                msaaSampleCount           = MSAASamples.None,
                supportMotionVectors      = true,
                supportRuntimeAOVAPI      = false,
                supportDitheringCrossFade = true,
                supportTerrainHole        = false,
                supportWater = false,
                waterSimulationResolution  = WaterSimulationResolution.Medium128,
                planarReflectionResolution = new PlanarReflectionAtlasResolutionScalableSetting(new[] { PlanarReflectionAtlasResolution.Resolution256,
                                                                                                        PlanarReflectionAtlasResolution.Resolution1024,
                                                                                                        PlanarReflectionAtlasResolution.Resolution2048 }, ScalableSettingSchemaId.With3Levels),
                lightLoopSettings         = GlobalLightLoopSettings.NewDefault(),
                hdShadowInitParams        = HDShadowInitParameters.NewDefault(),
                decalSettings             = GlobalDecalSettings.NewDefault(),
                postProcessSettings       = GlobalPostProcessSettings.NewDefault(),
                dynamicResolutionSettings = GlobalDynamicResolutionSettings.NewDefault(),
                lowresTransparentSettings = GlobalLowResolutionTransparencySettings.NewDefault(),
                xrSettings = GlobalXRSettings.NewDefault(),
                postProcessQualitySettings = GlobalPostProcessingQualitySettings.NewDefault(),
                lightingQualitySettings    = GlobalLightingQualitySettings.NewDefault(),
                lightSettings = LightSettings.NewDefault(),

                supportRayTracing       = false,
                supportedRayTracingMode = SupportedRayTracingMode.Both,
                lodBias                     = new FloatScalableSetting(new[] { 1.0f, 1, 1 }, ScalableSettingSchemaId.With3Levels),
                maximumLODLevel             = new IntScalableSetting(new[] { 0, 0, 0 }, ScalableSettingSchemaId.With3Levels),
                supportProbeVolume          = false,
                probeVolumeMemoryBudget     = ProbeVolumeTextureMemoryBudget.MemoryBudgetMedium,
                supportProbeVolumeStreaming = false,
                probeVolumeSHBands          = ProbeVolumeSHBands.SphericalHarmonicsL1,
            };

            return(settings);
        }
示例#4
0
        public LightCookieManager(HDRenderPipelineAsset hdAsset, int maxCacheSize)
        {
            // Keep track of the render pipeline asset
            m_RenderPipelineAsset = hdAsset;
            var hdResources = HDRenderPipeline.defaultAsset.renderPipelineResources;

            // Create the texture cookie cache that we shall be using for the area lights
            GlobalLightLoopSettings gLightLoopSettings = hdAsset.currentPlatformRenderPipelineSettings.lightLoopSettings;

            // Also make sure to create the engine material that is used for the filtering
            m_MaterialFilterAreaLights = CoreUtils.CreateEngineMaterial(hdResources.shaders.filterAreaLightCookiesPS);

            int cookieAtlasSize = (int)gLightLoopSettings.cookieAtlasSize;

            cookieFormat            = (GraphicsFormat)gLightLoopSettings.cookieFormat;
            cookieAtlasLastValidMip = gLightLoopSettings.cookieAtlasLastValidMip;

            m_CookieAtlas = new PowerOfTwoTextureAtlas(cookieAtlasSize, gLightLoopSettings.cookieAtlasLastValidMip, cookieFormat, name: "Cookie Atlas (Punctual Lights)", useMipMap: true);

            m_CookieCubeResolution = (int)gLightLoopSettings.pointCookieSize;
        }