@@ -14,7 +14,7 @@ public class RenderTextureSampler : BaseRenderTextureInput
1414
1515 RenderTexture m_renderRT ;
1616 RenderTexture [ ] m_accumulateRTs = new RenderTexture [ 2 ] ;
17- int m_renderWidth , m_renderHeight , m_outputWidth , m_outputHeight ;
17+ int m_renderWidth , m_renderHeight ;
1818
1919 Material m_superMaterial ;
2020 Material m_accumulateMaterial ;
@@ -115,12 +115,12 @@ public override void BeginRecording(RecordingSession session)
115115 var aspect = AspectRatioHelper . GetRealAR ( rtsSettings . m_AspectRatio ) ;
116116 m_renderHeight = ( int ) rtsSettings . m_RenderSize ;
117117 m_renderWidth = Mathf . Min ( 16 * 1024 , Mathf . RoundToInt ( m_renderHeight * aspect ) ) ;
118- m_outputHeight = ( int ) rtsSettings . m_FinalSize ;
119- m_outputWidth = Mathf . Min ( 16 * 1024 , Mathf . RoundToInt ( m_outputHeight * aspect ) ) ;
118+ outputHeight = ( int ) rtsSettings . m_FinalSize ;
119+ outputWidth = Mathf . Min ( 16 * 1024 , Mathf . RoundToInt ( outputHeight * aspect ) ) ;
120120 if ( rtsSettings . m_ForceEvenSize )
121121 {
122- m_outputWidth = ( m_outputWidth + 1 ) & ~ 1 ;
123- m_outputHeight = ( m_outputHeight + 1 ) & ~ 1 ;
122+ outputWidth = ( outputWidth + 1 ) & ~ 1 ;
123+ outputHeight = ( outputHeight + 1 ) & ~ 1 ;
124124 }
125125
126126 m_superMaterial = new Material ( superShader ) ;
@@ -140,7 +140,7 @@ public override void BeginRecording(RecordingSession session)
140140 m_accumulateRTs [ i ] . wrapMode = TextureWrapMode . Clamp ;
141141 m_accumulateRTs [ i ] . Create ( ) ;
142142 }
143- var rt = new RenderTexture ( m_outputWidth , m_outputHeight , 0 , RenderTextureFormat . DefaultHDR , RenderTextureReadWrite . Linear ) ;
143+ var rt = new RenderTexture ( outputWidth , outputHeight , 0 , RenderTextureFormat . DefaultHDR , RenderTextureReadWrite . Linear ) ;
144144 rt . Create ( ) ;
145145 outputRT = rt ;
146146 m_samples = new Vector2 [ ( int ) rtsSettings . m_SuperSampling ] ;
@@ -312,7 +312,7 @@ public override void NewFrameReady(RecordingSession session)
312312 else
313313 {
314314 // Ideally we would use a separable filter here, but we're massively bound by readback and disk anyway for hi-res.
315- m_superMaterial . SetVector ( "_Target_TexelSize" , new Vector4 ( 1f / m_outputWidth , 1f / m_outputHeight , m_outputWidth , m_outputHeight ) ) ;
315+ m_superMaterial . SetVector ( "_Target_TexelSize" , new Vector4 ( 1f / outputWidth , 1f / outputHeight , outputWidth , outputHeight ) ) ;
316316 m_superMaterial . SetFloat ( "_KernelCosPower" , rtsSettings . m_SuperKernelPower ) ;
317317 m_superMaterial . SetFloat ( "_KernelScale" , rtsSettings . m_SuperKernelScale ) ;
318318 m_superMaterial . SetFloat ( "_NormalizationFactor" , 1.0f / ( float ) rtsSettings . m_SuperSampling ) ;
@@ -415,4 +415,4 @@ void SaveRT(RenderTexture input)
415415 File . WriteAllBytes ( "Recorder/DebugDump.png" , bytes ) ;
416416 }
417417 }
418- }
418+ }
0 commit comments