}
}
public void InitGBuffers ( RenderTextureDescriptor rtDesc , CommandBuffer cmd )
{
rtDesc . depthBufferBits = 0 ;
for ( int index = 0 ; index < gbufferCount ; index + + )
{
rtDesc . colorFormat = m_Formats [ index ] ;
rtDesc . sRGB = ( m_sRGBWrites [ index ] ! = RenderTextureReadWrite . Linear ) ;
// maybe turn off AA if requested
cmd . GetTemporaryRT ( m_IDs [ index ] , rtDesc , FilterMode . Point ) ;
}
}
public RenderTargetIdentifier [ ] GetGBuffers ( )
{
if ( m_ColorMRTs = = null | | m_ColorMRTs . Length ! = gbufferCount )
}
}
public void GetTempRT ( CommandBuffer cmd , int widthOverride = 0 , int heightOverride = 0 )
{
}
public HDRenderPipeline ( HDRenderPipelineAsset asset )
{
m_Asset = asset ;
} ;
#endif
void CreateDepthStencilBuffer ( Camera camera )
//void CreateDepthStencilBuffer(Camera camera)
void CreateDepthStencilBuffer ( HDCamera hdCam )
m_CameraDepthStencilBuffer = new RenderTexture ( camera . pixelWidth , camera . pixelHeight , 2 4 , RenderTextureFormat . Depth ) ;
var localDesc = hdCam . rtDesc ;
//m_CameraDepthStencilBuffer = new RenderTexture(camera.pixelWidth, camera.pixelHeight, 24, RenderTextureFormat.Depth);
localDesc . colorFormat = RenderTextureFormat . Depth ;
localDesc . depthBufferBits = 2 4 ;
// enable SRGB?
m_CameraDepthStencilBuffer = new RenderTexture ( localDesc ) ;
m_CameraDepthStencilBuffer . filterMode = FilterMode . Point ;
m_CameraDepthStencilBuffer . Create ( ) ;
m_CameraDepthStencilBufferRT = new RenderTargetIdentifier ( m_CameraDepthStencilBuffer ) ;
if ( m_CameraDepthBufferCopy ! = null )
m_CameraDepthBufferCopy . Release ( ) ;
m_CameraDepthBufferCopy = new RenderTexture ( camera . pixelWidth , camera . pixelHeight , 2 4 , RenderTextureFormat . Depth ) ;
//m_CameraDepthBufferCopy = new RenderTexture(camera.pixelWidth, camera.pixelHeight, 24, RenderTextureFormat.Depth);
m_CameraDepthBufferCopy = new RenderTexture ( localDesc ) ;
m_CameraDepthBufferCopy . filterMode = FilterMode . Point ;
m_CameraDepthBufferCopy . Create ( ) ;
m_CameraDepthBufferCopyRT = new RenderTargetIdentifier ( m_CameraDepthBufferCopy ) ;
if ( m_CameraStencilBufferCopy ! = null )
m_CameraStencilBufferCopy . Release ( ) ;
m_CameraStencilBufferCopy = new RenderTexture ( camera . pixelWidth , camera . pixelHeight , 0 , RenderTextureFormat . R8 , RenderTextureReadWrite . Linear ) ; // DXGI_FORMAT_R8_UINT is not supported by Unity
//m_CameraStencilBufferCopy = new RenderTexture(camera.pixelWidth, camera.pixelHeight, 0, RenderTextureFormat.R8, RenderTextureReadWrite.Linear); // DXGI_FORMAT_R8_UINT is not supported by Unity
localDesc . colorFormat = RenderTextureFormat . R8 ;
localDesc . sRGB = false ;
localDesc . depthBufferBits = 0 ;
m_CameraStencilBufferCopy = new RenderTexture ( localDesc ) ; // DXGI_FORMAT_R8_UINT is not supported by Unity
m_CameraStencilBufferCopy . filterMode = FilterMode . Point ;
m_CameraStencilBufferCopy . Create ( ) ;
m_CameraStencilBufferCopyRT = new RenderTargetIdentifier ( m_CameraStencilBufferCopy ) ;
m_HTile . Release ( ) ;
// We use 8x8 tiles in order to match the native GCN HTile as closely as possible.
m_HTile = new RenderTexture ( ( camera . pixelWidth + 7 ) / 8 , ( camera . pixelHeight + 7 ) / 8 , 0 , RenderTextureFormat . R8 , RenderTextureReadWrite . Linear ) ; // DXGI_FORMAT_R8_UINT is not supported by Unity
//m_HTile = new RenderTexture((camera.pixelWidth + 7) / 8, (camera.pixelHeight + 7) / 8, 0, RenderTextureFormat.R8, RenderTextureReadWrite.Linear); // DXGI_FORMAT_R8_UINT is not supported by Unity
localDesc . colorFormat = RenderTextureFormat . R8 ;
localDesc . sRGB = false ;
localDesc . depthBufferBits = 0 ;
localDesc . width = ( localDesc . width + 7 ) / 8 ;
localDesc . height = ( localDesc . height + 7 ) / 8 ;
m_HTile = new RenderTexture ( localDesc ) ; // DXGI_FORMAT_R8_UINT is not supported by Unity
m_HTile . filterMode = FilterMode . Point ;
m_HTile . enableRandomWrite = true ;
m_HTile . Create ( ) ;
}
void Resize ( Camera camera )
void Resize ( HDCamera hdCam )
{
// TODO: Detect if renderdoc just load and force a resize in this case, as often renderdoc require to realloc resource.
m_SkyManager . skySettings = skySettingsToUse ;
m_SkyManager . Resize ( camera . nearClipPlane , camera . farClipPlane ) ; // TODO: Also a bad naming, here we just want to realloc texture if skyparameters change (useful for lookdev)
m_SkyManager . Resize ( hdCam . camera . nearClipPlane , hdCam . camera . farClipPlane ) ; // TODO: Also a bad naming, here we just want to realloc texture if skyparameters change (useful for lookdev)
int camTexWidth = ( int ) hdCam . textureSize . x ;
int camTexHeight = ( int ) hdCam . textureSize . y ;
bool resolutionChanged = camera . pixelWidth ! = m_CurrentWidth | | camera . pixelHeight ! = m_CurrentHeight ;
//bool resolutionChanged = hdCam.camera.pixelWidth != m_CurrentWidth || hdCam.camera.pixelHeight != m_CurrentHeight;
bool resolutionChanged = camTexWidth ! = m_CurrentWidth | | camTexHeight ! = m_CurrentHeight ;
CreateDepthStencilBuffer ( camera ) ;
CreateDepthStencilBuffer ( hdCam ) ; // XRTODO
//CreateDepthStencilBuffer(hdCam.camera);
if ( resolutionChanged | | m_LightLoop . NeedResize ( ) )
{
m_LightLoop . AllocResolutionDependentBuffers ( camera . pixelWidth , camera . pixelHeight ) ;
//m_LightLoop.AllocResolutionDependentBuffers(hdCam.camera.pixelWidth, hdCam.camera.pixelHeight);
// XRTODO: pass in descriptor
//m_LightLoop.AllocResolutionDependentBuffers(camTexWidth, camTexWidth);
m_LightLoop . AllocResolutionDependentBuffers ( ( int ) hdCam . screenSize . x , ( int ) hdCam . screenSize . y ) ;
CreateVolumetricLightingBuffers ( camera . pixelWidth , camera . pixelHeight ) ;
CreateVolumetricLightingBuffers ( camTexWidth , camTexHeight ) ; // XRTODO: fix up for XR
//CreateVolumetricLightingBuffers(hdCam.camera.pixelWidth, hdCam.camera.pixelHeight);
m_CurrentWidth = camera . pixelWidth ;
m_CurrentHeight = camera . pixelHeight ;
//m_CurrentWidth = hdCam.camera.pixelWidth;
//m_CurrentHeight = hdCam.camera.pixelHeight;
m_CurrentWidth = camTexWidth ;
m_CurrentHeight = camTexHeight ;
}
public void PushGlobalParams ( HDCamera hdCamera , CommandBuffer cmd , SubsurfaceScatteringSettings sssParameters )
m_FrameCount = Time . frameCount ;
}
bool stereoActive = fals e & & ! m_Asset . renderingSettings . disableStereoPaths ;
if ( stereoActive )
bool stereoEnabled = UnityEngine . XR . XRSettings . isDeviceActiv e & & ! m_Asset . renderingSettings . disableStereoPaths ;
if ( stereoEnabled )
{
m_VolumetricLightingEnabled = false ; // XRTODO: Implement VL
}
var mainProfilingSample = new ProfilingSample ( cmd , "HDRP" ) ;
foreach ( var material in m_MaterialList )
material . RenderInit ( cmd ) ;
UpdateCommonSettings ( ) ;
ScriptableCullingParameters cullingParams ;
if ( ! CullResults . GetCullingParameters ( camera , out cullingParams ) )
//if (!CullResults.GetCullingParameters(camera, out cullingParams))
if ( ! CullResults . GetCullingParameters ( camera , stereoEnabled , out cullingParams ) )
{
renderContext . Submit ( ) ;
return ;
CullResults . Cull ( ref cullingParams , renderContext , ref m_CullResults ) ;
Resize ( camera ) ;
var postProcessLayer = camera . GetComponent < PostProcessLayer > ( ) ;
var hdCamera = HDCamera . Get ( camera , postProcessLayer , stereoEnabled ) ;
renderContext . SetupCameraProperties ( camera ) ;
Resize ( hdCamera ) ;
var postProcessLayer = camera . GetComponent < PostProcessLayer > ( ) ;
var hdCamera = HDCamera . Get ( camera , postProcessLayer ) ;
//renderContext.SetupCameraProperties(camera);
renderContext . SetupCameraProperties ( camera , stereoEnabled ) ;
//var postProcessLayer = camera.GetComponent<PostProcessLayer>();
//var hdCamera = HDCamera.Get(camera, postProcessLayer);
PushGlobalParams ( hdCamera , cmd , sssSettings ) ;
// TODO: Find a correct place to bind these material textures
using ( new ProfilingSample ( cmd , "Forward" ) )
{
// TODO: BUG Shouldn't this be after InitAndClearBuffer? m_CameraColorBufferRT isn't set yet...
// I guess this might work because of how identifiers work, but it looks janky
CoreUtils . SetRenderTarget ( cmd , m_CameraColorBufferRT , m_CameraDepthStencilBufferRT , ClearFlag . Color | ClearFlag . Depth ) ;
RenderOpaqueRenderList ( m_CullResults , camera , renderContext , cmd , HDShaderPassNames . s_ForwardName ) ;
RenderTransparentRenderList ( m_CullResults , camera , renderContext , cmd , HDShaderPassNames . s_ForwardName ) ;
// In both forward and deferred, everything opaque should have been rendered at this point so we can safely copy the depth buffer for later processing.
CopyDepthBufferIfNeeded ( cmd ) ;
RenderPyramidDepth ( camera , cmd , renderContext , FullScreenDebugMode . DepthPyramid ) ;
//RenderPyramidDepth(camera, cmd, renderContext, FullScreenDebugMode.DepthPyramid);
RenderPyramidDepth ( hdCamera , cmd , renderContext , FullScreenDebugMode . DepthPyramid ) ;
// Required for the SSS and the shader feature classification pass.
PrepareAndBindStencilTexture ( cmd ) ;
if ( settings . IsEnabledAndSupported ( null ) )
{
// XRTODO: Fix
// MSVO doesn't work for XR currently
cmd . GetTemporaryRT ( HDShaderIDs . _AmbientOcclusionTexture , new RenderTextureDescriptor ( camera . pixelWidth , camera . pixelHeight , RenderTextureFormat . R8 , 0 )
{
sRGB = false ,
m_LightLoop . PrepareLightsForGPU ( m_ShadowSettings , m_CullResults , camera ) ;
m_LightLoop . RenderShadows ( renderContext , cmd , m_CullResults ) ;
cmd . GetTemporaryRT ( m_DeferredShadowBuffer , camera . pixelWidth , camera . pixelHeight , 0 , FilterMode . Point , RenderTextureFormat . ARGB32 , RenderTextureReadWrite . Linear , 1 , true ) ;
//cmd.GetTemporaryRT(m_DeferredShadowBuffer, camera.pixelWidth, camera.pixelHeight, 0, FilterMode.Point, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear, 1 , true);
cmd . GetTemporaryRT ( m_DeferredShadowBuffer , ( int ) hdCamera . textureSize . x , ( int ) hdCamera . textureSize . y , 0 , FilterMode . Point , RenderTextureFormat . ARGB32 , RenderTextureReadWrite . Linear , 1 , true ) ;
renderContext . SetupCameraProperties ( camera ) ; // Need to recall SetupCameraProperties after m_ShadowPass.Render
//renderContext.SetupCameraProperties(camera); // Need to recall SetupCameraProperties after m_ShadowPass.Render
renderContext . SetupCameraProperties ( camera , stereoEnabled ) ; // Need to recall SetupCameraProperties after m_ShadowPass.Render
// XRTODO: Big time fix :p
m_LightLoop . BuildGPULightLists ( camera , cmd , m_CameraDepthStencilBufferRT , GetStencilTexture ( ) ) ;
}
RenderForward ( m_CullResults , camera , renderContext , cmd , ForwardPass . PreRefraction ) ;
RenderForwardError ( m_CullResults , camera , renderContext , cmd , ForwardPass . PreRefraction ) ;
RenderGaussianPyramidColor ( camera , cmd , renderContext , FullScreenDebugMode . PreRefractionColorPyramid ) ;
//RenderGaussianPyramidColor(camera, cmd, renderContext, FullScreenDebugMode.PreRefractionColorPyramid);
// XRTODO: Properly fix
RenderGaussianPyramidColor ( hdCamera , cmd , renderContext , FullScreenDebugMode . PreRefractionColorPyramid ) ;
// Render all type of transparent forward (unlit, lit, complex (hair...)) to keep the sorting between transparent objects.
RenderForward ( m_CullResults , camera , renderContext , cmd , ForwardPass . Transparent ) ;
// XRTODO: Should this be gated my m_VolumetricLightingEnabled?
VolumetricLightingPass ( hdCamera , cmd ) ;
PushFullScreenDebugTexture ( cmd , m_CameraColorBuffer , camera , renderContext , FullScreenDebugMode . NanTracker ) ;
{
RenderVelocity ( m_CullResults , hdCamera , renderContext , cmd ) ; // Note we may have to render velocity earlier if we do temporalAO, temporal volumetric etc... Mean we will not take into account forward opaque in case of deferred rendering ?
RenderGaussianPyramidColor ( camera , cmd , renderContext , FullScreenDebugMode . FinalColorPyramid ) ;
//RenderGaussianPyramidColor(camera, cmd, renderContext, FullScreenDebugMode.FinalColorPyramid);
RenderGaussianPyramidColor ( hdCamera , cmd , renderContext , FullScreenDebugMode . FinalColorPyramid ) ;
AccumulateDistortion ( m_CullResults , camera , renderContext , cmd ) ;
AccumulateDistortion ( m_CullResults , hdCamera , renderContext , cmd ) ;
RenderDistortion ( cmd , m_Asset . renderPipelineResources ) ;
RenderPostProcesses ( camera , cmd , postProcessLayer ) ;
cmd . SetRenderTarget ( BuiltinRenderTextureType . CameraTarget , m_CameraDepthStencilBufferRT ) ;
#endif
if ( stereoEnabled )
renderContext . StereoEndRender ( camera ) ;
mainProfilingSample . Dispose ( ) ;
renderContext . ExecuteCommandBuffer ( cmd ) ;
CommandBufferPool . Release ( cmd ) ;
renderContext . Submit ( ) ;
renderContext . DrawRenderers ( cull . visibleRenderers , ref drawSettings , filterSettings , stateBlock . Value ) ;
}
void AccumulateDistortion ( CullResults cullResults , Camera camera , ScriptableRenderContext renderContext , CommandBuffer cmd )
//void AccumulateDistortion(CullResults cullResults, Camera camera, ScriptableRenderContext renderContext, CommandBuffer cmd)
void AccumulateDistortion ( CullResults cullResults , HDCamera camera , ScriptableRenderContext renderContext , CommandBuffer cmd )
{
if ( ! m_CurrentDebugDisplaySettings . renderingDebugSettings . enableDistortion )
return ;
int w = camera . pixelWidth ;
int h = camera . pixelHeight ;
//int w = camera.pixelWidth;
//int h = camera.pixelHeight;
// XRTODO: proper fix
int w = ( int ) camera . textureSize . x ;
int h = ( int ) camera . textureSize . y ;
cmd . GetTemporaryRT ( m_DistortionBuffer , w , h , 0 , FilterMode . Point , Builtin . GetDistortionBufferFormat ( ) , Builtin . GetDistortionBufferReadWrite ( ) ) ;
cmd . SetRenderTarget ( m_DistortionBufferRT , m_CameraDepthStencilBufferRT ) ;
RenderTransparentRenderList ( cullResults , camera , renderContext , cmd , HDShaderPassNames . s_DistortionVectorsName , preRefractionQueue : true ) ;
RenderTransparentRenderList ( cullResults , camera , renderContext , cmd , HDShaderPassNames . s_DistortionVectorsName ) ;
//RenderTransparentRenderList(cullResults, camera, renderContext, cmd, HDShaderPassNames.s_DistortionVectorsName, preRefractionQueue:true);
//RenderTransparentRenderList(cullResults, camera, renderContext, cmd, HDShaderPassNames.s_DistortionVectorsName);
RenderTransparentRenderList ( cullResults , camera . camera , renderContext , cmd , HDShaderPassNames . s_DistortionVectorsName , preRefractionQueue : true ) ;
RenderTransparentRenderList ( cullResults , camera . camera , renderContext , cmd , HDShaderPassNames . s_DistortionVectorsName ) ;
}
}
cmd . SetComputeTextureParam ( m_SubsurfaceScatteringCS , m_SubsurfaceScatteringKernel , HDShaderIDs . _CameraFilteringBuffer , m_CameraFilteringBufferRT ) ;
// Perform the SSS filtering pass which fills 'm_CameraFilteringBufferRT'.
// TODO: If stereo get supported, has to be performed over both eyes
cmd . DispatchCompute ( m_SubsurfaceScatteringCS , m_SubsurfaceScatteringKernel , ( ( int ) hdCamera . screenSize . x + 1 5 ) / 1 6 , ( ( int ) hdCamera . screenSize . y + 1 5 ) / 1 6 , 1 ) ;
cmd . SetGlobalTexture ( HDShaderIDs . _IrradianceSource , m_CameraFilteringBufferRT ) ; // Cannot set a RT on a material
// If the flag hasn't been set yet on this camera, motion vectors will skip a frame.
hdcam . camera . depthTextureMode | = DepthTextureMode . MotionVectors | DepthTextureMode . Depth ;
int w = ( int ) hdcam . screenSize . x ;
int h = ( int ) hdcam . screenSize . y ;
// XRTODO: proper fix
int w = ( int ) hdcam . textureSize . x ;
int h = ( int ) hdcam . textureSize . y ;
m_CameraMotionVectorsMaterial . SetVector ( HDShaderIDs . _CameraPosDiff , hdcam . prevCameraPos - hdcam . cameraPos ) ;
}
}
void RenderGaussianPyramidColor ( Camera camera , CommandBuffer cmd , ScriptableRenderContext renderContext , FullScreenDebugMode debugMode )
void RenderGaussianPyramidColor ( HD Camera camera , CommandBuffer cmd , ScriptableRenderContext renderContext , FullScreenDebugMode debugMode )
{
if ( ! m_CurrentDebugDisplaySettings . renderingDebugSettings . enableGaussianPyramid )
return ;
int w = camera . pixelWidth ;
int h = camera . pixelHeight ;
//int w = camera.pixelWidth;
//int h = camera.pixelHeight;
int w = ( int ) camera . textureSize . x ;
int h = ( int ) camera . textureSize . y ;
int size = CalculatePyramidSize ( w , h ) ;
// The gaussian pyramid compute works in blocks of 8x8 so make sure the last lod has a
}
}
void RenderPyramidDepth ( Camera camera , CommandBuffer cmd , ScriptableRenderContext renderContext , FullScreenDebugMode debugMode )
void RenderPyramidDepth ( HD Camera camera , CommandBuffer cmd , ScriptableRenderContext renderContext , FullScreenDebugMode debugMode )
{
if ( ! m_CurrentDebugDisplaySettings . renderingDebugSettings . enableGaussianPyramid )
return ;
int w = camera . pixelWidth ;
int h = camera . pixelHeight ;
// TODO: This code should be turned into a method to be shared with InitAndClearBuffer
// where the output depth pyramid is allocated
//int w = camera.pixelWidth;
//int h = camera.pixelHeight;
int w = ( int ) camera . textureSize . x ;
int h = ( int ) camera . textureSize . y ;
int size = CalculatePyramidSize ( w , h ) ;
// The gaussian pyramid compute works in blocks of 8x8 so make sure the last lod has a
cmd . SetGlobalVector ( HDShaderIDs . _DepthPyramidMipSize , new Vector4 ( size , size , lodCount , 0 ) ) ;
// XRTODO: Fix
cmd . GetTemporaryRT ( HDShaderIDs . _DepthPyramidMips [ 0 ] , size , size , 0 , FilterMode . Bilinear , RenderTextureFormat . RFloat , RenderTextureReadWrite . Linear , 1 , true ) ;
m_GPUCopy . SampleCopyChannel_xyzw2x ( cmd , GetDepthTexture ( ) , HDShaderIDs . _DepthPyramidMips [ 0 ] , new Vector2 ( size , size ) ) ;
cmd . CopyTexture ( HDShaderIDs . _DepthPyramidMips [ 0 ] , 0 , 0 , m_DepthPyramidBuffer , 0 , 0 ) ;
{
mipSize > > = 1 ;
// XRTODO: Fix
cmd . GetTemporaryRT ( HDShaderIDs . _DepthPyramidMips [ i + 1 ] , mipSize , mipSize , 0 , FilterMode . Bilinear , RenderTextureFormat . RFloat , RenderTextureReadWrite . Linear , 1 , true ) ;
cmd . SetComputeTextureParam ( m_DepthPyramidCS , m_DepthPyramidKernel , "_Source" , HDShaderIDs . _DepthPyramidMips [ i ] ) ;
cmd . SetComputeTextureParam ( m_DepthPyramidCS , m_DepthPyramidKernel , "_Result" , HDShaderIDs . _DepthPyramidMips [ i + 1 ] ) ;
if ( debugMode = = m_CurrentDebugDisplaySettings . fullScreenDebugMode )
{
m_FullScreenDebugPushed = true ; // We need this flag because otherwise if no fullscreen debug is pushed, when we render the result in RenderDebug the temporary RT will not exist.
// XRTODO: Fix
cb . GetTemporaryRT ( m_DebugFullScreenTempRT , camera . pixelWidth , camera . pixelHeight , 0 , FilterMode . Point , RenderTextureFormat . ARGBHalf , RenderTextureReadWrite . Linear ) ;
cb . Blit ( textureID , m_DebugFullScreenTempRT ) ;
}
if ( debugMode = = m_CurrentDebugDisplaySettings . fullScreenDebugMode )
{
m_FullScreenDebugPushed = true ; // We need this flag because otherwise if no fullscreen debug is pushed, when we render the result in RenderDebug the temporary RT will not exist.
// XRTODO: Fix
cmd . GetTemporaryRT ( m_DebugFullScreenTempRT , width > > mipIndex , height > > mipIndex , 0 , FilterMode . Point , RenderTextureFormat . RFloat , RenderTextureReadWrite . Linear ) ;
cmd . CopyTexture ( textureID , 0 , mipIndex , m_DebugFullScreenTempRT , 0 , 0 ) ;
}
// Then overlays
float x = 0 ;
float overlayRatio = m_CurrentDebugDisplaySettings . debugOverlayRatio ;
// XRTODO: Maybe this stays, gotta fix
//float overlaySize = Math.Min(camera.camera.pixelHeight, camera.camera.pixelWidth) * overlayRatio;
float overlaySize = Math . Min ( camera . camera . pixelHeight , camera . camera . pixelWidth ) * overlayRatio ;
float y = camera . camera . pixelHeight - overlaySize ;
// Also we manage ourself the HDR format, here allocating fp16 directly.
// With scriptable render loop we can allocate temporary RT in a command buffer, they will not be release with ExecuteCommandBuffer
// These temporary surface are release automatically at the end of the scriptable render pipeline if not release explicitly
int w = camera . camera . pixelWidth ;
int h = camera . camera . pixelHeight ;
//int w = camera.camera.pixelWidth;
//int h = camera.camera.pixelHeight;
int w = ( int ) camera . textureSize . x ;
int h = ( int ) camera . textureSize . y ;
cmd . GetTemporaryRT ( m_CameraColorBuffer , w , h , 0 , FilterMode . Point , RenderTextureFormat . ARGBHalf , RenderTextureReadWrite . Linear , 1 , true ) ; // Enable UAV
cmd . GetTemporaryRT ( m_CameraSssDiffuseLightingBuffer , w , h , 0 , FilterMode . Point , RenderTextureFormat . RGB111110Float , RenderTextureReadWrite . Linear , 1 , true ) ; // Enable UAV
cmd . GetTemporaryRT ( m_CameraFilteringBuffer , w , h , 0 , FilterMode . Point , RenderTextureFormat . RGB111110Float , RenderTextureReadWrite . Linear , 1 , true ) ; // Enable UAV
var localDesc = camera . rtDesc ;
//cmd.GetTemporaryRT(m_CameraColorBuffer, w, h, 0, FilterMode.Point, RenderTextureFormat.ARGBHalf, RenderTextureReadWrite.Linear, 1, true); // Enable UAV
//cmd.GetTemporaryRT(m_CameraSssDiffuseLightingBuffer, w, h, 0, FilterMode.Point, RenderTextureFormat.RGB111110Float, RenderTextureReadWrite.Linear, 1, true); // Enable UAV
//cmd.GetTemporaryRT(m_CameraFilteringBuffer, w, h, 0, FilterMode.Point, RenderTextureFormat.RGB111110Float, RenderTextureReadWrite.Linear, 1, true); // Enable UAV
localDesc . colorFormat = RenderTextureFormat . ARGBHalf ;
localDesc . depthBufferBits = 0 ;
localDesc . sRGB = false ;
localDesc . msaaSamples = 1 ;
localDesc . enableRandomWrite = true ;
cmd . GetTemporaryRT ( m_CameraColorBuffer , localDesc , FilterMode . Point ) ; // Enable UAV
localDesc . colorFormat = RenderTextureFormat . RGB111110Float ;
cmd . GetTemporaryRT ( m_CameraSssDiffuseLightingBuffer , localDesc , FilterMode . Point ) ; // Enable UAV
cmd . GetTemporaryRT ( m_CameraFilteringBuffer , localDesc , FilterMode . Point ) ; // Enable UAV
// XRTODO: Fix this up for stereo
int s = CalculatePyramidSize ( w , h ) ;
m_GaussianPyramidColorBufferDesc . width = s ;
m_GaussianPyramidColorBufferDesc . height = s ;