Shadow Pass From Fluid Mental Ray

Hi guys,
Question is - how to render fluids with mental ray to passes (color, shadow, velocity maybe, normals). Any idea?

Thanks

you dont, or well color is quite trivial (if you know how the shading network really works). as is normals/shadow for oceands and ponds.

thanks for answer, I just think maybe there is some tricks with custom shaders network, which let me get those passes, or speed up rendering (second question ).

Well for some parts there is. Liek for ocean in wich case its easy. Shadow however isnt a clear cut thing in a raymarching fluid, so its hard to separate all teh calculations form eachother. Best you can get is a pure white cloud.

But see the closer you get to multi reflections/refractions of reality it gets harder to separate the components because theres no such thing as a shadow component in reality. And you cant separate things form each other. Because in reality theres reflections and emissions, and you cannot separate the two or youll get nothing.

Maybe it is possible to use mental ray raymarcher and some advanced shaders,rather then fluid internal raymarcher to get shadow pass and somehing similar to normal pass(if it possible at all…)

Sure but youd have to wirte the entire thing yourself (in essence rewriteing entire fluid). Even so you cannot separate the sahdow form the emission of the cloud its halfway meaningless. Offcourse that depends on your definition fo the shadow.

See the problem si that theres

point1->point2->point3->point4…

in succession and each point can be in shadow or light however each point can slo be in shadow of each other point now if you just calculate the shadow contribution Now suppose youd collect oonly the info of shadow percentage of each point. And let us suppose poit2 and 4 are in shadow. Now you could collect point2shadow result + point4 shadow result. and youd end up loosing the light rays of point1 and point3 so the end result couldnt rebuild the same cloud info as the standalone since youve removed the local occlusion of the light in between. So in reality you can jsut have a meaningful lightness pass theat has BOTH light and shadow or ou end up with nothing.

Other methd would eb to save a very deep raster. Wich has both.

Im not saying its impossible im just saying its too interlocked to simply unravel with simple logic methods.

Its the same kind of thing as that while you can have shadow passes you rarely get the chance to adjust the shadow intensities for the objects reflections just the primary surfaces contribution. But gas has no primary surface and thus not a normal either.

Now a could has no normal, but let us suppose you caoudl sue some treshold as gradient, but again each point would have its own gradient, again could be of use in adeep raster but not a non deep one. Or you could suffice to say the first normal at treshold is enough.

And using deep rasters would be very cose to rerendering teh entire image its just a sort of sample cache.

see a cloud isnt a surface so theres no definitive answers for its surface it has a unlimitted amount fo themn along the visibility axis.

thanks man, for the explanation, appreciate a lot. May be you know any trick to render fluids with real light (raytraced), motion blur in mental ray. Because we use 8 core 50 mashines renderfarm and one frame take up to 2-4 hours . Its crazy and reduces efficiency of fluids use. So maybe I’m using wrong render settings because it should be way out.
Thanks.

ray marching IS expensive. Lower yoru sample settings. Or fake the effect without ray marching. The times dont sound insanely hight to me.

However one thingyou should do is use detail shadowmaps for raymarching instead of raytraced shadows as it reduces n^2 algorithm to a nlogn algorithm.

PS: theres no such thing as real light inside a computer no matter how much you raytrace, in any event if there is its even more nsanely expensive than 2-4 hours. Because youd need spectrographic textures and a ray amount that far surpasses anything you could imagine.

I would like to use detailed shadow maps, but I hear that they not working with fluids, and only raytraced segmented shadows can be applyed to fluids, is it true?

QUOTE(Joojaa @ 03/30/08, 09:28 PM) [snapback]283457[/snapback]
ray marching IS expensive. Lower yoru sample settings. Or fake the effect without ray marching. The times dont sound insanely hight to me.

However one thingyou should do is use detail shadowmaps for raymarching instead of raytraced shadows as it reduces n^2 algorithm to a nlogn algorithm.
PS: theres no such thing as real light inside a computer no matter how much you raytrace, in any event if there is its even more nsanely expensive than 2-4 hours. Because youd need spectrographic textures and a ray amount that far surpasses anything you could imagine.

Interesting advice. I’ve been using raytraced shadows. Now I’m checking my rendereds with detail shadow maps to see the difference.

A thought on a work around for getting a “shadow pass”, and I do mean work around. Change surface of the fluid to solid, then convert fluid to poly and shad poly accordingly to create your shadow pass. I haven’t tried it myself, but I’m about too as I’m in the same boat where I have steam elements that I’d rather not re-render time and again as the model the steam is emitting from changes shaders, et al.

Would appreciate your insite Joojaa.

actually, I found a way of getting out a shadow pass.

  • Apply the “use background” shader to your ground and whatever other surface that will be recieving shadows
  • under the “shading” dropdown for your fluid, go to the bottom to “matte opacity” an change it to zero

I noticed spot lights will leave a ring, but directional lights seem to cast decent shadows. I am also using segmented, raytraced shadows and getting decent results.

Hope this helps.

We werent talking shodow passes of surfces after all that works normally. We were talking of shadow passes of the fluids itself. (not the shadow it casts)

so, you want to putput a shadow pass for the self-shadow of the fluid? Forgive me, but I don’t understand the need for such a pass. How would you use it?

I dont i jsut explained why one cant have one so easily.

QUOTE
How would you use it?

The same way you use the shadow pass of the surface. I mean its up to the comp artist. I mean theres no sane reasn to use saparate shadow passes either. unless one starts to think about what it can do to you it sure as hell isnt realistic to separate shadows form shading.

You should be using RGB passes on the fluid, if you want more options for passes I suggest you learn Houdini or you can fake alot of passes in Maya fluids but your using cheats and in some shots those wont hold up.