internal void OnValidate(WindWaves windWaves)
 {
     if (this._Enabled)
     {
         this.FindMostMeaningfulWaves();
     }
 }
Beispiel #2
0
 public DynamicSmoothness(Water water, WindWaves windWaves)
 {
     this._Water          = water;
     this._WindWaves      = windWaves;
     this._Supported      = DynamicSmoothness.CheckSupport();
     this._VarianceShader = water.ShaderSet.GetComputeShader("Spectral Variances");
     this.OnCopyModeChanged();
 }
Beispiel #3
0
 private void OnResolutionChanged(WindWaves windWaves)
 {
     if (this._BlankOutput != null)
     {
         UnityEngine.Object.Destroy(this._BlankOutput);
         this._BlankOutput = null;
     }
     this._ResourcesReady = false;
 }
 public WindWavesSpectrumOverlay(WindWaves windWaves)
 {
     this._WindWaves    = windWaves;
     this._SpectrumData = new Vector2[4][];
     for (int i = 0; i < 4; i++)
     {
         this._SpectrumData[i] = new Vector2[windWaves.FinalResolution * windWaves.FinalResolution];
     }
 }
 public SpectrumResolverCPU(Water water, WindWaves windWaves, int numScales)
 {
     this._Water            = water;
     this._WindWaves        = windWaves;
     this._SpectraDataCache = new Dictionary <WaterWavesSpectrum, WaterWavesSpectrumData>();
     this._SpectraDataList  = new List <WaterWavesSpectrumDataBase>();
     this._OverlayedSpectra = new List <WaterWavesSpectrumDataBase>();
     this._NumTiles         = numScales;
     this._CachedSeed       = water.Seed;
     this.CreateSpectraLevels();
 }
Beispiel #6
0
        public void CacheProfiles(params WaterProfileData[] profiles)
        {
            WindWaves windWaves = this._Water.WindWaves;

            if (windWaves != null)
            {
                for (int i = 0; i < profiles.Length; i++)
                {
                    windWaves.SpectrumResolver.CacheSpectrum(profiles[i].Spectrum);
                }
            }
        }
Beispiel #7
0
        public void OnCopyModeChanged()
        {
            if (this._WindWaves == null || this._WindWaves.CopyFrom == null)
            {
                return;
            }
            this._WindWaves.CopyFrom.ForceStartup();
            this.FreeResources();
            WindWaves windWaves = this._WindWaves.CopyFrom.WindWaves;

            windWaves.DynamicSmoothness.ValidateVarianceTextures();
            this._Water.Renderer.PropertyBlock.SetTexture("_SlopeVariance", windWaves.DynamicSmoothness._VarianceTexture);
        }
Beispiel #8
0
 public WavesRendererFFT(Water water, WindWaves windWaves, WavesRendererFFT.Data data)
 {
     this._Water     = water;
     this._WindWaves = windWaves;
     this._Data      = data;
     if (windWaves.LoopDuration != 0f)
     {
         this._NormalMapsCache       = new RenderTexture[data.CachedFrameCount][];
         this._DisplacementMapsCache = new RenderTexture[data.CachedFrameCount][];
         this._IsCachedFrameValid    = new bool[data.CachedFrameCount];
         water.ProfilesManager.Changed.AddListener(new UnityAction <Water>(this.OnProfilesChanged));
     }
     this.Validate();
 }
 public WavesRendererGerstner(Water water, WindWaves windWaves, WavesRendererGerstner.Data data)
 {
     this._Water     = water;
     this._WindWaves = windWaves;
     this._Data      = data;
 }
 public void BuildShaderVariant(ShaderVariant variant, Water water, WindWaves windWaves, WaterQualityLevel qualityLevel)
 {
     variant.SetUnityKeyword("_WAVES_GERSTNER", this._Enabled);
 }
Beispiel #11
0
 private void OnResolutionChanged(WindWaves windWaves)
 {
     this.Dispose(false);
     this.ValidateResources();
 }
Beispiel #12
0
 private void OnWindDirectionChanged(WindWaves windWaves)
 {
     this.ResetComputations();
 }