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(); }
internal static int GetMaxCacheSizeForWeightInByte(int weight, int resolution, int sliceSize) { return(TextureCache2D.GetMaxCacheSizeForWeightInByte(weight, resolution, sliceSize)); }
internal static long GetApproxCacheSizeInByte(int nbElement, int resolution, int sliceSize) { return(TextureCache2D.GetApproxCacheSizeInByte(nbElement, resolution, sliceSize)); }