internal void Setup(TAAData TaaData, TemporalAntiAliasing Taa) { // Set data m_TaaData = TaaData; m_taa = Taa; m_Material = new Material(Shader.Find(TaaShader)); }
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; }