Ocean Sim QuickStart Tutorial

February 22nd, 2011

UPDATE: A PDF version of the tutorial is now available for download. Useful for offline viewing. Click the image above.

*****************

Well, it’s seems as though there has only been a few people able to figure out the entire process of using the new ocean sim tools along with the foam mask option. Obviously we need a basic “getting started” tutorial so that more people can start getting basic results in order to allow more people to experiment with this new toolset.

I’ve put together the basic steps to create an animated ocean mesh with the foam mask material texture added. This is not meant to show users how to create the most realistic material or wave settings, but just to give everyone a baseline or a starting point to using this great new tool.

Blender 2.5 Ocean Sim Branch QuickStart Tutorial

Mesh/Camera Setup


1. Open a recent build of the Blender 2.5 Ocean Sim branch, which can be downloaded here

2. Launch the Ocean Sim version of blender and delete the default cube.

3. Add a plane mesh object.

4. Scale the plane to 4 blender unit by 4 blender units.

5. Change to camera view (0 on the numpad).

6. Select the camera and adjust it’s position to achieve a low angle view on the plane mesh, and close in so that the mesh fills most of the camera (see reference image).


7. Select the plane mesh. Choose the Object context and change the name of the mesh to OceanMesh.

Ocean Modifier


8. Keeping the ocean plane mesh selected, choose the Modifiers context, and add the Ocean Modifier.


9. With the modifier added, the mesh changes it’s size dramatically (this will hopefully be fixed). Hit the S key and the 0.04 to resize the mesh back down to it’s approximate size.

10. There is a range of waves sizes and levels of choppiness that can be realized. We’re going to go for medium to large waves with a fair amount of choppiness in this tutorial.


11.  On the Ocean Modifier, ensure that the default settings are chosen. We leave the Geometry dropdown on the Generate setting. This keeps the mesh resolution in sync with the wave sim data resolution which we want.

12. For efficiency we’re going to leave the RepeatX and RepeatY to 1. This feature replaces the functionality of the Array modifier as we weren’t able to get the two modifiers playing nicely together.

13. Change the resolution to 20, Choppiness to 2,  and the scale to 4.

Animation


14. Using the default 250 frames setting, move the current frame to frame 1, change the Time field on the Ocean Modifier to 0 and press enter to confirm. Then hover the mouse cursor over the Time field and press “I” to insert a keyframe for the Time factor. Change the current frame to the last frame (250 in our example).


Change the Time field to 5 and press enter to confirm. Then hover the mouse cursor over the Time field and press “I” to insert a second keyframe for the time factor.
15. Click play on the timeline controller and you should see motion on the ocean mesh. We’ve set the resolution pretty high at 20, so you may want to reduce this resolution to get decent playback in the viewport.


16. The default motion graph for the two keyframes has an acceleration and deceleration at the beginning and end that we need to change.


Open the graph editor, select the Time(Ocean) factor and change the interpolation mode to Linear.

Materials


17. We’re just going to start with a basic blue colour. Depending on the look you are going for, you’ll need more or less Mirror Reflection. Photorealistic ocean material is almost a black with full reflection, getting all the colour from the sky reflecting in the material.

18. With the ocean mesh selected, change to the Material context, add a new material. Change the Diffuse colour to Hex#143649. (Use any colour you want, this is what I used in the tutorial)

19. Change the Specular setting to 0.2


20. Enable Mirror and set the Reflectivity to 0.1. Ensuring Ray Tracing is enabled in the Render settings and do a test render.


21. Add a Sun lamp object positioned according to the reference images.


22. Enable the Sky checkbox in the Sky & Atmosphere section of the Sun lamp settings. Do another test render.

Rendering a Test Animation.

23. At this point, we can render a test animation to see the wave motion. I’ve set my render output options to 35% of 1920×1080, 250 frames, and PNG output.

24. BlenderArtists.org is back online! Go to the forums and browse around while waiting for your frames to render! : )

Foam Mask Effect.

25. With the ocean mesh selected, click the Generate Foam option on the Ocean Modifier. Ensure the Coverage setting is set to 0. Change the End frame for the Bake Ocean section to 1. We’re just going to bake 1 frame for testing. Check the Cache path to make sure it’s set. The default is //ocean_cache/. Click Bake Ocean.


26. Once the foam frame bakes, there will not be a noticeable change in the viewport. To see the foam mask, position the cursor in the viewport, press the N key. Open the Display tab, and enable Textured Solid. The mesh will turn a black and white colour, but the foam mask area will be apparent as the white area on the wave peaks.


27. With the ocean mesh selected choose the Texture context. Add a new texture and choose the Ocean type. Name the texture FoamMask.

