Example #1
0
        // BufferedRTHandleSystem API expects an allocator function. We define it here.
        static RTHandleSystem.RTHandle HistoryBufferAllocatorFunction(string viewName, int frameIndex, RTHandleSystem rtHandleSystem)
        {
            frameIndex &= 1;

            return(rtHandleSystem.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: GraphicsFormat.R16G16B16A16_SFloat,
                                        enableRandomWrite: true, useMipMap: true, autoGenerateMips: false, xrInstancing: true,
                                        name: string.Format("CameraColorBufferMipChain{0}", frameIndex)));
        }
Example #2
0
        // BufferedRTHandleSystem API expects an allocator function. We define it here.
        static RTHandleSystem.RTHandle HistoryBufferAllocatorFunction(string viewName, int frameIndex, RTHandleSystem rtHandleSystem)
        {
            frameIndex &= 1;

            return(rtHandleSystem.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.ARGBHalf,
                                        sRGB: false, enableRandomWrite: true, useMipMap: true, autoGenerateMips: false,
                                        name: string.Format("CameraColorBufferMipChain{0}", frameIndex)));
        }
Example #3
0
        // BufferedRTHandleSystem API expects an allocator function. We define it here.
        static RTHandleSystem.RTHandle HistoryBufferAllocatorFunction(string viewName, int frameIndex, RTHandleSystem rtHandleSystem)
        {
            frameIndex &= 1;
            var hdPipeline = (HDRenderPipeline)RenderPipelineManager.currentPipeline;

            return(rtHandleSystem.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: (GraphicsFormat)hdPipeline.currentPlatformRenderPipelineSettings.colorBufferFormat,
                                        enableRandomWrite: true, useMipMap: true, autoGenerateMips: false, xrInstancing: true,
                                        name: string.Format("CameraColorBufferMipChain{0}", frameIndex)));
        }
Example #4
0
 public static RTHandleSystem.RTHandle Alloc(
     int width,
     int height,
     int slices = 1,
     DepthBits depthBufferBits          = DepthBits.None,
     GraphicsFormat colorFormat         = GraphicsFormat.R8G8B8A8_SRGB,
     FilterMode filterMode              = FilterMode.Point,
     TextureWrapMode wrapMode           = TextureWrapMode.Repeat,
     TextureDimension dimension         = TextureDimension.Tex2D,
     bool enableRandomWrite             = false,
     bool useMipMap                     = false,
     bool autoGenerateMips              = true,
     bool isShadowMap                   = false,
     int anisoLevel                     = 1,
     float mipMapBias                   = 0,
     MSAASamples msaaSamples            = MSAASamples.None,
     bool bindTextureMS                 = false,
     bool useDynamicScale               = false,
     RenderTextureMemoryless memoryless = RenderTextureMemoryless.None,
     string name = ""
     )
 {
     return(s_DefaultInstance.Alloc(
                width,
                height,
                slices,
                depthBufferBits,
                colorFormat,
                filterMode,
                wrapMode,
                dimension,
                enableRandomWrite,
                useMipMap,
                autoGenerateMips,
                isShadowMap,
                anisoLevel,
                mipMapBias,
                msaaSamples,
                bindTextureMS,
                useDynamicScale,
                memoryless,
                name
                ));
 }
