8
$\begingroup$

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:

enter image description here

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:

Animated ocean example (2.5MB) http://www.pasteall.org/pic/show.php?id=60477

However it's not quite what I expected..

$\endgroup$
  • 3
    $\begingroup$ You really love your oceans, don't you? $\endgroup$ – wchargin Sep 14 '13 at 2:58
  • $\begingroup$ 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. $\endgroup$ – sambler Sep 14 '13 at 5:21
  • $\begingroup$ "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. $\endgroup$ – wchargin Sep 14 '13 at 13:52
  • $\begingroup$ @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. $\endgroup$ – gandalf3 Sep 14 '13 at 18:36
  • $\begingroup$ @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) $\endgroup$ – gandalf3 Sep 14 '13 at 18:44
1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ 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 $\endgroup$ – gandalf3 Sep 16 '13 at 19:48
1
$\begingroup$

  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/

enter image description here

$\endgroup$
  • $\begingroup$ Could you add more detail on how to create and use such a texture? $\endgroup$ – gandalf3 Sep 16 '13 at 19:50
  • $\begingroup$ 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. $\endgroup$ – Haunt_House Sep 16 '13 at 19:52
  • $\begingroup$ 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. $\endgroup$ – gandalf3 Oct 7 '13 at 5:56
  • $\begingroup$ @gandalf3 Did you ever tested it? BTW: Nice question. $\endgroup$ – p2or May 19 '15 at 10:30
  • $\begingroup$ @poor Yes, I put the results in the question.. $\endgroup$ – gandalf3 May 20 '15 at 8:09
1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – gandalf3 Oct 8 '13 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.