@@ -14,7 +14,7 @@ public class RenderTextureSampler : BaseRenderTextureInput
14
14
15
15
RenderTexture m_renderRT ;
16
16
RenderTexture [ ] m_accumulateRTs = new RenderTexture [ 2 ] ;
17
- int m_renderWidth , m_renderHeight , m_outputWidth , m_outputHeight ;
17
+ int m_renderWidth , m_renderHeight ;
18
18
19
19
Material m_superMaterial ;
20
20
Material m_accumulateMaterial ;
@@ -115,12 +115,12 @@ public override void BeginRecording(RecordingSession session)
115
115
var aspect = AspectRatioHelper . GetRealAR ( rtsSettings . m_AspectRatio ) ;
116
116
m_renderHeight = ( int ) rtsSettings . m_RenderSize ;
117
117
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 ) ) ;
120
120
if ( rtsSettings . m_ForceEvenSize )
121
121
{
122
- m_outputWidth = ( m_outputWidth + 1 ) & ~ 1 ;
123
- m_outputHeight = ( m_outputHeight + 1 ) & ~ 1 ;
122
+ outputWidth = ( outputWidth + 1 ) & ~ 1 ;
123
+ outputHeight = ( outputHeight + 1 ) & ~ 1 ;
124
124
}
125
125
126
126
m_superMaterial = new Material ( superShader ) ;
@@ -140,7 +140,7 @@ public override void BeginRecording(RecordingSession session)
140
140
m_accumulateRTs [ i ] . wrapMode = TextureWrapMode . Clamp ;
141
141
m_accumulateRTs [ i ] . Create ( ) ;
142
142
}
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 ) ;
144
144
rt . Create ( ) ;
145
145
outputRT = rt ;
146
146
m_samples = new Vector2 [ ( int ) rtsSettings . m_SuperSampling ] ;
@@ -312,7 +312,7 @@ public override void NewFrameReady(RecordingSession session)
312
312
else
313
313
{
314
314
// 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 ) ) ;
316
316
m_superMaterial . SetFloat ( "_KernelCosPower" , rtsSettings . m_SuperKernelPower ) ;
317
317
m_superMaterial . SetFloat ( "_KernelScale" , rtsSettings . m_SuperKernelScale ) ;
318
318
m_superMaterial . SetFloat ( "_NormalizationFactor" , 1.0f / ( float ) rtsSettings . m_SuperSampling ) ;
@@ -415,4 +415,4 @@ void SaveRT(RenderTexture input)
415
415
File . WriteAllBytes ( "Recorder/DebugDump.png" , bytes ) ;
416
416
}
417
417
}
418
- }
418
+ }
0 commit comments