Is there any prebuild material for foam shading like the one in dreamscape ?
Currently no foam functions are available in Bermuda.
If I understand correctly, Dreamscape allows you to export foam masks as a sequence of bitmaps. It does some sort of a sim for the foam, and renders it out as a 2d map? Back when Bermuda was an internal-only tool, I had experimented with doing foam mask generation in a similar way. I would basically seed foam off peaks and advect it, rendering it onto a 2D map. The issue I had with my original implementation was that the foam mask when viewed at the horizon showed visible tiling. It was never used for any of the projects, but it is on my todo list to bring something like that back.
The way we had done it in the past on shows was to take a very large painted foam bitmap (tileable). The foam bitmap was very dense of foam, so we masked it off using a compression modifier that worked ok to highlight the peaks. Doing foam that way is a lot easier, but the foam just sort of disappears when the wave peaks flatten so it looks bad at times.
How would you want it to work? Would painted foam textures be valuable? Or just masks? Also, would it be helpful to set up some “pre-built” foamy looking shaders for various renderers? The actual material shading is a little tricky because it’s renderer specific generally, but providing masks for foamy areas would be the first step I guess.
i’m used to work with softimage and AAocean, and basicly it’s give me a weight map of the wave peak and like that i re-use this information for mixing my water shader with foam and i using this information for emiting particle for spray.
So a 2d b&w map would nice for now.
Btw in dreamscape you have some prebuild shader, for foam, you can of course export a 2d maps and like this he doesn’t have to resimulate. But dreamscape take forever when i comes to close up.
I’m all for a peaks map, possibly with tolerance value for how much foam in the smaller waves.
I’ve never really gotten a good look just simply out of peak maps. I was hoping to either provide just the peak maps, or have a history-dependent peak maps that will keep the foam around for many frames and sort of fade it out (a little like Dreamscape). But that requires a map exporting process since it’s not efficient to do directly in a single shader. It’s something I hope to do soon (after I get normal maps working in mental ray and speed them up a lot, and provide some basic help for default water shaders).
I used some dirty trick to obtain peak maps with max. One of them was using the stress map, and the other was adding a push modifer and pushing until the peak faces were crossing, then using a two sided black/white material. Rendered from top, used the rendering as a mask for foam, then added a noise map with hard edges to slowly “cut” the foam in a random way. Tried the slow disappearing, didn’t look as good. Also, we gave a try to the distort map (don’t remember the exact name), trying to deform the foam with a noise map, but didn’t came out as we expected so we gave up on that - used to flicker and deform in a weird way.
yeah, foam is tricky. At the last place that was using Bermuda (an internal version back when this company was part of Prime Focus VFX), they were doing all sorts of z-down projection rendering tricks to generate foam for the peaks and using compositing programs to blend and fade them. but the foam was sometimes not convincing because the fade-out that looked a little weird. The best results were usually painted large maps, with additional tricks to get foam appearing at tips. Unfortunately, I don’t have any of those painted foam maps anymore to use in Bermuda.
I would like to put some serious time into foam generation soon, but for the moment, any feedback on how you would generate these using max tools would be appreciated, and I could try rolling the ideas into an easy to use tool.
well, the push method works when the wave got enough height, and is doable with vanilla max. As I said is a dirty trick and needed to render a map from top, smooth it out in comp, add an animated noise map to “delete” parts of it randomly.
The stress map was often the best way, and it didn’t need any pre-rendering etc. That woul be the best workflow, of course…
The way Drfeamscape does it (essentially what you described abote, seeding at peaks, taking peaks generated by object interaction into account, advecting with surface slope and wind taken into consideration) yields some really nice results. It also does bring up said issues with tiling when viewing towards to horizon or coming from a distance. It still is a very nice option to have for closer foam as it looks WAY better than plain “peak vs. valley” masking.
Here’s two samples illustrating point of views that work very well for the foam in my eyes:
youtube.com/watch?v=-9t-rilmA2c
youtube.com/watch?v=zQK3f32b-Fc
Just bouncing around some ideas:
- Would be nice to have a “tile span” parameter. So one could create a foam map that is 5x5 tiles for example and use object- or world-space noise added to the advection/seeding to generate variation that is independent of the geometry/texture tiles to break up regularity.
- Having a PFlow operator to also emit particles based on the same parameter (but getting around the “huge bitmap birthmap” slowdown ?) Dunno if that would actually speed things up
- I definitely like the idea of some preset shaders/materials for various renderers. Shading is a big part of the equation with water bodies, not only for foam but for the look as a whole. So having some preset like starting points would definitely help users i guess
- foam should have a “persistance” that controls how many frames foam is visible
- having multipliers for all influencing forces would be very helpful (wind, directionality of the BermudaSim, surface movement/slope etc)
- Would be KILLER to be able to use Spacewarps to perturb the foam generation and advection (esp. along with the mentioned “tile span” setup) Putting additional wind, noise, drag etc in there would help control foam generation and movement
Kind Regards,
Thorsten
I had the preasure to work on a lot of ocean scenes, so I had the possibility or the need to use different techniques to create it :
- Dreamscape ;
- Realflow / Realwave ;
- Hand / Procedural way ;
Talking about the Ocean shader and foam shader, I used Dreamscape shader and I created my own shaders, some of it are actually released, others are just for in-house usage. If we move forward to talk about the foam, usually I used Dreamscape masks to control the presence of foam and the foam was done using layers and layers of procedural maps. When I’m working on ocean meshes done without external software/plug-ins, usually I create a foam shader done with layers of procedural maps, and to mask it or decide where I’d like to have it, I use nested painted and procedural maps.
I have some ideas about what can be useful in Bermuda to work on foam, and later I’ll post a new reply.
Regards,
Alessandro
I think one thing that would be key is to generate the foam masks from camera in screen space somehow.
Any other method you just plain don’t have enough area no matter how gigantic your texture is.
I’ve spent many hours on a boat thinking about dissipating foam and I think I have a few ideas about how to attack the dissipation given a good quality grey scale age map.
The other big problem with most foam implementations is that the foam doesn’t last long enough. It needs to last at least 10 seconds. Not the 1-2 seconds that is typical with CG foam.
I realise that this is because it is expensive to keep splatting the particles for that length of time but it has to be done. I’m wondering if there is some sort of way to hook into Krak’s engine to do the foam rendering.
You probably need at least 10 million particles for an HD Frame (distributed in screen space) to look good. Krak would laugh at this amount - just need a way to pass the particles to Krack. PFlow is orders of magnitude too slow to involve in the equation. I would like to see bin files generated from Bermuda that could be directly rendered by Krak
Hi,
just got on the beta, and been having a little play with it today.
When I was using Dreamscape more, I faked a lot of the foam with photos, combined with a bit of procedural - but yeah the tiling is the major issue for this, I ended up using falloffs to kill the tiling (it was more important for that the foam looked right close to camera, the further away I let it slide) Also using distortion maps on bitmaps worked quite well, as the mesh moved through the world XYZ space, it distorted the photos, and didn’t look too bad for a big fake.
Not sure if some kind of curvature shader, but run through a distortion would work as a fake - The dreamscape procedural foam was OK, but really only good as a starting point. (it also worked quite well as a displacement map for very closeup foam)
I always wondered if there’s enough information in the framebuffer (z, UV, camera data, velocity etc) to do the foam/spray as a completely separate pass, but as you said a customised variation on the Krakatoa engine would be great.
+1 on not using Pflow - way too slow to do anything useful.
Cheers
Steve