fluids linear render


#1

ok I put the question in the shortest way I can…
How do you setup your maya scene for render your fluids in linear with exr?? This is what I do:
in the renderglobals, I set exr, buffer 16bit half.
in the render view, display 32bit hdr. In the colorManagment I leave sRGB for both image and display profiles.
When I have rendered a nice exr, I load that in nuke, and in the reader node I change the color space to sRgb. Or in another way, I leave it the default linear, and then add a grade node, and set the gamma to 0.434.

 I always worked in this way with mr, always assuming the linear render for fluids was "broken".
 Is this actually right?
 
 thanks
 Alberto

#2

I’m not a master of fluids, I do know linear workflow really well though.

Your workflow seems a bit backwards, in fact probably even wrong.
If I’m not mistaken, you should gamma correct all your incoming rgb values in the fluid node with 0.454. then in the render view, display 32bit hdr. In the colorManagment set your image profile to linear and display to sRGB.

In nuke you set your reader node to linear.
This way you ensure that you are working with linear data all the way, and are still able to view your results in the correct color space.


#3

I think you are right “in theory”. But the problem is (no offence mate) that you don’t use fluids. That’s why I hope that some master jedy Fx Td answer to my question, or Duncan may be.
You see, there is no easy way to do what you suggest, for what I am aware. The fluid shader is not a “normal” shader, like miaMaterial or others where that workflow can work, and it’s never been updated in ages.
This is a proper mental ray mess. If you use renderman, all the procedure is clear and linear. But then again I’m used to custom renderman shaders.


#4

The colours for fluids are just ramps, you can just attach gamma correction nodes to the ramp notches, just like with an MIA material. I’m fairly sure I did that last time I used fluids.

The point of it being linear is so the lighting is correct, therefore the colours have to be linearized before they are lit. I don’t think anything fancy needs to happen.

:thumbsup:


#5

hi Jozvex,
I’m not sure how to correct the colors, but I tried to stick a gamma node between the fluid shader and the shading group, with the gamma at 0.434, and… it works!!

thanks, it wasn’t so complicated at the end :slight_smile:

edit: it works in the rgb, but I loose the alpha. I need to check the settings when I have a spare moment


#6

I tried all the settings in the gamma node, still no luck.
Apparently even if I connect the outColor to the gamma node, it’s appling that to the alpha as well.
So this is not the correct way to do it then.
Jozvex can you be more specific? How/Where did you put the gamma node?


#7

Hi, see my attached image below!


(save the image or drag into a new tab to see full size)


#8

oh I understand now. Damn I need to write a script for that. Creating a gamma node for each color input, it make all a mess, and you actually loose the convenience of using ramps in my opinion. And you have to do that (I suppose) for the incandescence and the internal light/shadows too.
I was hoping for something a bit better integrated :banghead:, like a couple of nodes to add, without make the use of the fluids more complicated. This is something that could work 5 years ago when they introduced the linear workflow, I can’t believe in 2012 is still in this state. Very disappointed with AD if this is the only way…


#9

I said I’m not a master of fluids, I do use fluids from time to time though… and when it comes to linear workflow, you’ll generally be better off listening to the lighting/comp monkeys than the FX TDs I think. :wink:

You must never gamma correct a shader’s output, and the fluid is really in essence a shader. all inputs into a shader need to be gamma corrected though (unless they are them selves a shader, or already linear. as a general rule, unless you’ve connected a 16bit or higher hdr or exr, it’s not linear). you have a color swatch for each color in the ramp. you need to connect a gamma node to each one of these unless they are 100% white or 100% black, in which case they will not be affected by a gamma curve.

Also. Redsand made a script for gamma correcting shaders. If you ask him nicely, maybe he can make it work for fluids as well. :slight_smile:


#10

oh I understand now. Damn I need to write a script for that. Creating a gamma node for each color input, it make all a mess, and you actually loose the convenience of using ramps in my opinion. And you have to do that (I suppose) for the incandescence and the internal light/shadows too.
I was hoping for something a bit better integrated :banghead:, like a couple of nodes to add, without make the use of the fluids more complicated. This is something that could work 5 years ago when they introduced the linear workflow, I can’t believe in 2012 is still in this state. Very disappointed with AD if this is the only way…

Mess is not the word, the workflow is a joke this is one of the reasons we ditched Maya for Houdini. I long ago gave up fiddling with gamma nodes.


#11

I think the following setup may work OK for you:

  1. Create a volumeShader node and hook its outColor into your shading group (breaking the connection from the fluidNode). The need for a volumeShader (which is just a do nothing node with only output attributes) is because the shading group simply uses the color connection as a flag that it is connected, not to pass data currently. It automatically then also looks at the shader outColor and outMatteOpacity.
  2. Connect the fluid outColor to a gamma node and the gamma output to the outColor of the volumeShader node.
  3. Connect the outTransparency AND outMatteOpacity of the fluid to the same attributes on the volumeShader.

This seemed to work fine for me in both the Maya and Mental Ray renderers.


#12

that’s a lot better! nice an clean.
As usual… Thanks a lot Duncan!


#13

Can anyone check this file. i wanna make sure what i did is right.


#14

Hmm… this seems wrong to me.
Wouldn’t this essentially be the same thing as connecting a non gamma corrected mia_material into a gamma node, and connecting the gamma node to a surface shader, then assign this surface shader to geometry?

This would mean that the shader is calculated nonlinearly, then a gamma curve is applied, then a inversed LUT gamma curve is applied on top of that… This will not accomplish anything at all.

If the fluid node is calculated linearly internally (if it’s not specifically made to look good in a nonlinear space), then its inputs need to be linear and finally a sRGB curve need to be applied for viewing purposes.

Please correct me if I’m wrong.


#15

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.