Map ocean displacement to a sphere?

Is it possible to create a "spherical ocean" effect by mapping an ocean texture to a sphere?

I tried baking an ocean simulation, loading the .exr images as an image sequence texture, and setting it to a displace modifier with Normal enabled to displace along the object normals. That resulted in this strange effect:

Is it possible to do this properly, with evenly sized waves, etc.?

Update

I got this to work (partially) with a cycles image texture node set to box, and cycles experimental displacement:

However it's not quite what I expected..

• You really love your oceans, don't you? Sep 14 '13 at 2:58
• That was one of the first things I tried when the ocean sim was added ;-) I did think about reporting it as a bug. You don't need to bake out to images, you can get the same result by adding the modifier to a sphere and using displace instead of generate. It would appear that the ocean sim always displaces on the object Z-axis, while I believe it should work off the normal. Especially the displace option should not be restricted to only z displacement. Sep 14 '13 at 5:21
• "Especially the displace option should not be restricted to only z displacement" I would agree, but change that to only the displace option. The Generate option starts by creating a flat plane, where all the normals are Z-up; displacing about Z and Normal are the same, while X and Y would do nothing but make a weird ripple effect at the edges. Sep 14 '13 at 13:52
• @sambler I thought using a displace modifier would work because you do have the option to displace along normals (the ocean modifier does not, so I was using it only to generate the textures) however it does not work as expected. I'm not sure the displace option is entierly constrained to the Z, I have had "weird ripple effects at the edges" using it before.
– gandalf3
Sep 14 '13 at 18:36
• @WChargin yep :) (I tried this before I knew about blender.SE, but only remembered it now with all the other oceany stuff going on..). About "weird ripple effects", I'm not sure the sphere is my question is getting displaced on the Z only, as it bulges out sideways as well as up and down. (see above comment as well)
– gandalf3
Sep 14 '13 at 18:44

Since the displacement modifier has an option to choose the texture coordinates, this isn't any different from the common problem of UV mapping a sphere.

I recommend some sort of blended box mapping using one modifier for each axis and blending between them with vertex groups.

• I have tried using a UV sphere, unwrapping it with Sphere mapping and using that as the displace modifier texture coordinates. It results in a more even displacement, though it still far from looking like an ocean. Here is an image
– gandalf3
Sep 16 '13 at 19:48

It looks as if you mapped the image flat. In order to produce a threedimensional texture, Blender projects the texture along an axis through your mesh. While your modifier displaces along the normal, the values it uses are generated with above mentioned method. That's why you get these stripes at the equator.

You might need to create a seamless texture to uvmap onto the sphere.

Turns out Blender can actually do blended box mapping with Cycles. Take a look at this link: http://mango.blender.org/production/blended_box/

• Could you add more detail on how to create and use such a texture?
– gandalf3
Sep 16 '13 at 19:50
• I'd like to, but I still think of how to do it effectively. And right now I'm so out of money that I'm starving a little. But I'll see what I can do. Sep 16 '13 at 19:52
• Support for blended box mapping was added to the Image texture node in 2.64, so you don't even need a node setup. I'll test this out with ocean textures/displacement tomorrow.
– gandalf3
Oct 7 '13 at 5:56
• @gandalf3 Did you ever tested it? BTW: Nice question.
– p2or
May 19 '15 at 10:30
• @poor Yes, I put the results in the question..
– gandalf3
May 20 '15 at 8:09

You have the option to generate a new mesh for the ocean modifier or to use an existing mesh. If you create a sphere and apply the ocean modifier to it using the option other than 'generate' (sorry, don't have blender at hand right now), you can achieve your desired effect quite simply. This saves you from those mapping issues.

• This only displaces all the vertices in the object along the Z, so it sort of makes it jump and wobble, but not much else.
– gandalf3
Oct 8 '13 at 22:15