Example #5
0
        static RTHandle ShadowHistoryDistanceBufferAllocatorFunction(string viewName, int frameIndex, RTHandleSystem rtHandleSystem)
        {
            HDRenderPipeline      hdrp            = RenderPipelineManager.currentPipeline as HDRenderPipeline;
            HDRenderPipelineAsset hdPipelineAsset = hdrp.m_Asset;
            GraphicsFormat        graphicsFormat  = (GraphicsFormat)hdPipelineAsset.currentPlatformRenderPipelineSettings.hdShadowInitParams.screenSpaceShadowBufferFormat;
            int numShadowSlices = Math.Max((int)Math.Ceiling(hdPipelineAsset.currentPlatformRenderPipelineSettings.hdShadowInitParams.maxScreenSpaceShadowSlots / 4.0f), 1);

            return(rtHandleSystem.Alloc(Vector2.one, slices: numShadowSlices *TextureXR.slices, dimension: TextureDimension.Tex2DArray, filterMode: FilterMode.Point, colorFormat: graphicsFormat,
                                        enableRandomWrite: true, useDynamicScale: true, useMipMap: false, name: string.Format("{0}_ShadowHistoryDistanceBuffer{1}", viewName, frameIndex)));
        }
 public RTHandleSystem.RTHandle AllocDepthRT(string id, int frameIndex, RTHandleSystem rtHandleSystem)
 {
     return(rtHandleSystem.Alloc(
                size => CalculatePyramidSize(size),
                filterMode: FilterMode.Trilinear,
                colorFormat: RenderTextureFormat.RGFloat,
                sRGB: false,
                useMipMap: true,
                autoGenerateMips: false,
                enableRandomWrite: true, // Need randomReadWrite because we downsample the first mip with a compute shader.
                name: string.Format("DepthPyramid-{0}-{1}", id, frameIndex)
                ));
 }
 public RTHandleSystem.RTHandle AllocColorRT(string id, int frameIndex, RTHandleSystem rtHandleSystem)
 {
     return(rtHandleSystem.Alloc(
                size => CalculatePyramidSize(size),
                filterMode: FilterMode.Trilinear,
                colorFormat: RenderTextureFormat.ARGBHalf,
                sRGB: false,
                useMipMap: true,
                autoGenerateMips: false,
                enableRandomWrite: true,
                name: string.Format("ColorPyramid-{0}-{1}", id, frameIndex)
                ));
 }
Example #8
0
        // BufferedRTHandleSystem API expects an allocator function. We define it here.
        RTHandleSystem.RTHandle HistoryBufferAllocatorFunction(string viewName, int frameIndex, RTHandleSystem rtHandleSystem)
        {
            frameIndex &= 1;

            int d = ComputeVBufferSliceCount(preset);

            return(rtHandleSystem.Alloc(scaleFunc:         ComputeHistoryVBufferResolutionXY,
                                        slices:            d,
                                        dimension:         TextureDimension.Tex3D,
                                        colorFormat:       GraphicsFormat.R16G16B16A16_SFloat,
                                        enableRandomWrite: true,
                                        enableMSAA:        false,
                                        /* useDynamicScale: true, // <- TODO */
                                        name: string.Format("{0}_VBufferHistory{1}", viewName, frameIndex)
                                        ));
        }
        // BufferedRTHandleSystem API expects an allocator function. We define it here.
        RTHandleSystem.RTHandle HistoryBufferAllocatorFunction(string viewName, int frameIndex, RTHandleSystem rtHandleSystem)
        {
            frameIndex &= 1;

            int d = ComputeVBufferSliceCount(preset);

            // With stereo instancing, the VBuffer is doubled and split into 2 compartments for each eye
            if (TextureXR.useTexArray && XRGraphics.stereoRenderingMode == XRGraphics.StereoRenderingMode.SinglePassInstanced)
            {
                d = d * 2;
            }

            return(rtHandleSystem.Alloc(scaleFunc:         ComputeHistoryVBufferResolutionXY,
                                        slices:            d,
                                        dimension:         TextureDimension.Tex3D,
                                        colorFormat:       GraphicsFormat.R16G16B16A16_SFloat,
                                        enableRandomWrite: true,
                                        enableMSAA:        false,
                                        /* useDynamicScale: true, // <- TODO */
                                        name: string.Format("{0}_VBufferHistory{1}", viewName, frameIndex)
                                        ));
        }
