protected override void Initilize(WaveSpectrumCondition condition, float time) { if (base.InitMaterial == null) { throw new InvalidOperationException("GPU buffer has not had its Init material set"); } if (base.InitPass == -1) { throw new InvalidOperationException("GPU buffer has not had its Init material pass set"); } base.InitMaterial.SetTexture("Ceto_Spectrum01", (!(condition.Spectrum01 != null)) ? Texture2D.blackTexture : condition.Spectrum01); base.InitMaterial.SetTexture("Ceto_Spectrum23", (!(condition.Spectrum23 != null)) ? Texture2D.blackTexture : condition.Spectrum23); base.InitMaterial.SetTexture("Ceto_WTable", condition.WTable); base.InitMaterial.SetVector("Ceto_InverseGridSizes", condition.InverseGridSizes()); base.InitMaterial.SetVector("Ceto_GridSizes", condition.GridSizes); base.InitMaterial.SetVector("Ceto_Offset", this.m_offset); base.InitMaterial.SetFloat("Ceto_Time", time); this.m_tmpList.Clear(); int num = this.m_buffers.Length; for (int i = 0; i < num; i++) { if (!this.m_buffers[i].disabled) { this.m_tmpList.Add(this.m_buffers[i].data[1]); } } num = this.m_tmpList.Count; if (num == 0) { return; } if (num == 1) { Graphics.Blit(null, this.m_tmpList[0], base.InitMaterial, base.InitPass); } else if (num == 2) { this.m_tmpBuffer2[0] = this.m_tmpList[0].colorBuffer; this.m_tmpBuffer2[1] = this.m_tmpList[1].colorBuffer; RTUtility.MultiTargetBlit(this.m_tmpBuffer2, this.m_tmpList[0].depthBuffer, base.InitMaterial, base.InitPass); } else if (num == 3) { this.m_tmpBuffer3[0] = this.m_tmpList[0].colorBuffer; this.m_tmpBuffer3[1] = this.m_tmpList[1].colorBuffer; this.m_tmpBuffer3[2] = this.m_tmpList[2].colorBuffer; RTUtility.MultiTargetBlit(this.m_tmpBuffer3, this.m_tmpList[0].depthBuffer, base.InitMaterial, base.InitPass); } else if (num == 4) { this.m_tmpBuffer4[0] = this.m_tmpList[0].colorBuffer; this.m_tmpBuffer4[1] = this.m_tmpList[1].colorBuffer; this.m_tmpBuffer4[2] = this.m_tmpList[2].colorBuffer; this.m_tmpBuffer4[3] = this.m_tmpList[3].colorBuffer; RTUtility.MultiTargetBlit(this.m_tmpBuffer4, this.m_tmpList[0].depthBuffer, base.InitMaterial, base.InitPass); } }
public InitSpectrumDisplacementsTask(DisplacementBufferCPU buffer, WaveSpectrumCondition condition, float time) : base(true) { this.Buffer = buffer; this.NumGrids = condition.Key.NumGrids; this.Size = condition.Key.Size; this.SpectrumType = condition.Key.SpectrumType; this.TimeValue = time; this.Reset(condition, time); this.CreateKTables(condition.InverseGridSizes()); }
public InitSpectrumDisplacementsTask(DisplacementBufferCPU buffer, WaveSpectrumCondition condition, float time) : base(true) { Buffer = buffer; NumGrids = condition.Key.NumGrids; Size = condition.Key.Size; SpectrumType = condition.Key.SpectrumType; TimeValue = time; Reset(condition, time); CreateKTables(condition.InverseGridSizes()); }
/// <summary> /// Initialize the enabled buffers with the current conditions spectrum for this time. /// </summary> protected override void Initilize(WaveSpectrumCondition condition, float time) { if (InitMaterial == null) { throw new InvalidOperationException("GPU buffer has not had its Init material set"); } if (InitPass == -1) { throw new InvalidOperationException("GPU buffer has not had its Init material pass set"); } InitMaterial.SetTexture("Ceto_Spectrum01", (condition.Spectrum01 != null) ? condition.Spectrum01 : Texture2D.blackTexture); InitMaterial.SetTexture("Ceto_Spectrum23", (condition.Spectrum23 != null) ? condition.Spectrum23 : Texture2D.blackTexture); InitMaterial.SetTexture("Ceto_WTable", condition.WTable); InitMaterial.SetVector("Ceto_InverseGridSizes", condition.InverseGridSizes()); InitMaterial.SetVector("Ceto_GridSizes", condition.GridSizes); InitMaterial.SetVector("Ceto_Offset", m_offset); InitMaterial.SetFloat("Ceto_Time", time); m_tmpList.Clear(); int count = m_buffers.Length; for (int i = 0; i < count; i++) { if (!m_buffers[i].disabled) { m_tmpList.Add(m_buffers[i].data[1]); } } count = m_tmpList.Count; if (count == 0) { return; } else if (count == 1) { Graphics.Blit(null, m_tmpList[0], InitMaterial, InitPass); } else { RTUtility.MultiTargetBlit(m_tmpList, InitMaterial, InitPass); } }
/// <summary> /// Initialize the enabled buffers with the current conditions spectrum for this time. /// </summary> protected override void Initilize(WaveSpectrumCondition condition, float time) { if (InitMaterial == null) throw new InvalidOperationException("GPU buffer has not had its Init material set"); if (InitPass == -1) throw new InvalidOperationException("GPU buffer has not had its Init material pass set"); InitMaterial.SetTexture("Ceto_Spectrum01", (condition.Spectrum01 != null) ? condition.Spectrum01 : Texture2D.blackTexture ); InitMaterial.SetTexture("Ceto_Spectrum23", (condition.Spectrum23 != null) ? condition.Spectrum23 : Texture2D.blackTexture ); InitMaterial.SetTexture("Ceto_WTable", condition.WTable); InitMaterial.SetVector("Ceto_InverseGridSizes", condition.InverseGridSizes()); InitMaterial.SetVector("Ceto_GridSizes", condition.GridSizes); InitMaterial.SetVector("Ceto_Offset", m_offset); InitMaterial.SetFloat("Ceto_Time", time); m_tmpList.Clear(); int count = m_buffers.Length; for (int i = 0; i < count; i++) { if(!m_buffers[i].disabled) m_tmpList.Add(m_buffers[i].data[1]); } count = m_tmpList.Count; if (count == 0) { return; } else if(count == 1) { Graphics.Blit(null, m_tmpList[0], InitMaterial, InitPass); } else { RTUtility.MultiTargetBlit(m_tmpList, InitMaterial, InitPass); } }