示例#1
0
        public override void InitAtlas(HDShadowAtlasInitParameters atlasInitParams)
        {
            base.InitAtlas(atlasInitParams);
            m_IsACacheForShadows = true;

            m_AtlasResolutionInSlots = HDUtils.DivRoundUp(width, HDCachedShadowManager.k_MinSlotSize);
            m_AtlasSlots             = new List <SlotValue>(m_AtlasResolutionInSlots * m_AtlasResolutionInSlots);
            for (int i = 0; i < m_AtlasResolutionInSlots * m_AtlasResolutionInSlots; ++i)
            {
                m_AtlasSlots.Add(SlotValue.Free);
            }

            // Note: If changing the characteristics of the atlas via HDRP asset, the lights OnEnable will not be called again so we are missing them, however we can explicitly
            // put them back up for placement. If this is the first Init of the atlas, the lines below do nothing.
            DefragmentAtlasAndReRender(atlasInitParams.initParams);
            m_CanTryPlacement    = true;
            m_NeedOptimalPacking = true;
        }
示例#2
0
        public virtual void InitAtlas(HDShadowAtlasInitParameters initParams)
        {
            this.width             = initParams.width;
            this.height            = initParams.height;
            m_FilterMode           = initParams.filterMode;
            m_DepthBufferBits      = initParams.depthBufferBits;
            m_Format               = initParams.format;
            m_Name                 = initParams.name;
            m_GlobalConstantBuffer = initParams.cb;

            // With render graph, textures are "allocated" every frame so we need to prepare strings beforehand.
            m_MomentName                 = m_Name + "Moment";
            m_MomentCopyName             = m_Name + "MomentCopy";
            m_IntermediateSummedAreaName = m_Name + "IntermediateSummedArea";
            m_SummedAreaName             = m_Name + "SummedAreaFinal";
            m_AtlasShaderID              = initParams.atlasShaderID;
            m_ClearMaterial              = initParams.clearMaterial;
            m_BlurAlgorithm              = initParams.blurAlgorithm;
            m_RenderPipelineResources    = initParams.renderPipelineResources;
            m_IsACacheForShadows         = false;
        }
 public HDDynamicShadowAtlas(HDShadowAtlasInitParameters atlaInitParams)
     : base(atlaInitParams)
 {
     m_SortedRequestsCache = new HDShadowResolutionRequest[Mathf.CeilToInt(atlaInitParams.maxShadowRequests)];
 }
示例#4
0
 public HDShadowAtlas(HDShadowAtlasInitParameters initParams)
 {
     InitAtlas(initParams);
 }