28. In the Ocean tab of the FoamMask texture, click in the Modifier Object tab and select the OceanMesh object. Change the Output dropdown to Foam. Choosing the Modifier Object is critical as this ensures that the Ocean Modifier and the Ocean texture is using the exact same OceanSim data, which will sync the texture with the wave displacement from the modifier.

29. In the Mapping section, choose UV for the Coordinates dropdown. Leave the Color setting at 1, and change the Colour selection to pure white.


30. Do a test render of frame 1.

31. If you are happy with the test render, change to the Ocean modifier panel, and click Free Bake. Change the End number to the last frame of the animation (250 in our case). Save your blend file, and click Bake Ocean.

32. When the bake completes, you should now have 250 displacement EXR files and 250 foam mask EXR files in the ocean_cache folder.

33. You should now be able to render the file with the foam mask added to the base material.

First Public Builds Now Available!

February 6th, 2011

Yes folks, we’ve reached a milestone! We’ve ironed out most of the issues and bugs in the OceanSim Build of Blender 2.56, and are ready to have the wider Blender community have a look at it!

Based on the budget we generated from donations, we’ve reached a feature-complete version of the OceanSim branch. Any further work from Phase1/2 will be bugfixing.

We currently have builds available for Win32/64, Linux32/64, and OSX10.5+ available on our Builds Download page here. There is also a code patch in case you’d like to build your own. New bugs or issues can be reported on our Bug Tracker page.

Quick Review of Features

• New Ocean Modifier module that generates mesh wave displacement, as well as calculating the foam mask

• Updated Ocean Texture tool that allows the ocean sim data to be used for material/textures. The new Sync feature allows the OceanTexture and Ocean Modifier to work off the same OceanSim data.

• Ocean Texture can now use the Foam Mask data generated by the Ocean Modifier for material texturing of wave peaks, including animated dispersion

• Ocean Modifier allows baking of Per-Frame textures for Displacement, Foam Mask, and Normal data

Getting Started

• We currently do not have any guides or tutorials on using this tool, but there are definitions for the new tools on the wiki which were added by Matt

http://wiki.blender.org/index.php/User:Broken/OceanSimulation

Please help yourself to the builds or build your own. Please report any bugs or serious issues to the bugtracker.

Thanks again to the donors who made this possible!

Todd

New Test Clip from Matt!

January 19th, 2011

Matt has posted a new test clip video using the Ocean Sim with more realistic shading and materials. The scenes were set up in Blender 2.5, but rendered in 3Delight. We’re hoping to get some Blender rendered videos up soon as well, just trying to get the materials rendering better.

Latest Build Available –
Soon to be released to the public for testing!

January 8th, 2011

We’ve been on a bit of a break due to holidays, and work schedules, but I wanted to let you know about the latest build of the Ocean Simulation Tools version of Blender that has been posted. Contrary to some people’s belief, the project has not died, and work is progressing very well! : )

The newest build is the January 4th version which is now available for donors for Win 32/64, Linux 32/64, and OSX 64 as usual.

Here’s what is new to this build:

Updates in Build 0104

• Ability to Sync Ocean Modifier with Ocean Texture
After hedging our bets on what the final ocean tool would be, it looks like a combination of the modifier and texture will give the most flexible results. We can now use the Ocean Modifier to generate the mesh with displacement directly, as well as using an Ocean Texture with a reference to the mesh that is using the Ocean Modifier in order to have greater control over the ocean mesh materials. The important thing now is that when synced, both tools use the same ocean sim data so they should work together seamlessly.

• Ocean Modifier Mesh Displacement Choice
The ability for the modifier to choose between either generating the ocean surface grid directly and displacing that or just displacing existing geometry. (This is pretty much the same thing as using a texture in conjunction with the displace modifier, but simpler, and is a nicer way to feed in any arbitrary mesh to deform.)

