コード例 #1
0
ファイル: TAAPass.cs プロジェクト: unitycoder/TAA_Unity_URP
 internal void Setup(TAAData TaaData, TemporalAntiAliasing Taa)
 {
     // Set data
     m_TaaData  = TaaData;
     m_taa      = Taa;
     m_Material = new Material(Shader.Find(TaaShader));
 }
コード例 #2
0
        void UpdateTAAData(RenderingData renderingData, TAAData TaaData, TemporalAntiAliasing Taa)
        {
            Camera  camera           = renderingData.cameraData.camera;
            Vector2 additionalSample = Utils.GenerateRandomOffset() * Taa.spread.value;

            TaaData.sampleOffset = additionalSample;
            TaaData.porjPreview  = previewProj;
            TaaData.viewPreview  = previewView;
            TaaData.projOverride = camera.orthographic
                       ? Utils.GetJitteredOrthographicProjectionMatrix(camera, TaaData.sampleOffset)
                       : Utils.GetJitteredPerspectiveProjectionMatrix(camera, TaaData.sampleOffset);
            TaaData.sampleOffset = new Vector2(TaaData.sampleOffset.x / camera.scaledPixelWidth, TaaData.sampleOffset.y / camera.scaledPixelHeight);
            previewView          = camera.worldToCameraMatrix;
            previewProj          = camera.projectionMatrix;
        }