コード例 #1
0
        public PlanarReflectionProbeCache(RenderPipelineResources defaultResources, IBLFilterGGX iblFilter, int cacheSize, int probeSize, TextureFormat probeFormat, bool isMipmaped)
        {
            m_ConvertTextureMaterial = CoreUtils.CreateEngineMaterial(defaultResources.shaders.blitCubeTextureFacePS);
            m_ConvertTextureMPB      = new MaterialPropertyBlock();

            // BC6H requires CPP feature not yet available
            probeFormat = TextureFormat.RGBAHalf;

            Debug.Assert(probeFormat == TextureFormat.BC6H || probeFormat == TextureFormat.RGBAHalf, "Reflection Probe Cache format for HDRP can only be BC6H or FP16.");

            m_ProbeSize    = probeSize;
            m_CacheSize    = cacheSize;
            m_TextureCache = new TextureCache2D("PlanarReflectionProbe");
            m_TextureCache.AllocTextureArray(cacheSize, probeSize, probeSize, probeFormat, isMipmaped);
            m_IBLFilterGGX = iblFilter;

            m_PerformBC6HCompression = probeFormat == TextureFormat.BC6H;

            InitializeProbeBakingStates();
        }
コード例 #2
0
 internal static int GetMaxCacheSizeForWeightInByte(int weight, int resolution, int sliceSize)
 {
     return(TextureCache2D.GetMaxCacheSizeForWeightInByte(weight, resolution, sliceSize));
 }
コード例 #3
0
 internal static long GetApproxCacheSizeInByte(int nbElement, int resolution, int sliceSize)
 {
     return(TextureCache2D.GetApproxCacheSizeInByte(nbElement, resolution, sliceSize));
 }