internal void RegisterCamera(AmplifyMotionCamera camera) { Camera actual = camera.GetComponent <Camera>(); if ((actual.cullingMask & (1 << gameObject.layer)) != 0 && !m_states.ContainsKey(actual)) { AmplifyMotion.MotionState state = null; switch (m_type) { case AmplifyMotion.ObjectType.Solid: state = new AmplifyMotion.SolidState(camera, this); break; case AmplifyMotion.ObjectType.Skinned: state = new AmplifyMotion.SkinnedState(camera, this); break; case AmplifyMotion.ObjectType.Cloth: state = new AmplifyMotion.ClothState(camera, this); break; #if !UNITY_PRE_5_3 case AmplifyMotion.ObjectType.Particle: state = new AmplifyMotion.ParticleState(camera, this); break; #endif default: throw new Exception("[AmplifyMotion] Invalid object type."); } camera.RegisterObject(this); m_states.Add(actual, state); } }
internal void RegisterCamera(AmplifyMotionCamera camera) { Camera component = camera.GetComponent <Camera>(); if ((component.cullingMask & 1 << base.gameObject.layer) != 0 && !this.m_states.ContainsKey(component)) { MotionState value; switch (this.m_type) { case ObjectType.Solid: value = new SolidState(camera, this); break; case ObjectType.Skinned: value = new SkinnedState(camera, this); break; case ObjectType.Cloth: value = new ClothState(camera, this); break; default: throw new Exception("[AmplifyMotion] Invalid object type."); } camera.RegisterObject(this); this.m_states.Add(component, value); } }
// Token: 0x06001F9E RID: 8094 RVA: 0x0018588C File Offset: 0x00183A8C public ParticleState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj) : base(owner, obj) { this.m_particleSystem = this.m_obj.GetComponent <ParticleSystem>(); this.m_renderer = this.m_particleSystem.GetComponent <ParticleSystemRenderer>(); this.rotationOverLifetime = this.m_particleSystem.rotationOverLifetime; this.rotationBySpeed = this.m_particleSystem.rotationBySpeed; }
internal static void UnregisterCamera(AmplifyMotionCamera cam) { foreach (AmplifyMotionObjectBase obj in m_activeObjects.Values) { obj.UnregisterCamera(cam); } m_activeCameras.Remove(cam.GetComponent <Camera>()); }
internal static void RegisterCamera(AmplifyMotionCamera cam) { AmplifyMotionEffectBase.m_activeCameras.Add(cam.GetComponent <Camera>(), cam); foreach (AmplifyMotionObjectBase current in AmplifyMotionEffectBase.m_activeObjects.Values) { current.RegisterCamera(cam); } }
// Token: 0x0600095E RID: 2398 RVA: 0x00049B1C File Offset: 0x00047D1C internal static void UnregisterCamera(AmplifyMotionCamera cam) { foreach (AmplifyMotionObjectBase amplifyMotionObjectBase in AmplifyMotionEffectBase.m_activeObjects.Values) { amplifyMotionObjectBase.UnregisterCamera(cam); } AmplifyMotionEffectBase.m_activeCameras.Remove(cam.GetComponent <Camera>()); }
internal static void RegisterCamera(AmplifyMotionCamera cam) { m_activeCameras.Add(cam.GetComponent <Camera>(), cam); foreach (AmplifyMotionObjectBase obj in m_activeObjects.Values) { obj.RegisterCamera(cam); } }
// Token: 0x06001F8A RID: 8074 RVA: 0x00184E43 File Offset: 0x00183043 public MotionState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj) { this.m_error = false; this.m_initialized = false; this.m_owner = owner; this.m_obj = obj; this.m_transform = obj.transform; }
public ParticleState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj ) : base( owner, obj ) { m_particleSystem = m_obj.GetComponent<ParticleSystem>(); m_renderer = m_particleSystem.GetComponent<ParticleSystemRenderer>(); rotationOverLifetime = m_particleSystem.rotationOverLifetime; rotationBySpeed = m_particleSystem.rotationBySpeed; }
internal void OnUpdateTransform(AmplifyMotionCamera owner, bool starting) { MotionState state; if (m_states.TryGetValue(owner.GetComponent <Camera>(), out state)) { state.UpdateTransform(starting); } }
public MotionState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj ) { m_error = false; m_initialized = false; m_owner = owner; m_obj = obj; m_transform = obj.transform; }
public ClothState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj) : base(owner, obj) { #if UNITY_4 m_cloth = m_obj.GetComponent <InteractiveCloth>(); #else m_cloth = m_obj.GetComponent <Cloth>(); #endif }
internal static void UnregisterCamera(AmplifyMotionCamera cam) { //Debug.Log( "Unregistering AmplifyMotionCamera: " + cam.name ); foreach (AmplifyMotionObjectBase obj in m_activeObjects.Values) { obj.UnregisterCamera(cam); } m_activeCameras.Remove(cam.Camera); }
internal static void RegisterCamera(AmplifyMotionCamera cam) { //Debug.Log( "Registering AmplifyMotionCamera: " + cam.name ); m_activeCameras.Add(cam.GetComponent <Camera>(), cam); foreach (AmplifyMotionObjectBase obj in m_activeObjects.Values) { obj.RegisterCamera(cam); } }
public MotionState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj ) { // TEMPORARY //m_name = obj.name; m_error = false; m_initialized = false; m_owner = owner; m_obj = obj; }
public MotionState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj) { // TEMPORARY //m_name = obj.name; m_error = false; m_initialized = false; m_owner = owner; m_obj = obj; }
// Token: 0x0600095D RID: 2397 RVA: 0x00049AA8 File Offset: 0x00047CA8 internal static void RegisterCamera(AmplifyMotionCamera cam) { if (!AmplifyMotionEffectBase.m_activeCameras.ContainsValue(cam)) { AmplifyMotionEffectBase.m_activeCameras.Add(cam.GetComponent <Camera>(), cam); } foreach (AmplifyMotionObjectBase amplifyMotionObjectBase in AmplifyMotionEffectBase.m_activeObjects.Values) { amplifyMotionObjectBase.RegisterCamera(cam); } }
internal void UnregisterCamera(AmplifyMotionCamera camera) { MotionState state; Camera actual = camera.GetComponent <Camera>(); if (m_states.TryGetValue(actual, out state)) { camera.UnregisterObject(this); m_states.Remove(actual); } }
// Token: 0x06000976 RID: 2422 RVA: 0x0004A528 File Offset: 0x00048728 private void OnPostRender() { bool qualityChanged = this.QualityLevel != this.m_qualityLevel; this.m_qualityLevel = this.QualityLevel; this.UpdateRenderTextures(qualityChanged); this.ResetObjectId(); bool flag = this.CameraMotionMult > float.Epsilon; bool clearColor = !flag || this.m_starting; float num = (this.DepthThreshold > float.Epsilon) ? (1f / this.DepthThreshold) : float.MaxValue; this.m_motionScaleNorm = ((this.m_deltaTime >= float.Epsilon) ? (this.MotionScale * (1f / this.m_deltaTime)) : 0f); this.m_fixedMotionScaleNorm = ((this.m_fixedDeltaTime >= float.Epsilon) ? (this.MotionScale * (1f / this.m_fixedDeltaTime)) : 0f); float scale = (!this.m_starting) ? this.m_motionScaleNorm : 0f; float fixedScale = (!this.m_starting) ? this.m_fixedMotionScaleNorm : 0f; Shader.SetGlobalFloat("_AM_MIN_VELOCITY", this.MinVelocity); Shader.SetGlobalFloat("_AM_MAX_VELOCITY", this.MaxVelocity); Shader.SetGlobalFloat("_AM_RCP_TOTAL_VELOCITY", 1f / (this.MaxVelocity - this.MinVelocity)); Shader.SetGlobalVector("_AM_DEPTH_THRESHOLD", new Vector2(this.DepthThreshold, num)); this.m_motionRT.DiscardContents(); this.m_baseCamera.PreRenderVectors(this.m_motionRT, clearColor, num); for (int i = 0; i < this.m_linkedCameraValues.Length; i++) { AmplifyMotionCamera amplifyMotionCamera = this.m_linkedCameraValues[i]; if (amplifyMotionCamera != null && amplifyMotionCamera.Overlay && amplifyMotionCamera.isActiveAndEnabled) { amplifyMotionCamera.PreRenderVectors(this.m_motionRT, clearColor, num); amplifyMotionCamera.RenderVectors(scale, fixedScale, this.QualityLevel); } } if (flag) { float num2 = (this.m_deltaTime >= float.Epsilon) ? (this.MotionScale * this.CameraMotionMult * (1f / this.m_deltaTime)) : 0f; float scale2 = (!this.m_starting) ? num2 : 0f; this.m_motionRT.DiscardContents(); this.m_baseCamera.RenderReprojectionVectors(this.m_motionRT, scale2); } this.m_baseCamera.RenderVectors(scale, fixedScale, this.QualityLevel); for (int j = 0; j < this.m_linkedCameraValues.Length; j++) { AmplifyMotionCamera amplifyMotionCamera2 = this.m_linkedCameraValues[j]; if (amplifyMotionCamera2 != null && amplifyMotionCamera2.Overlay && amplifyMotionCamera2.isActiveAndEnabled) { amplifyMotionCamera2.RenderVectors(scale, fixedScale, this.QualityLevel); } } this.m_starting = false; }
internal void UnregisterCamera(AmplifyMotionCamera camera) { Camera component = camera.GetComponent <Camera>(); MotionState motionState; if (this.m_states.TryGetValue(component, out motionState)) { camera.UnregisterObject(this); if (this.m_states.TryGetValue(component, out motionState)) { motionState.Shutdown(); } this.m_states.Remove(component); } }
void InitializeCameras() { List <Camera> cleanOverlayCameras = new List <Camera>(OverlayCameras.Length); for (int i = 0; i < OverlayCameras.Length; i++) { if (OverlayCameras[i] != null) { cleanOverlayCameras.Add(OverlayCameras[i]); } } Camera[] referenceCameras = new Camera[cleanOverlayCameras.Count + 1]; referenceCameras[0] = this.GetComponent <Camera>(); for (int i = 0; i < cleanOverlayCameras.Count; i++) { referenceCameras[i + 1] = cleanOverlayCameras[i]; } m_linkedCameras.Clear(); for (int i = 0; i < referenceCameras.Length; i++) { Camera reference = referenceCameras[i]; if (!m_linkedCameras.ContainsKey(reference)) { AmplifyMotionCamera cam = reference.gameObject.GetComponent <AmplifyMotionCamera>(); if (cam != null && cam.Instance != this) { DestroyImmediate(cam); cam = null; } if (cam == null) { CurrentInstance = this; cam = reference.gameObject.AddComponent <AmplifyMotionCamera>(); cam.SetOverlay(i > 0); CurrentInstance = null; } m_linkedCameras.Add(reference, cam); m_linkedCamerasChanged = true; } } }
internal void RegisterCamera(AmplifyMotionCamera camera) { Camera actual = camera.GetComponent <Camera>(); if ((actual.cullingMask & (1 << gameObject.layer)) != 0 && !m_states.ContainsKey(actual)) { MotionState state = null; switch (m_type) { case AmplifyMotionObjectType.Solid: state = new AmplifyMotion.SolidState(camera, this); break; case AmplifyMotionObjectType.Skinned: state = new AmplifyMotion.SkinnedState(camera, this); break; #if UNITY_3 || UNITY_4 case AmplifyMotionObjectType.Cloth: state = new AmplifyMotion.ClothState(camera, this); break; #endif default: throw new Exception("[AmplifyMotion] Invalid object type."); } m_fixedStep = false; #if UNITY_3 || UNITY_4 if (m_type == AmplifyMotionObjectType.Cloth) { m_fixedStep = true; } else if (m_type == AmplifyMotionObjectType.Solid) #else if (m_type == AmplifyMotionObjectType.Solid) #endif { Rigidbody rb = GetComponent <Rigidbody>(); if (rb != null && rb.interpolation == RigidbodyInterpolation.None) { m_fixedStep = true; } } camera.RegisterObject(this); m_states.Add(actual, state); } }
private void OnPostRender() { bool flag = this.QualityLevel != this.m_qualityLevel; if (flag) { this.CreateMaterials(); this.m_qualityLevel = this.QualityLevel; } this.UpdateRenderTextures(flag); this.ResetObjectId(); bool flag2 = this.CameraMotionMult > 1.401298E-45f; bool clearColor = !flag2 || this.m_starting; float y = (this.DepthThreshold <= 1.401298E-45f) ? 3.40282347E+38f : (1f / this.DepthThreshold); this.m_motionScaleNorm = ((this.m_deltaTime < 1.401298E-45f) ? 0f : (this.MotionScale * (1f / this.m_deltaTime))); this.m_fixedMotionScaleNorm = ((this.m_fixedDeltaTime < 1.401298E-45f) ? 0f : (this.MotionScale * (1f / this.m_fixedDeltaTime))); float scale = this.m_starting ? 0f : this.m_motionScaleNorm; float fixedScale = this.m_starting ? 0f : this.m_fixedMotionScaleNorm; AmplifyMotionEffectBase.DiscardContents(this.m_motionRT); this.m_updateCB.Clear(); this.m_renderCB.Clear(); this.m_renderCB.SetGlobalFloat("_AM_MIN_VELOCITY", this.MinVelocity); this.m_renderCB.SetGlobalFloat("_AM_MAX_VELOCITY", this.MaxVelocity); this.m_renderCB.SetGlobalFloat("_AM_RCP_TOTAL_VELOCITY", 1f / (this.MaxVelocity - this.MinVelocity)); this.m_renderCB.SetGlobalVector("_AM_DEPTH_THRESHOLD", new Vector2(this.DepthThreshold, y)); this.m_renderCB.SetRenderTarget(this.m_motionRT); this.m_renderCB.ClearRenderTarget(true, clearColor, Color.black); if (flag2) { float num = (this.m_deltaTime < 1.401298E-45f) ? 0f : (this.MotionScale * this.CameraMotionMult * (1f / this.m_deltaTime)); float scale2 = this.m_starting ? 0f : num; this.RenderReprojectionVectors(this.m_renderCB, this.m_motionRT, scale2); } this.m_baseCamera.RenderVectors(this.m_renderCB, scale, fixedScale, this.QualityLevel); for (int i = 0; i < this.m_linkedCameraValues.Length; i++) { AmplifyMotionCamera amplifyMotionCamera = this.m_linkedCameraValues[i]; if (amplifyMotionCamera != null && amplifyMotionCamera.Overlay && amplifyMotionCamera.isActiveAndEnabled) { this.m_linkedCameraValues[i].RenderVectors(this.m_renderCB, scale, fixedScale, this.QualityLevel); } } this.m_starting = false; }
void InitializeCameras() { List <Camera> cleanOverlayCameras = new List <Camera>(OverlayCameras.Length); for (int i = 0; i < OverlayCameras.Length; i++) { if (OverlayCameras[i] != null) { cleanOverlayCameras.Add(OverlayCameras[i]); } } Camera[] referenceCameras = new Camera[cleanOverlayCameras.Count + 1]; referenceCameras[0] = m_camera; for (int i = 0; i < cleanOverlayCameras.Count; i++) { referenceCameras[i + 1] = cleanOverlayCameras[i]; } m_linkedCameras.Clear(); for (int i = 0; i < referenceCameras.Length; i++) { Camera reference = referenceCameras[i]; if (!m_linkedCameras.ContainsKey(reference)) { AmplifyMotionCamera cam = reference.gameObject.GetComponent <AmplifyMotionCamera>(); if (cam != null) { cam.enabled = false; cam.enabled = true; } else { cam = reference.gameObject.AddComponent <AmplifyMotionCamera>(); } cam.LinkTo(this, i > 0); m_linkedCameras.Add(reference, cam); m_linkedCamerasChanged = true; } } }
private void OnDestroy() { AmplifyMotionCamera[] array = this.m_linkedCameras.Values.ToArray <AmplifyMotionCamera>(); AmplifyMotionCamera[] array2 = array; for (int i = 0; i < array2.Length; i++) { AmplifyMotionCamera amplifyMotionCamera = array2[i]; if (amplifyMotionCamera != null && amplifyMotionCamera.gameObject != base.gameObject) { Camera component = amplifyMotionCamera.GetComponent <Camera>(); if (component != null) { component.targetTexture = null; } UnityEngine.Object.DestroyImmediate(amplifyMotionCamera); } } this.DestroyRenderTextures(); this.DestroyMaterials(); }
internal void RegisterCamera( AmplifyMotionCamera camera ) { Camera actual = camera.GetComponent<Camera>(); if ( ( actual.cullingMask & ( 1 << gameObject.layer ) ) != 0 && !m_states.ContainsKey( actual ) ) { MotionState state =null; switch ( m_type ) { case AmplifyMotionObjectType.Solid: state = new AmplifyMotion.SolidState( camera, this ); break; case AmplifyMotionObjectType.Skinned: state = new AmplifyMotion.SkinnedState( camera, this ); break; #if UNITY_3 || UNITY_4 case AmplifyMotionObjectType.Cloth: state = new AmplifyMotion.ClothState( camera, this ); break; #endif default: throw new Exception( "[AmplifyMotion] Invalid object type." ); } m_fixedStep = false; #if UNITY_3 || UNITY_4 if ( m_type == AmplifyMotionObjectType.Cloth ) m_fixedStep = true; else if ( m_type == AmplifyMotionObjectType.Solid ) #else if ( m_type == AmplifyMotionObjectType.Solid ) #endif { Rigidbody rb = GetComponent<Rigidbody>(); if ( rb != null && rb.interpolation == RigidbodyInterpolation.None ) m_fixedStep = true; } camera.RegisterObject( this ); m_states.Add( actual, state ); } }
// Token: 0x0600095B RID: 2395 RVA: 0x00049990 File Offset: 0x00047B90 private void InitializeCameras() { List <Camera> list = new List <Camera>(this.OverlayCameras.Length); for (int i = 0; i < this.OverlayCameras.Length; i++) { if (this.OverlayCameras[i] != null) { list.Add(this.OverlayCameras[i]); } } Camera[] array = new Camera[list.Count + 1]; array[0] = this.m_camera; for (int j = 0; j < list.Count; j++) { array[j + 1] = list[j]; } this.m_linkedCameras.Clear(); for (int k = 0; k < array.Length; k++) { Camera camera = array[k]; if (!this.m_linkedCameras.ContainsKey(camera)) { AmplifyMotionCamera amplifyMotionCamera = camera.gameObject.GetComponent <AmplifyMotionCamera>(); if (amplifyMotionCamera != null) { amplifyMotionCamera.enabled = false; amplifyMotionCamera.enabled = true; } else { amplifyMotionCamera = camera.gameObject.AddComponent <AmplifyMotionCamera>(); } amplifyMotionCamera.LinkTo(this, k > 0); this.m_linkedCameras.Add(camera, amplifyMotionCamera); this.m_linkedCamerasChanged = true; } } }
public ParticleState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj ) : base( owner, obj ) { m_particleSystem = m_obj.GetComponent<ParticleSystem>(); m_meshRenderer = m_particleSystem.GetComponent<Renderer>().GetComponent<ParticleSystemRenderer>(); }
internal static void RegisterCamera(AmplifyMotionCamera cam) { AmplifyMotionEffectBase.m_activeCameras.Add(cam.GetComponent<Camera>(), cam); foreach (AmplifyMotionObjectBase current in AmplifyMotionEffectBase.m_activeObjects.Values) { current.RegisterCamera(cam); } }
internal static void UnregisterCamera( AmplifyMotionCamera cam ) { //Debug.Log( "Unregistering AmplifyMotionCamera: " + cam.name ); foreach ( AmplifyMotionObjectBase obj in m_activeObjects.Values ) obj.UnregisterCamera( cam ); m_activeCameras.Remove( cam.Camera ); }
internal static void UnregisterCamera( AmplifyMotionCamera cam ) { foreach ( AmplifyMotionObjectBase obj in m_activeObjects.Values ) obj.UnregisterCamera( cam ); m_activeCameras.Remove( cam.GetComponent<Camera>() ); }
public ClothState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj) : base(owner, obj) { m_cloth = m_obj.GetComponent <Cloth>(); }
internal void OnUpdateTransform( AmplifyMotionCamera owner, bool starting ) { AmplifyMotion.MotionState state; if ( m_states.TryGetValue( owner.GetComponent<Camera>(), out state ) ) { if ( !state.Error ) state.UpdateTransform( starting ); } }
public ClothState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj ) : base( owner, obj ) { m_cloth = m_obj.GetComponent<InteractiveCloth>(); }
internal void UnregisterCamera( AmplifyMotionCamera camera ) { AmplifyMotion.MotionState state; Camera actual = camera.GetComponent<Camera>(); if ( m_states.TryGetValue( actual, out state ) ) { camera.UnregisterObject( this ); if ( m_states.TryGetValue( actual, out state ) ) state.Shutdown(); m_states.Remove( actual ); } }
internal static void RegisterCamera( AmplifyMotionCamera cam ) { m_activeCameras.Add( cam.GetComponent<Camera>(), cam ); foreach ( AmplifyMotionObjectBase obj in m_activeObjects.Values ) obj.RegisterCamera( cam ); }
void OnPostRender() { bool qualityChanged = (QualityLevel != m_qualityLevel); if (qualityChanged) { CreateMaterials(); m_qualityLevel = QualityLevel; } UpdateRenderTextures(qualityChanged); ResetObjectId(); #if UNITY_4 RenderBuffer prevColor = Graphics.activeColorBuffer; RenderBuffer prevDepth = Graphics.activeDepthBuffer; #endif bool cameraMotion = (CameraMotionMult > float.Epsilon); bool clearColor = !cameraMotion || m_starting; float rcpDepthThreshold = (DepthThreshold > float.Epsilon) ? 1.0f / DepthThreshold : float.MaxValue; m_motionScaleNorm = (m_deltaTime >= float.Epsilon) ? MotionScale * (1.0f / m_deltaTime) : 0; m_fixedMotionScaleNorm = (m_fixedDeltaTime >= float.Epsilon) ? MotionScale * (1.0f / m_fixedDeltaTime) : 0; float objectScale = !m_starting ? m_motionScaleNorm : 0; float objectFixedScale = !m_starting ? m_fixedMotionScaleNorm : 0; DiscardContents(m_motionRT); #if UNITY_4 Graphics.SetRenderTarget(m_motionRT); GL.Clear(true, clearColor, Color.black); Shader.SetGlobalFloat("_AM_MIN_VELOCITY", MinVelocity); Shader.SetGlobalFloat("_AM_MAX_VELOCITY", MaxVelocity); Shader.SetGlobalFloat("_AM_RCP_TOTAL_VELOCITY", 1.0f / (MaxVelocity - MinVelocity)); Shader.SetGlobalVector("_AM_DEPTH_THRESHOLD", new Vector2(DepthThreshold, rcpDepthThreshold)); #else m_updateCB.Clear(); m_renderCB.Clear(); m_renderCB.SetGlobalFloat("_AM_MIN_VELOCITY", MinVelocity); m_renderCB.SetGlobalFloat("_AM_MAX_VELOCITY", MaxVelocity); m_renderCB.SetGlobalFloat("_AM_RCP_TOTAL_VELOCITY", 1.0f / (MaxVelocity - MinVelocity)); m_renderCB.SetGlobalVector("_AM_DEPTH_THRESHOLD", new Vector2(DepthThreshold, rcpDepthThreshold)); m_renderCB.SetRenderTarget(m_motionRT); m_renderCB.ClearRenderTarget(true, clearColor, Color.black); #endif if (cameraMotion) { float cameraMotionScaleNorm = (m_deltaTime >= float.Epsilon) ? MotionScale * CameraMotionMult * (1.0f / m_deltaTime) : 0; float cameraScale = !m_starting ? cameraMotionScaleNorm : 0; #if UNITY_4 RenderReprojectionVectors(m_motionRT, cameraScale); #else RenderReprojectionVectors(m_renderCB, m_motionRT, cameraScale); #endif } #if UNITY_4 m_baseCamera.RenderVectors(objectScale, objectFixedScale, QualityLevel); #else // base camera m_baseCamera.RenderVectors(m_renderCB, objectScale, objectFixedScale, QualityLevel); // overlay cameras for (int i = 0; i < m_linkedCameraValues.Length; i++) { AmplifyMotionCamera cam = m_linkedCameraValues[i]; if (cam != null && cam.Overlay && cam.isActiveAndEnabled) { m_linkedCameraValues[i].RenderVectors(m_renderCB, objectScale, objectFixedScale, QualityLevel); } } #endif m_starting = false; #if UNITY_4 Graphics.SetRenderTarget(prevColor, prevDepth); #endif }
public SkinnedState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj ) : base(owner, obj) { m_skinnedRenderer = m_obj.GetComponent<SkinnedMeshRenderer>(); }
// Token: 0x06001FAF RID: 8111 RVA: 0x001863AF File Offset: 0x001845AF public SkinnedState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj) : base(owner, obj) { this.m_renderer = this.m_obj.GetComponent <SkinnedMeshRenderer>(); }
public ClothState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj) : base(owner, obj) { this.m_cloth = this.m_obj.GetComponent<Cloth>(); }
internal void RegisterCamera( AmplifyMotionCamera camera ) { Camera actual = camera.GetComponent<Camera>(); if ( ( actual.cullingMask & ( 1 << gameObject.layer ) ) != 0 && !m_states.ContainsKey( actual ) ) { AmplifyMotion.MotionState state = null; switch ( m_type ) { case AmplifyMotion.ObjectType.Solid: state = new AmplifyMotion.SolidState( camera, this ); break; case AmplifyMotion.ObjectType.Skinned: state = new AmplifyMotion.SkinnedState( camera, this ); break; case AmplifyMotion.ObjectType.Cloth: state = new AmplifyMotion.ClothState( camera, this ); break; #if !UNITY_PRE_5_3 case AmplifyMotion.ObjectType.Particle: state = new AmplifyMotion.ParticleState( camera, this ); break; #endif default: throw new Exception( "[AmplifyMotion] Invalid object type." ); } camera.RegisterObject( this ); m_states.Add( actual, state ); } }
public ParticleState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj) : base(owner, obj) { m_particleSystem = m_obj.GetComponent <ParticleSystem>(); m_meshRenderer = m_particleSystem.GetComponent <Renderer>().GetComponent <ParticleSystemRenderer>(); }
internal static void UnregisterCamera(AmplifyMotionCamera cam) { foreach (AmplifyMotionObjectBase current in AmplifyMotionEffectBase.m_activeObjects.Values) { current.UnregisterCamera(cam); } AmplifyMotionEffectBase.m_activeCameras.Remove(cam.GetComponent<Camera>()); }
void OnPostRender() { bool qualityChanged = (QualityLevel != m_qualityLevel); m_qualityLevel = QualityLevel; UpdateRenderTextures(qualityChanged); ResetObjectId(); bool cameraMotion = (CameraMotionMult > float.Epsilon); bool clearColor = !cameraMotion || m_starting; float rcpDepthThreshold = (DepthThreshold > float.Epsilon) ? 1.0f / DepthThreshold : float.MaxValue; m_motionScaleNorm = (m_deltaTime >= float.Epsilon) ? MotionScale * (1.0f / m_deltaTime) : 0; m_fixedMotionScaleNorm = (m_fixedDeltaTime >= float.Epsilon) ? MotionScale * (1.0f / m_fixedDeltaTime) : 0; float objectScale = !m_starting ? m_motionScaleNorm : 0; float objectFixedScale = !m_starting ? m_fixedMotionScaleNorm : 0; Shader.SetGlobalFloat("_AM_MIN_VELOCITY", MinVelocity); Shader.SetGlobalFloat("_AM_MAX_VELOCITY", MaxVelocity); Shader.SetGlobalFloat("_AM_RCP_TOTAL_VELOCITY", 1.0f / (MaxVelocity - MinVelocity)); Shader.SetGlobalVector("_AM_DEPTH_THRESHOLD", new Vector2(DepthThreshold, rcpDepthThreshold)); // pre-render base camera m_motionRT.DiscardContents(); m_baseCamera.PreRenderVectors(m_motionRT, clearColor, rcpDepthThreshold); // pre-render overlay cameras for (int i = 0; i < m_linkedCameraValues.Length; i++) { AmplifyMotionCamera cam = m_linkedCameraValues[i]; if (cam != null && cam.Overlay && cam.isActiveAndEnabled) { cam.PreRenderVectors(m_motionRT, clearColor, rcpDepthThreshold); cam.RenderVectors(objectScale, objectFixedScale, QualityLevel); } } if (cameraMotion) { float cameraMotionScaleNorm = (m_deltaTime >= float.Epsilon) ? MotionScale * CameraMotionMult * (1.0f / m_deltaTime) : 0; float cameraScale = !m_starting ? cameraMotionScaleNorm : 0; m_motionRT.DiscardContents(); m_baseCamera.RenderReprojectionVectors(m_motionRT, cameraScale); } // render base camera m_baseCamera.RenderVectors(objectScale, objectFixedScale, QualityLevel); // render overlay cameras for (int i = 0; i < m_linkedCameraValues.Length; i++) { AmplifyMotionCamera cam = m_linkedCameraValues[i]; if (cam != null && cam.Overlay && cam.isActiveAndEnabled) { cam.RenderVectors(objectScale, objectFixedScale, QualityLevel); } } m_starting = false; }
public SolidState(AmplifyMotionCamera owner, AmplifyMotionObjectBase obj) : base(owner, obj) { m_meshRenderer = m_obj.GetComponent <MeshRenderer>(); }
public SolidState( AmplifyMotionCamera owner, AmplifyMotionObjectBase obj ) : base(owner, obj) { m_meshRenderer = m_obj.GetComponent<MeshRenderer>(); }