Coder Social home page Coder Social logo

Wave speed or gap about crest HOT 12 CLOSED

wave-harmonic avatar wave-harmonic commented on May 20, 2024
Wave speed or gap

from crest.

Comments (12)

huwb avatar huwb commented on May 20, 2024 1

I believe this is resolved on master, in the commit referenced above. Let me know if you see issues!

from crest.

Midda-C avatar Midda-C commented on May 20, 2024

Yeah, I've thought about this too. The ocean is always moving in its set direction at a constant speed, as are the scrolling textures. Having some extra control over the speed would be great.

from crest.

huwb avatar huwb commented on May 20, 2024

Thanks guys. I've had related thoughts but its purely in the realms of RnD at the moment. It would be figure out an approach here.

If we're purely talking wave speeds, i could expose speed control for each octave.

If you mean time-varying wave conditions, that is somewhat possible right now. the GerstnerWaveBatched script has a Weight param that can be driven as desired. one could set up two GerstnerWaveBatched objects and crossfade the weights to transition between them. one could also drive the equalizer values as desired directly - you could lerp small waves in or out using script, or maybe even animate them (i don't think i've tried applying animation curves to ScriptableObject's before..).

If you mean spatially varying wave conditions - different waves in different areas of the world - I havent figured out if this can be done efficiently. my best idea so far is to break world up into a grid and in each grid square mix together the spectra that apply. or, allow the user to author geometry with vertex weights that blend different wave conditions, exactly how multilayered materials work.

What do you guys think?

from crest.

holdingjason avatar holdingjason commented on May 20, 2024

I was talking wave speed. The speed at which the wave moves across the ocean from point A to point B.

Need to think about your other scenarios.

from crest.

Midda-C avatar Midda-C commented on May 20, 2024

Me too, I was mostly just talking about the speed that the wave moves. Essentially just like the time-scale for a given octave. Might need some way to control the speed of the textures too?

I hadn't considered driving the weight with animation curves before. That could be interesting (should be easy to do as-is, Unity is pretty good about letting you animate pretty much any exposed value).

from crest.

huwb avatar huwb commented on May 20, 2024

Yeah let me know about how animating goes, I want this to be well supported.

Ok that makes sense. I was hesitant to add per octave chop but if we're going to add per octave speed it might make sense to add both.

from crest.

huwb avatar huwb commented on May 20, 2024

Nothing to show yet, but i spent a couple of hours this evening looking at having chop and wave speed tweakable per octave. Think i've got the groundwork done now so hopefully that stuff can come online in the not too distant future!

from crest.

huwb avatar huwb commented on May 20, 2024

I've added a per octave speed scale in the referenced commit. I think its pretty cool actually. You can set it to 0 to freeze one or more octaves which is kinda fun.

The new options are tucked away behind the Advanced Settings toggle on the ocean wave spectrum, on the feature/per_octave_settings branch for now. These changes will add a small extra expense so it would be good to confirm this is useful before committing to master.

from crest.

huwb avatar huwb commented on May 20, 2024

In #18 @Midda-C asked about exposing a global wave speed control.

I've decided to tie everything to gravity (the wave speed is computed in part from gravity - more gravity means faster waves). Doing it this way ensures global consistency in the world, but I've also added overrides at multiple levels:

  • The ocean system takes the gravity value from the physics settings
  • It has a global gravity multiplier in the OceanRenderer script. This global setting will affect both dynamic wave sims and the gerstner waves.
  • There is a gravity multiplier on the wave spectrum that will affect all wave octaves
  • There is a per-octave gravity multiplier

So at the highest level you can override the gravity and you'll get consistent behaviour in both dynamic sims and the gerstner waves, but you can override at multiple levels, down to per-octave granulariy.

from crest.

Midda-C avatar Midda-C commented on May 20, 2024

Yeah let me know about how animating goes, I want this to be well supported.

Just thought I'd let you know that I finally remembered to try this out, and as expected, it works fine. All of the exposed parameters are available in the animation editor, and fading the weight in and out works perfectly. :)

from crest.

huwb avatar huwb commented on May 20, 2024

@Midda-C are you able to animate the wave spectrum - like the power values for each wavelength?

I could not work out how to do it - i can animate params on the ShapeGerstnerBatch script, but not in the spectrum.

from crest.

Midda-C avatar Midda-C commented on May 20, 2024

I just had a quick look, and no, I wasn't able to do it either. I think that may be because those properties aren't actually part of the object, rather they're stored on an asset file.

I suspect that if the ShapeGerstnerBatched script actually replicated the settings from the Spectrum asset on the component itself (i.e. when you dropped in the spectrum file, its settings appeared on the compoenent), they'd be visible from the animation editor. Not 100% sure, that's just a guess.

from crest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.