Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Captian-Brink · Mar 08, 2015 at 09:13 PM · terrainproceduralheightmapwavesocean

Terrain height map influences ocean wave heights?

I'm not looking for code, just ideas on how to go about this. My idea is to use the terrain's height map as a means of determining a procedurally generated plane's wave height as it nears the shore. I would like the large rolling waves to turn into a simple 'breaking' or foamy wave that's has a much sharper peak, and as the waves and terrain near each other the wave height diminishes into a nice flat wave that acts realistically on the shore. I'm not entirely sure how to generate the mesh, but I have a fairly attractive community procedural ocean project as reference. Problem is, I dislike using what I didn't make. Thanks for your time.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by alexander11 · Jan 31, 2016 at 10:45 AM

i suggest you learn CG/HLSL that would cover some parameters and learning about 3d space on how to create your own mesh's you can use catlikecoding.com will cover how to generate mesh but not animate how ever you can use the in built Physx in Unity that was built by nvidia and also check out there GEM documentation. hope that kind of helped

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Captian-Brink · Jan 31, 2016 at 02:32 PM

Here's my idea:

Create a script that places a game prefab at the outer regions of your water quad. Rotate each object (wave, separate from the ocean) towards the center of your map (in my case, it faces towards the center of an island). I recommend having a set number of instances and recycle them once they're unneeded. Create an overall max number of waves, and then modify the current number of instances and their speed based on weather.

Create a second script that raycasts from the bottom the the prefab to detect the the object's height above the ocean. Use the height to change the place within the object's animation. I would coroutine this and create a function to approximate the animation state based on speed, an average terrain change from the last raycast or two, and so on. It's a similar concept that's used to smooth networked movement. An wave manager script (basically a particle system) could do this for each wave. You'll need to move the wave forward (since it's oriented towards the center. For more complexed wave direction, perhaps make a map that dictates the wave object's rotation.

the wave object would have an animation the morphs the mesh from a rolling wave, to a breaking wave, to a diminished wave (like what you see on the shore). If you want to get fancy, create a second animation for when the mesh hits a cliff or something similar. You can have a modifier that influences the wave animation position to fake calm or nasty weather.

— / \ — /\ — ^ — “ — + — # LAND ABOVE WATER # — + — “ — ^ — /\ — / \ — {quad} —

My idea is to use a quad to represent the average water height. This quad will be moved up and down based on a sign wave. Each wave will have a wedged shaped collider. The combination of the quad height and wave colliders should provide a rather simple means of buoyancy. Things that are buoyant are forced upward (against gravity) based on the distance below the water quad's height. The wave colliders would offset the water height temporarily to mimic that the buoyant object is floating on the surface of the wave.

To keep the ends of the wave mesh from showing below the ocean quad, I'm guessing you could tinker with a shader to hide parts of each wave that's below the ocean quad.

I haven't tested this concept, but if you do please let me know how it goes.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

The most efficient method of turning a voronoi graph into unity terrain object? 0 Answers

Procedural Terrain? 3 Answers

Writing a Custom Collider 0 Answers

Mesh based on noise 1 Answer

Best way to get terrain positions from a given height range 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges