Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Rendering foam using Arnold Maya 2017?

Rendering foam using Arnold Maya 2017?

docaberle
Enthusiast Enthusiast
14,406 Views
20 Replies
Message 1 of 21

Rendering foam using Arnold Maya 2017?

docaberle
Enthusiast
Enthusiast

I'm having trouble trying to figure out how to render foam particles in Maya 2017 using Arnold. I get this weird black look in the water and my foam looks grey and dirty. I'm missing something because I've seen beautiful water and foam renders and it's because of bifrost that I purchased Maya. Here's a photo of the rendered look/problem and I've included a two minute YouTube video of my problem plus I've attached the file.

 

foamProblemsMaya2017.jpg

 

I posted something similar in another post, but figured it needed it's own post. Sorry if that's a problem. I wasn't sure what to do because I wasn't getting any answers from the other post.

Accepted solutions (2)
14,407 Views
20 Replies
Replies (20)
Message 2 of 21

Anifex09
Collaborator
Collaborator
have you tried increasing your refraction bounces ??
0 Likes
Message 3 of 21

docaberle
Enthusiast
Enthusiast

I cranked up a whole bunch of values in Arnold which helped the foam turn more white, but the water is still black.

 

foamProblemsMaya2017_2.jpg

0 Likes
Message 4 of 21

Anifex09
Collaborator
Collaborator
The black is from the environment background color. The aiSkydomelight does not have refractive properties - If you want you can goto render settings - Arnold Renderer Tab - Environment - Background - Click checkerboard - Create Sky Shader - Sky Shader in Attribute editor - Plug your HDRI from aiSkydomelight into Color Slot - under render stats un check everything - check Visible in Refraction
Message 5 of 21

docaberle
Enthusiast
Enthusiast

That made the issue look worse, and I already had the skydomelight there. But it is rather confusing because in Maya you can have the skydome that acts as a light source and the skydome you actually see in the render as a background. I ended up adding a normal Arnold light and that made the foam look great (other than a low particle count), but now I see dark areas along the edges of the ocean. But those could be reflections so I'm going to play around with it some more. I need to learn more about lighting and shaders in Maya. I'll repost here when I get more figured out.

 

But one question is can I get rid of the blackness in my original question without using a Maya Arnold light? Or is it just logical to include the skydomelight AND have some Maya lighting as well?

0 Likes
Message 6 of 21

joostkonemann
Advocate
Advocate

In the scene you added in your first post, only an aiSkyShader exists, but no aiSkyDomeLight. So you will see the environment in reflection and refractions, but it does not actually emit light. So add a aiSkyDomeLight, plug the same file texture in the color connection. For the SkyShader, turn off Visible in Diffuse, Glossy and Reflections. Only keep Visible in Refractions turned on, otherwise you're having a double contribution of the HDR in the glossy and diffuse channels.

--
MacBook Pro 13,3 - 2.7GHz - 16GB - Radeon Pro 460 - macOS Catalina 10.15
0 Likes
Message 7 of 21

docaberle
Enthusiast
Enthusiast

Ah, interesting. I added the aiSkyDomeLight like you said and unchecked the three boxes like you said after I added the hrd image. It took care of some of the blackness under the foam, but the foam is still black. I can easily add an Arnold light to take care of that, but can the skydomelight brighten up the waves as well, maybe by just turning up the intensity or something? I'm purposely not going to try anything else so you know what I did.

 

foamProblemsMaya2017_3.jpg

0 Likes
Message 8 of 21

joostkonemann
Advocate
Advocate
Accepted solution

I set up the scene with the aiSkydomeLight and the aiSky and added an aiStandard material to the foam in which the opacity is driven by the foam density.

See the attached file. I think this gives the desired result. See the test render as well. (as I did not have the HDR you're using, I just plugged in some beach HDR).

 

I saw you used a jpg for the sky shader. When you want to use image based lighting, try to use an HDR image!

 

testBifrost.jpg

--
MacBook Pro 13,3 - 2.7GHz - 16GB - Radeon Pro 460 - macOS Catalina 10.15
Message 9 of 21

docaberle
Enthusiast
Enthusiast

Wow, your foam looks better than mine. I found the same hdr file you used online, but the foam can barely be seen. I started directly from your file, pointed to my disk cache, went to frame 100ish, and rendered two different shots. Did I do something wrong? Or did you render with much more foam being generated possibly? Overall, the look of the water is fantastic. You've been a great help and I appreciate it. I was using HDR's supposedly and not jpgs at least I thought. The file extensions were .hdr. But I like this beach file much more, plus the whole thing is lit up vibrantly which makes the water be illuminated from the bottom as well as the top.

 

foamProblemsMaya2017_4.jpgfoamProblemsMaya2017_5.jpg

0 Likes
Message 10 of 21

joostkonemann
Advocate
Advocate
Accepted solution

I reduced the render size of the foam particles and I used an aiStandard shader for the foam in which the opacity is driven by the density of the foam particles. So I did change the foam emission properties to have more foam particles. I tripled the emission rate and decreased the min churn and curvature settings. This is not part of your problem, but I needed more particles to have visible foam because of the smaller render size and opacity.

 

You indeed used an HDR already, sorry, my mistake. Though the color space for this file was set to sRGB, while it should be set to a linear or raw color space to get the proper color values and consequently the right lighting.

--
MacBook Pro 13,3 - 2.7GHz - 16GB - Radeon Pro 460 - macOS Catalina 10.15
Message 11 of 21

docaberle
Enthusiast
Enthusiast

I made a YouTube video (very short) here showing this latest render. I resimulated with the file you sent me, not changing anything. I noticed the foam emissions were as you used and I got more foam. However, the rendered foam is still dull. I made sure I used the same HDR image as you and as you'll see in the YouTube video, it should have looked like yours. I hate to keep asking for help like this, but truly appreciate your efforts. Any additional things you can see that I'm doing wrong from the video? Other than turning up the exposure, I'm not sure, but again I'm not monkeying with the file trying all kinds of different things so you know where I'm at.

 

foamProblemsMaya2017_6.jpg

 

0 Likes
Message 12 of 21

joostkonemann
Advocate
Advocate

Try increasing the backlighting value on the foam aiStandard shader. It will brighten it up. Maybe the file I sent you was not the final one I used for the render in the post.

And you can also play with the remapValue node for the foam opacity.

 

The rest looks fine in the video.

--
MacBook Pro 13,3 - 2.7GHz - 16GB - Radeon Pro 460 - macOS Catalina 10.15
Message 13 of 21

docaberle
Enthusiast
Enthusiast

Wow!!! I cranked up the backlighting to a value of 1 which might be a little high, but it looks cool. The remapValue node for the foam opacity is found in the Hypershade window and is one of the nodes that you strung together correct? Doesn't look like I need to monkey with that at all, but wanted clarification. Thank you, Thank you, Thank you. I have struggled with creating nice looking foam for way to long. And you showed me how. All the mistakes I made that are showed in this post will help countless others. Now I'm going to work at recreating the look from scratch and then making a YouTube video to help others. It was the water simulations that sold me on purchasing Maya and after seeing what was possible, the decision wasn't hard. But then I had to try to recreate it myself which was where the trouble was. I'm sure I'll have a few more questions in the near future and I'll keep them all here in this post if they're render related. I'll also post my finished file here for others. The HDR used in this render is found near the bottom at this website: http://www.hdrlabs.com/sibl/archive.html

It's called "Tropical Beach"

Just download it into the skydome-->color-->file3 location

The render below is at frame 145

foamProblemsMaya2017_7.jpg

0 Likes
Message 14 of 21

docaberle
Enthusiast
Enthusiast

Trying to recreate what you did and don't understand where you got the density attribute that you use in your aiUserDataFloat1. Didn't you have to define that variable 'density' somewhere? I made a one minute YouTube video asking this if my wording doesn't make sense.

 

0 Likes
Message 15 of 21

joostkonemann
Advocate
Advocate
Some per particle attributes from Bifrost are available with an aiUserData node. Just type density in the attribute field. If the object which has this material assigned has a density attribute, it will be used.
--
MacBook Pro 13,3 - 2.7GHz - 16GB - Radeon Pro 460 - macOS Catalina 10.15
Message 16 of 21

joostkonemann
Advocate
Advocate

I saw the youTube video you made, good work! Thanks for the credits you gave me.

 

I have one comment, in the remapColor node you did not change any attributes, so you could also just have left it out. In the scene I sent you, I changed the "Input max" attribute (it's in the "Input and Output ranges" section). I set the Input max to approximately the max value of the density I could find (by setting the foam display to numeric and showing density values), if I remember correctly I set it to 0.7. So the remap node converts a density range from 0 to 0.7 to an output range from 0 to 1. This makes sure the most dense particles are almost entirely opaque.

 

I did not use anything else in the remap node, but you could adjust the curves to alter the density to opacity mapping.

--
MacBook Pro 13,3 - 2.7GHz - 16GB - Radeon Pro 460 - macOS Catalina 10.15
0 Likes
Message 17 of 21

docaberle
Enthusiast
Enthusiast

I must have missed that in the file you sent me. When I originally made the tutorial video, I mentioned how I wasn't using the remap node that you're describing, but ended up redoing that part of the tutorial and forgot to mention that part. Thanks for catching that. I was just so happy it looked good, I couldn't wait to make the tutorial to tell others. I'm sure people will play with those parameters a bit to see what they will accomplish.

 

I also want to see how to remap the vorticity values of the churning water to make them look more opaque instead of clear in the areas of high vorticity. If you know how to do that, I would love to hear about it. I think it would be similar to what you did for the foam. Now need to work on BOSS oceans and using bifrost for the detailed areas. There are no good tutorials that show exactly how to do it...guided simulations that is. That's a different part of the forum however.

0 Likes
Message 18 of 21

Anonymous
Not applicable

Thank you so much to both of you @docaberle and @joostkonemann. I was trying to get default Bifrost liquid shader in arnold for all night but now I know it didn't support and we have to use arnold shader. 

 

 

Thank you again very much !! I am very new to bifrost and OpenVDB Stuff. Actually it's been just 3-4 days. Anyway I am still learning 😄

 

BTW, I came accross this stuff : OpenVDB in bifrost and arnold (bifrost to vdb to mesh) by the user "TheBesha1" who must be one of the developer of OpenVDB. but Unfortunately he doesnt have audio in his videos. Below is the link to his video

https://www.youtube.com/watch?v=W4Stvqccov8

 

Since I'm still new to these stuffs, I have few questions. First concern is I think you have to generate very very high quality mesh if you want to have high details and I think there are not much controls in meshing from bifrost. So I think the OpenVDB will definitely help. I'm still looking into it and will take some time but if you already know about this, then that would be great to have some help understanding this technology. I do have some confusions too like isn't Bifrost's mesher already openVDB ? I feel the "TheBesha1" openVDB very fast then the default one. 

 

Ok my another concern is you get nice velocity remapped liquid mesh with mental ray using default bifrost liquid material. Can't we get that velocity/vorticity remapped effect in diffuse channel with Arnold Shader ? If yes how ? using aiUserDataFloat ? 

 

Another confusion is one of the biggest one 😄

We can cache out millions of particles for liquid but no matter how much high resolution we go for meshing, it's still not going to look as good as those milllions of particles if im not wrong. The Vewport 2.0 preview with velocity/vorticity is just amazing. So, I was thinking why not use Krakatoa for main liquid too. I think we have phong shading in krakatoa's particles with all those velocity/vorticity driven output and the render should be pretty fast too. What do you suggest? I have seen people using krakatoa for foam but why not with main liquid particles too ?  Also is it possible to do separate render for droplets ? I'm sorry I haven't got enough time to play with it. I should have done my homework first before asking these questions, but I am just being lazy to trying to learn fast 😞 

 

 

Thank you once again and Kudos to both of you. 

 

 

 

 

 

0 Likes
Message 19 of 21

dangertaz1
Advocate
Advocate

Now that Arnold 5 has been released, and Bifrost Liquids and Foam are supported by Arnold. 

 

I have followed the directions in the Arnold 5 documentation (assign Ai Standard Volume and use 'Foam' preset)  but it still renders as black.  

 

 What is the current workflow to render foam?

0 Likes
Message 20 of 21

Anonymous
Not applicable

To answer your question re: black foam in arnold 5 (Maya2018):

Connecting an aiuserdatafloat to a remapvalue, which connects to the opacity of an aistandard surface will let you adjust the opacity based on density. Then by setting the userdatafloat default value to 0.001 (the smallest value) seems to trigger your material presets without overwhelming the foam with too much opacity. You can then play with the remap value input and output ranges for a little more artistic control over the density.

To make the foam appear even whiter, add a white emission. You can also map the emission in a similar way to your opacity using either the same userdata and remapvalue nodes or slightly different ones, depending on what you are going for. Sometimes a simpler approach is best. 

Hope this helps. I scoured the internet looking for Arnold 5 documentation and cannot seem to get anything to render the foam directly. I have to make this massive mesh and assign these nodes as its the only thing which seems to even remotely show in my render. Even the volumes don't seem to want to play nice. I'm not sure what happened in 2018 but it feels like a step backwards for foam at least.

0 Likes