using System;
using Cpp2IlInjected;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x020005FC RID: 1532
	[Token(Token = "0x20005FC")]
	[ExecuteInEditMode]
	[RequireComponent(typeof(Camera))]
	[AddComponentMenu("Image Effects/Camera/Camera Motion Blur")]
	public class CameraMotionBlur : PostEffectsBase
	{
		// Token: 0x06003187 RID: 12679 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003187")]
		[Address(RVA = "0xB8EE90", Offset = "0xB8DE90", VA = "0x180B8EE90")]
		private void CalculateViewProjection()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06003188 RID: 12680 RVA: 0x0006AF24 File Offset: 0x00069124
		[Token(Token = "0x6003188")]
		[Address(RVA = "0xB91850", Offset = "0xB90850", VA = "0x180B91850")]
		private new void Start()
		{
			bool flag = this.CheckResources();
			Camera camera = this._camera;
			int num = 0;
			if (camera == num)
			{
				Camera component = base.GetComponent<Camera>();
				this._camera = component;
			}
			bool activeInHierarchy = base.gameObject.activeInHierarchy;
			this.wasActive = activeInHierarchy;
			Matrix4x4[] array = new Matrix4x4[2];
			this.currentStereoViewProjMat = array;
			Matrix4x4[] array2 = new Matrix4x4[2];
			this.prevStereoViewProjMat = array2;
			this.CalculateViewProjection();
			this.Remember();
			this.wasActive = false;
		}

		// Token: 0x06003189 RID: 12681 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003189")]
		[Address(RVA = "0xB8F820", Offset = "0xB8E820", VA = "0x180B8F820")]
		private void OnEnable()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600318A RID: 12682 RVA: 0x0006AFA8 File Offset: 0x000691A8
		[Token(Token = "0x600318A")]
		[Address(RVA = "0xB8F670", Offset = "0xB8E670", VA = "0x180B8F670")]
		private void OnDisable()
		{
			Material material = this.motionBlurMaterial;
			if (0 != material)
			{
				UnityEngine.Object.DestroyImmediate(this.motionBlurMaterial);
				this.motionBlurMaterial = (ulong)0L;
			}
			Material material2 = this.dx11MotionBlurMaterial;
			if (0 != material2)
			{
				UnityEngine.Object.DestroyImmediate(this.dx11MotionBlurMaterial);
				this.dx11MotionBlurMaterial = (ulong)0L;
			}
			GameObject gameObject = this.tmpCam;
			if (0 != gameObject)
			{
				UnityEngine.Object.DestroyImmediate(gameObject);
			}
		}

		// Token: 0x0600318B RID: 12683 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600318B")]
		[Address(RVA = "0xB8F160", Offset = "0xB8E160", VA = "0x180B8F160", Slot = "4")]
		public override bool CheckResources()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600318C RID: 12684 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600318C")]
		[Address(RVA = "0xB8F8F0", Offset = "0xB8E8F0", VA = "0x180B8F8F0")]
		private void OnRenderImage(RenderTexture source, RenderTexture destination)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600318D RID: 12685 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600318D")]
		[Address(RVA = "0xB915C0", Offset = "0xB905C0", VA = "0x180B915C0")]
		private void Remember()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600318E RID: 12686 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600318E")]
		[Address(RVA = "0xB8F210", Offset = "0xB8E210", VA = "0x180B8F210")]
		private Camera GetTmpCam()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600318F RID: 12687 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600318F")]
		[Address(RVA = "0xB917A0", Offset = "0xB907A0", VA = "0x180B917A0")]
		private void StartFrame()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06003190 RID: 12688 RVA: 0x0006B018 File Offset: 0x00069218
		[Token(Token = "0x6003190")]
		[Address(RVA = "0xB91AD0", Offset = "0xB90AD0", VA = "0x180B91AD0")]
		private static int divRoundUp(int x, int d)
		{
			int num = d - 1;
			return num + x;
		}

		// Token: 0x06003191 RID: 12689 RVA: 0x0006B030 File Offset: 0x00069230
		[Token(Token = "0x6003191")]
		[Address(RVA = "0xB919E0", Offset = "0xB909E0", VA = "0x180B919E0")]
		public CameraMotionBlur()
		{
			Vector3 one = Vector3.one;
			int num = 0;
			float z = one.z;
			this.previewScale.z = z;
			this.rotationScale = 1f;
			this.maxVelocity = 8f;
			this.minVelocity = 0.1f;
			this.velocityScale = 0.375f;
			this.softZDistance = 0.005f;
			this.velocityDownsample = (int)((ulong)1L);
			int num2 = num;
			this.excludeLayers = num2;
			this.jitter = 0.05f;
			this.showVelocityScale = 1f;
			float z2 = Vector3.forward.z;
			this.prevFrameForward.z = z2;
			float z3 = Vector3.up.z;
			this.prevFrameUp.z = z3;
			float z4 = Vector3.zero.z;
			this.prevFramePos.z = z4;
			base..ctor();
		}

		// Token: 0x04003B01 RID: 15105
		[Token(Token = "0x4003B01")]
		private static float MAX_RADIUS;

		// Token: 0x04003B02 RID: 15106
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003B02")]
		public CameraMotionBlur.MotionBlurFilter filterType = (CameraMotionBlur.MotionBlurFilter)((ulong)2L);

		// Token: 0x04003B03 RID: 15107
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x4003B03")]
		public bool preview;

		// Token: 0x04003B04 RID: 15108
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003B04")]
		public Vector3 previewScale;

		// Token: 0x04003B05 RID: 15109
		[FieldOffset(Offset = "0x3C")]
		[Token(Token = "0x4003B05")]
		public float movementScale;

		// Token: 0x04003B06 RID: 15110
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003B06")]
		public float rotationScale;

		// Token: 0x04003B07 RID: 15111
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x4003B07")]
		public float maxVelocity;

		// Token: 0x04003B08 RID: 15112
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003B08")]
		public float minVelocity;

		// Token: 0x04003B09 RID: 15113
		[FieldOffset(Offset = "0x4C")]
		[Token(Token = "0x4003B09")]
		public float velocityScale;

		// Token: 0x04003B0A RID: 15114
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003B0A")]
		public float softZDistance;

		// Token: 0x04003B0B RID: 15115
		[FieldOffset(Offset = "0x54")]
		[Token(Token = "0x4003B0B")]
		public int velocityDownsample;

		// Token: 0x04003B0C RID: 15116
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x4003B0C")]
		public LayerMask excludeLayers;

		// Token: 0x04003B0D RID: 15117
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x4003B0D")]
		private GameObject tmpCam;

		// Token: 0x04003B0E RID: 15118
		[FieldOffset(Offset = "0x68")]
		[Token(Token = "0x4003B0E")]
		public Shader shader;

		// Token: 0x04003B0F RID: 15119
		[FieldOffset(Offset = "0x70")]
		[Token(Token = "0x4003B0F")]
		public Shader dx11MotionBlurShader;

		// Token: 0x04003B10 RID: 15120
		[FieldOffset(Offset = "0x78")]
		[Token(Token = "0x4003B10")]
		public Shader replacementClear;

		// Token: 0x04003B11 RID: 15121
		[FieldOffset(Offset = "0x80")]
		[Token(Token = "0x4003B11")]
		private Material motionBlurMaterial;

		// Token: 0x04003B12 RID: 15122
		[FieldOffset(Offset = "0x88")]
		[Token(Token = "0x4003B12")]
		private Material dx11MotionBlurMaterial;

		// Token: 0x04003B13 RID: 15123
		[FieldOffset(Offset = "0x90")]
		[Token(Token = "0x4003B13")]
		public Texture2D noiseTexture;

		// Token: 0x04003B14 RID: 15124
		[FieldOffset(Offset = "0x98")]
		[Token(Token = "0x4003B14")]
		public float jitter;

		// Token: 0x04003B15 RID: 15125
		[FieldOffset(Offset = "0x9C")]
		[Token(Token = "0x4003B15")]
		public bool showVelocity;

		// Token: 0x04003B16 RID: 15126
		[FieldOffset(Offset = "0xA0")]
		[Token(Token = "0x4003B16")]
		public float showVelocityScale;

		// Token: 0x04003B17 RID: 15127
		[FieldOffset(Offset = "0xA4")]
		[Token(Token = "0x4003B17")]
		private Matrix4x4 currentViewProjMat;

		// Token: 0x04003B18 RID: 15128
		[FieldOffset(Offset = "0xE8")]
		[Token(Token = "0x4003B18")]
		private Matrix4x4[] currentStereoViewProjMat;

		// Token: 0x04003B19 RID: 15129
		[FieldOffset(Offset = "0xF0")]
		[Token(Token = "0x4003B19")]
		private Matrix4x4 prevViewProjMat;

		// Token: 0x04003B1A RID: 15130
		[FieldOffset(Offset = "0x130")]
		[Token(Token = "0x4003B1A")]
		private Matrix4x4[] prevStereoViewProjMat;

		// Token: 0x04003B1B RID: 15131
		[FieldOffset(Offset = "0x138")]
		[Token(Token = "0x4003B1B")]
		private int prevFrameCount;

		// Token: 0x04003B1C RID: 15132
		[FieldOffset(Offset = "0x13C")]
		[Token(Token = "0x4003B1C")]
		private bool wasActive;

		// Token: 0x04003B1D RID: 15133
		[FieldOffset(Offset = "0x140")]
		[Token(Token = "0x4003B1D")]
		private Vector3 prevFrameForward;

		// Token: 0x04003B1E RID: 15134
		[FieldOffset(Offset = "0x14C")]
		[Token(Token = "0x4003B1E")]
		private Vector3 prevFrameUp;

		// Token: 0x04003B1F RID: 15135
		[FieldOffset(Offset = "0x158")]
		[Token(Token = "0x4003B1F")]
		private Vector3 prevFramePos;

		// Token: 0x04003B20 RID: 15136
		[FieldOffset(Offset = "0x168")]
		[Token(Token = "0x4003B20")]
		private Camera _camera;

		// Token: 0x020005FD RID: 1533
		[Token(Token = "0x20005FD")]
		public enum MotionBlurFilter
		{
			// Token: 0x04003B22 RID: 15138
			[Token(Token = "0x4003B22")]
			CameraMotion,
			// Token: 0x04003B23 RID: 15139
			[Token(Token = "0x4003B23")]
			LocalBlur,
			// Token: 0x04003B24 RID: 15140
			[Token(Token = "0x4003B24")]
			Reconstruction,
			// Token: 0x04003B25 RID: 15141
			[Token(Token = "0x4003B25")]
			ReconstructionDX11,
			// Token: 0x04003B26 RID: 15142
			[Token(Token = "0x4003B26")]
			ReconstructionDisc
		}
	}
}