Example #10
0
 static RTHandle PathTracingHistoryBufferAllocatorFunction(string viewName, int frameIndex, RTHandleSystem rtHandleSystem)
 {
     return(rtHandleSystem.Alloc(Vector2.one, TextureXR.slices, colorFormat: GraphicsFormat.R32G32B32A32_SFloat, dimension: TextureXR.dimension,
                                 enableRandomWrite: true, useMipMap: false, autoGenerateMips: false,
                                 name: string.Format("{0}_PathTracingHistoryBuffer{1}", viewName, frameIndex)));
 }
Example #11
0
 static RTHandle AmbientOcclusionHistoryBufferAllocatorFunction(string viewName, int frameIndex, RTHandleSystem rtHandleSystem)
 {
     return(rtHandleSystem.Alloc(Vector2.one, TextureXR.slices, colorFormat: GraphicsFormat.R16G16_SFloat, dimension: TextureXR.dimension,
                                 enableRandomWrite: true, useMipMap: false, autoGenerateMips: false,
                                 name: string.Format("AmbientOcclusionHistoryBuffer{0}", frameIndex)));
 }
 // Allocation of the first history buffer
 static RTHandle VolumetricClouds0HistoryBufferAllocatorFunction(string viewName, int frameIndex, RTHandleSystem rtHandleSystem)
 {
     return(rtHandleSystem.Alloc(Vector2.one * 0.5f, TextureXR.slices, colorFormat: GraphicsFormat.R16G16B16A16_SFloat, dimension: TextureXR.dimension,
                                 enableRandomWrite: true, useMipMap: false, autoGenerateMips: false,
                                 name: string.Format("{0}_CloudsHistory0Buffer{1}", viewName, frameIndex)));
 }
Example #13
0
 static RTHandleSystem.RTHandle AmbientOcclusionHistoryBufferAllocatorFunction(string viewName, int frameIndex, RTHandleSystem rtHandleSystem)
 {
     return(rtHandleSystem.Alloc(Vector2.one, filterMode: FilterMode.Point, colorFormat: UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.OverrideRTGraphicsFormat(GraphicsFormat.R16_SFloat),
                                 enableRandomWrite: true, useMipMap: false, autoGenerateMips: false, xrInstancing: true,
                                 name: string.Format("AmbientOcclusionHistoryBuffer{0}", frameIndex)));
 }
Example #14
0
 RTHandle IndirectDiffuseHistoryBufferAllocatorFunction0(string viewName, int frameIndex, RTHandleSystem rtHandleSystem)
 {
     return(rtHandleSystem.Alloc(Vector2.one, TextureXR.slices, colorFormat: GraphicsFormat.B10G11R11_UFloatPack32, dimension: TextureXR.dimension,
                                 enableRandomWrite: true, useMipMap: false, autoGenerateMips: false,
                                 name: string.Format("IndirectDiffuseHistoryBuffer0{0}", frameIndex)));
 }
Example #15
0
 static RTHandleSystem.RTHandle AreaAnalyticHistoryBufferAllocatorFunction(string viewName, int frameIndex, RTHandleSystem rtHandleSystem)
 {
     return(rtHandleSystem.Alloc(Vector2.one, slices: 4, dimension: TextureDimension.Tex2DArray, filterMode: FilterMode.Point, colorFormat: UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.OverrideRTGraphicsFormat(GraphicsFormat.R16_SFloat),
                                 enableRandomWrite: true, useDynamicScale: true, xrInstancing: true, useMipMap: false, name: "AnalyticHistoryBuffer"));
 }
Example #16
0
 static RTHandleSystem.RTHandle AreaAnalyticHistoryBufferAllocatorFunction(string viewName, int frameIndex, RTHandleSystem rtHandleSystem)
 {
     return(rtHandleSystem.Alloc(Vector2.one, slices: 4 * TextureXR.slices, dimension: TextureDimension.Tex2DArray, filterMode: FilterMode.Point, colorFormat: GraphicsFormat.R16_SFloat,
                                 enableRandomWrite: true, useDynamicScale: true, useMipMap: false, name: string.Format("AreaShadowHistoryBuffer{0}", frameIndex)));
 }