• Hooked up Normal information from Ocean Sim code to the modifier.
Matt writes – “The way it’s working in Blender now is that the greater the value of the ‘Normal’ slider, the more of this fine detail normal is used for shading rather than the slope of the actual 3d geometry, so the slider is acting like a blend between lighting based on the overall 3d shape vs the fine bump map. Of course the other reason for having this normal information is that for far away shots you can just use the normal map and avoid having to displace any geometry (eg. http://www.pasteall.org/pic/7797 ).”

• Repeating Mesh Tiling
Due to the Ocean Modifier not working properly with the Array modifier, we’ve now built in a tiling option to the Ocean Modifier to allow for large ocean meshes. This feature is available when using the default ‘Generate’ geometry option in the Ocean Modifier.

• Initial Documentation Posted to the Blender Wiki
Still not complete, but some initial documentation is now available here: http://wiki.blender.org/index.php/User:Broken/OceanSimulation

• Blender 2.56 builds
As a nice bonus, the last round of builds have now been built on the 2.56 release, so that’s a nice update as well. We’ll get the 2.56a version in the next round probably, but I don’t think the bugs should affect us for now.

Next Steps

At this point, we’d really like to see donors get their hands dirty testing out this latest build, and really start to try playing with the settings and materials to see how good of a result we can get. Please send any links to test videos you may come up with so we can see how you are doing.

Also, we would like feedback about issues that would hinder real world production usage. The current build is pretty much feature complete for the current phases (1 & 2) of project funding, so now we just want to make sure everything is working as expected.

After everyone has had a chance to have a look through it, we’re planning on opening the builds folder to the public in order to start getting a wider testing audience for the project (perhaps in a week or so).

Budget

The donation widget was closed on December 31 due to an oversite by me in not extending the donation time period. Unfortunately Chipin.com does not allow re-opening of fund-raising campaigns once they have closed. I think now this is probably fine, as we have enough budget to finish what we are currently working on.

I don’t have exact numbers just yet, but I believe we are getting close to using up the end of the final donation amount of $2580.50USD (yes, someone donated 50 cents…), including our Paypal fees which are probably getting up towards the $180 range (ugh!). In addition, Matt has stated that he will be fixing any bugs that are in the code at no cost, so that won’t affect the budget. Also, he has also offered to do a little more work on the foam accumulation feature on his own time and at no additional cost (thanks Matt!), so I’m also very excited about that!

Thanks again to all those who contributed in a concrete way to this project. It’s amazing to see what can be accomplished when people work together, and actually open their wallets (if every so slightly!  haha )  : )

Todd

Donation Goal Raised + Budget Explanations

December 10th, 2010

Hello All,

I have raised the donation goal for this project for the second time now to $3000. This is mainly due to the generousity of the blender community in out-giving the last goal by over $700! Thank you very much!!

A bit of explanation is warranted, as the goals and targets of this project have evolved over the last few weeks based on the support that has come in for the project.

The first phase of the project dealt with mainly recreating the original functionality of the Ocean Sim, and the work for this was relatively easy to estimate. We did run into unforeseen trouble with adapting the tool for use with multithreading in 2.5 and that did add to the costs of Phase 1.

Phase 2 is now in progress and the main goals are developing the Ocean Modifier, determining what the best format for the tool will ultimately be (modifier, texture, both?), and then on top of that investing in new features and effects such as the new animated foam masking that Matt is currently working on.

I will be posting a more detailed financial report on how the budget has and is being spent, but for now, I can say that about 70% of the $2200 budget has been spent, and we are still doing quite a bit of experimentation to get the best results. Hopefully we will have enough budget to achieve the main goals of Phase 2.

If a significant number of donations continue to come in that exceeds what is needed to finish Phase 2, then we will have to establish new achievable goals for a Phase 3. But one day at a time!

Thanks!

Progress test video on foam masking work

December 7th, 2010

Matt is making great progress on the foam masking effect. Not only can we colour wave peaks, but the foam colour can spread and dissipate, making the effect much more realistic.

The effect requires a baking process to pre-calculate the movement of the foam mask/material, and is still a work in progress, but I just wanted to show what we’ve been up to!

Early Test Animation + Technical Update from Matt Ebb

December 4th, 2010

Matt has posted an early test animation showing wave shapes and a very basic foam shader using only material colours. Not perfect but it’s improving more and more! (yes, it’s only 2 seconds long!) : )

We’re continuing to work on the Ocean Tools, specifially with respect to improving the foam effects on the wave peaks. Currently we can achieve somewhat realistic looks with colour and masking, but we’re hoping to do better, perhaps even figuring a way to do some kind of movement or dispersion of the foam material.

Here’s a quote from Matt responding to the Blendernation posting yesterday. I think it’s informative enough to repost it here.

He writes:

“Hi, a bit of information from the technical side too:

This is already more than a direct port of the old code – since blender 2.5 is now multithreaded in many areas, the ocean code had to be updated to become thread safe. The original code dropped into 2.5 would cause scrambled results and lots of crashes so this was pretty important work, which took a bit of time. Also with that done, in my local version (not in this test build yet) there’s now also openMP support for multithreading the sim itself, which gives about a 50% speed improvement on my dual core machine. I’ve also decoupled the sim from the texture in the original patch, now the ocean sim is sitting as a generic library in blender that can be accessed from any area, currently textures and a modifier, potentially in future dynamics node trees, etc.

I think how this has worked has been quite practical – the old ocean sim patch was sitting in the tracker for (literally) years, without interest or motivation by any coders, volunteer or not (myself included), to bring it up to date. What the funding has provided is the motivation to kick start this effort, and the means of being able to set aside the time to do the grunt work required. If there are still desirable things left to do when the budget runs out, I still would like to continue working on it as a volunteer, though not with the level of dedication that has been made possible so far. Of course any other coders are free to develop it further too.

Next on the agenda is improved foam map generation, I’m looking into some techniques for that now. Unfortunately this experimental R&D type stuff does take time, sometimes without too much visible results, but as mentioned, I’m keen to see this through regardless.”

Installation Help from Users

December 4th, 2010

Hello all,

I’d like to use this page to assemble any advice from the comminity on getting the builds working on their machines. It seems as though mainly Linux installs of various flavours may need some tweaking to get it working.

If you have advice or anything special you needed to do to get the Ocean Build working on your machine, please post it using the comments below.

Thanks!

First Test Build is Available!

December 3rd, 2010

Good news, we have an early test build of the Ocean Sim branch now available for donors to download and try out! Access to the builds folder has been emailed to all current donors to the project.

Operating Systems

There are builds available for Linux 32/64, Win 32/64, and OSX 10.5+.  A big thanks to Martin Lubich, Caleb Joseph, and Hamed Zaghaghi for helping out with the extra builds!

Test Blend File

The test file oceantest.blend opens with a mesh set up using the Ocean Texture + Displacement Modifier. The Texture currently has more features developed than the Ocean Modifier.

Achievements to Date

• Realistic Ocean Wave displacement and movement in Blender 2.5! (cannot be understated)
• 2 Methods of Achieving this Displacement (Texture or Modifier)
• Foam Mask output from Ocean Texture to use with Materials and Textures (new)
• Decoupling of Ocean Sim Code from original texture so that future re-use with other tools like nodes will be much easier (not sexy but  important, the node tool is likely to be much more powerful down the road!)

Some Things To Be Aware Of

• The Ocean Texture and Ocean Modifier are currently intended to be used independently of one another
The Ocean Modifier works, but only on a displacement level, it does not yet have any material or foam parameters yet (further r+d is required)
• The Ocean Modifier has an issue when used with the Array modifier, the waves are stretched across the mesh array
• The current material set up for the Ocean Texture is very rough, we were hoping some of you might spend some time to get a better material set up for us

Budget

• We have spent approximately 75% of the budget so far, and there are still a few things left that we need to nail down, specifically how to use materials and textures with the Ocean Modifier, as well as how to generate a foam mask. It’s a better solution for the geometry displacement, but achieving the wave peak texturing seems to be more difficult. We’re still in the hunt for the best all around solution.

User Feedback

• I’ve set up a bugtracker in order to organize bug reports, and feature ideas. We’re specifically interested in techniques to generate foam materials/masking using the Ocean Modifier. As always, please read the previous bug reports to avoid duplication.

Ocean Sim Bug Tracker

User Renders/Animations

• I would love to see your best still renders and/or animations using the build, hopefully they will improve as we improve the branch, but your output will really allow us to see how well the new features are working! Please send me any samples that you think turned out well.

Thanks again for your support, and we appreciate your patience with this project.

Please consider donating if you haven’t already. Innovation sometimes takes longer than you think!

Test Builds Soon To Be Released for Sponsors!

November 29th, 2010

Time to post an update on this project. We’ve made great strides on our primary goals!

Progress

We’ve been able to find a work-around for the Time animation issue on the Ocean Texture. We’ve been able to set up a basic implementation of the Ocean Modifier, and we’re able to animate the displaced ocean mesh in both scenarios.

Another exciting feature addition is the ability to target wave peaks with a foam setting to affect materials and textures for colour differences.

A few more tweaks, and we will have a test build for people to start experimenting with and sending us feedback.

Finances

Budget-wise, we’ve spent about 60% of the current budget of $1600 (minus Paypal transaction fees). So, as we start to get closer to the end of the donated budget, we will need to focus attention on stabilizing current features, and deciding if we can squeeze any additional features into the tool. This is completely dependent on our donation level, so even if you haven’t donated yet, it’s not too late to get involved!

Test Builds

As a reward for those who have already invested in this project, we will be releasing the test builds only to those who have donated. We will be releasing everything to the public following the end of the project, but would like to encourage additional support from those who may be interested, but neglected to donate to the project.

Still Looking for Additional Donors

I have been so proud to see the response from Blender artists world-wide. It’s been great to be able to pay for Matt’s great work on this project with real money, and not just a promise of free beers or coffee money. This project has shown that artists can affect influence on feature development by combining their modest financial resources to create something of value for everyone.

So, in that light, I would unashamedly continue to ask for your financial support of this project. Every extra dollar will allow us more time to tweak this tool to really make it work well for everyone. And as a bonus, you’ll get access to the early test builds of this branch project before everyone else!

Need 2 Volunteers To Help With Builds

We are currently looking for 2 people who have the skills to create OS specific builds from the project source files. We are looking for people to help us create Windows and Linux builds. If you have decent experience with this and can supply us with these OS builds in a timely fashion, please let me know directly at todd@resonancemedia.ca.

Cheers,

Todd