Jump to content
Sign in to follow this  
pberto

Mantra: Particle Selfshadowing Without Deep Shadows

Recommended Posts

Hi there,

in MANTRA/VEX is it possible to render particles volumetrically with selfshadowing, *without* the use of deep shadows maps?

There are several density-voxelgrid techniques to do so in volume shaders (they are used for HAIR and FLUIDS, for example in Maya, or also for particles, like the Krakatoa renderer does).

Paolo

Edited by pberto

Share this post


Link to post
Share on other sites
Hi there,

in MANTRA/VEX is it possible to render particles volumetrically with selfshadowing, *without* the use of deep shadows maps?

There are several density-voxelgrid techniques to do so in volume shaders (they are used for HAIR and FLUIDS, for example in Maya, or also for particles, like the Krakatoa renderer does).

Paolo

Ehm sorry, I reformulate the question:

1) is it possible to render particles volumetriically?

2) if 1 is true, is there a way to render with the standard toolset the particles, volumetrically, with selfshadowing? (I think not)

Alternative idea:

Since I want to volume render, I am trying to copy to each particle a small spherical metaball (thanks to the copy node). Those (metaballs) can be rendered in H9 as volumes (there is a new bool option on the geometry nodes, under the rendering tab, geometry subtab). It seems to work with the 'particle' node inside a 'geometry' node at the OBJ level, but when I have a POPnetwork at the root of the geo node I don't even have the geometry>render subtabs. Mhhh investigating on this one yet.

Anyway, question:

1) how to keep metaball spherical and restrain them from behaving too much like metaballs (so how to avoid/limit the creation of the implicit surface)?

Mhh I think I reformulated the question even in a more obscure way... ;p

paolo

Share this post


Link to post
Share on other sites

hey!

It's possible and you're almost there but with your alternative idea :)

There's no way ( that i know of) to render particles, directly as metaballs as you could with POPs when you turn on "render as sprites" or

"render as spheres" etc. there's no "render as volumes/metaballs" in this section. This could be a great idea. This means that for now, you need to copy

your metaballs on the particles and transfer some attributes with the copy SOP and/or scale the metaballs with a stamp expression.

Then, you have to turn, as you mentioned "Metaball to Volume" at the object level ( your popnet must be inside an object, which he is most of the time now, the same object that contain the metaball and the copy sop).

And the good thing is that it will render metaballs as spheres and

not as isosurfaces: no blobby effect! ( but this makes sense since volume render use metaball density as cloud density!)

To do that, you must attach a Vex Volume Cloud Shader ( collapsed into a Material of course)

And to be sure that your light cast shadows (you may have to tweak the quality in your Mantra render node as well)

And that's how it begins.

-d

Edited by FrenchOP

Share this post


Link to post
Share on other sites
hey!

It's possible and you're almost there but with your alternative idea :)

There's no way ( that i know of) to render particles, directly as metaballs as you could with POPs when you turn on "render as sprites" or

"render as spheres" etc. there's no "render as volumes/metaballs" in this section. This could be a great idea.

Hey thanks! And it's good to know my brain starts working in the houdini logic! :)

This means that for now, you need to copy

your metaballs on the particles and transfer some attributes with the copy SOP and/or scale the metaballs with a stamp expression.

Then, you have to turn, as you mentioned "Metaball to Volume" at the object level ( your popnet must be inside an object, which he is most of the time now, the same object that contain the metaball and the copy sop).

And the good thing is that it will render metaballs as spheres and

not as isosurfaces: no blobby effect! ( but this makes sense since volume render use metaball density as cloud density!)

To do that, you must attach a Vex Volume Cloud Shader ( collapsed into a Material of course)

And to be sure that your light cast shadows (you may have to tweak the quality in your Mantra render node as well)

And that's how it begins.

-d

That's exactly what I was doing, somehow in one of my tests I had an aberrant geometry node which is without the geometry>render subtabs... I triplechecked and still dunno why... can a geometry node change its UI appearance depending upon its contents actually?

I can post a screenshot eventually, anyway I recreated it in a more simple version and it works fine now.

And you are 100% right, there is absolutely no isosurface when volume rendering. I thought there was since I was tuning it in the viewport, but when rendering it's obviously gone due to the the fact density is involved as you pointed out.

Looks like I had already what I wanted :) I just need to "adapt" to the workflows.

Ofcourse I still must use deep shadow for selfshadowing and I would prefer not to since there are ways to automagically calculate that if you are volume shading... maybe there is a VEX way, but boy... this software is huge... and very cool!

Thanks,

paolo

Share this post


Link to post
Share on other sites

well, you're even closer to the result that you think you are, lol

About the deep shadwos

I don't use deep shadows ( i mean specifc shadow maps). Just use Ray-Traced Shadows under the shadow tab of your light. And it defaults to "transparent shadows" ( below). It's equivalent to deep shadows ( one is raytracing, one is more "scanline" - but i lose my old opinion that scanline is faster than raytracing, not anymore).

The default volume shader handle shadows naturally, no need to write any more VEX or complex raymarching: It's aaaalll taken care of :). That's the beauty of the new volume integration.

You may have to use more ray samples in rendering than the default ( i get a grainy look with the defaults).

-d

Share this post


Link to post
Share on other sites

Is there a good way to break up the volume cloud shader to have more of a randomized cloud noise? When I've used volume cloud with metaballs it always results in a smooth type of volume. I've tried fluid simulations with vorticles also, but haven't gotten the desired result.

I remember the i3d fluffy cloud shader looks pretty good, is there something like that that can be easily rendered with the volume shaders (without going through i3d)?

Share this post


Link to post
Share on other sites

Well, I hope you get enchanted by the magic that is Mantra.

I love this renderer, myself. I think it's awesome and has some of the greatest potential; and without a doubt the best price point too.

Share this post


Link to post
Share on other sites
Hi Paulo,

If you'd like to see how to do this, perhaps try the FX Tools and analyse their setup:

http://www.sidefx.com/index.php?option=com...&Itemid=241

Yup, I did check this previously, but for other reasons.

I even did not realize it at the first glance.

I actually reinvented the wheel :)

So, it looks like this trick is the only way to render meta-particles volumetrically in H9.

I think it would be nice if particles could do it out of the box (without the metaballs trick).

How can I do a feature SUG to SESI?

If they would add this, they could also build in the selfshadowing without deep shadows or raytrace shadows.

There is a very fast density driven technique to do so, and that would be cool. Maya fluids do it all the time.

Anyway, there are a lot of cool things in this setup I did not see at the first glance, like the split of a render Vs display network.

I am now checking what you can do with VEX networks... ammazzzinnnggg: coding graphically!

p

Share this post


Link to post
Share on other sites
Well, I hope you get enchanted by the magic that is Mantra.

I love this renderer, myself. I think it's awesome and has some of the greatest potential; and without a doubt the best price point too.

As I said, I started looking at the VEX network of the smoke in the FX tool.

Amazing building blocks... I did not realize the nodes were *so* atomic, I mean global variables and loops etc..

I found myself thinking: "why I didn't check it before!!!" :)

Mantra seems indeed very powerful (and I'm just scratching the surface) and convenient.

It's also good to see that the same level of control is available with renderman renderers: all the atomic nodes of VEX there too.

I see also mental ray is there, however I use it less and less, at least as long as there is no shading language with virtual machine.

Tnx for the tips,

p

Share this post


Link to post
Share on other sites
well, you're even closer to the result that you think you are, lol

:lol:

About the deep shadwos

I don't use deep shadows ( i mean specifc shadow maps). Just use Ray-Traced Shadows under the shadow tab of your light. And it defaults to "transparent shadows" ( below). It's equivalent to deep shadows ( one is raytracing, one is more "scanline" - but i lose my old opinion that scanline is faster than raytracing, not anymore).

The default volume shader handle shadows naturally, no need to write any more VEX or complex raymarching: It's aaaalll taken care of :). That's the beauty of the new volume integration.

Yes, I did a comparison between raytraced and deep shadows and indeed raytracing it's faster.

I haven't tested with lotsa metaparticles and with lower bias.

Will let you guys know when I finish.

Anyway, STILL I think the selfshadowing could be optimized without the use of raytarced shadows or deep shadows. just density based, as long as you place the particles in a voxel hierarchy.

I am checkign in VEX what I can do, but I am pretty new to this, so rather likely it would take some time to figure out.

Again, if I arrive to a good conclusion I will sure let the forum know.

You may have to use more ray samples in rendering than the default ( i get a grainy look with the defaults).

-d

It's more the bias actually that rules the quality.

I am getting good results already :)

Naaiz.

p

Share this post


Link to post
Share on other sites

One other thing you can do is shade Volumes using some sort of "hypertexture" techniques. You can access a Volume's gradient by simply trying to use its normal (N) in VEX. You could then use diffuse shading on this normal (without considering shadows, if you want) and so shade the density. Its a very old technique but it might give you what you want.

http://mrl.nyu.edu/~perlin/doc/hypertexture/

PS: Not that old is necessarily bad. See "texture-mapping". ;)

Share this post


Link to post
Share on other sites
Anyway, STILL I think the selfshadowing could be optimized without the use of raytarced shadows or deep shadows. just density based, as long as you place the particles in a voxel hierarchy.

Interesting topic. I would be interested what you are up to. Ray casting from the voxel center towards the light? What do you mean with just density based? Isn't raycasting from the light through the medium, like for a deep shadow map, just density based too? Care to share?

Share this post


Link to post
Share on other sites
Interesting topic. I would be interested what you are up to. Ray casting from the voxel center towards the light? What do you mean with just density based? Isn't raycasting from the light through the medium, like for a deep shadow map, just density based too? Care to share?

Sure.

Yes, ray casting from voxel center.

I know it works for hair so I was thinking to adapt it for particles too.

For hairs basically you pre compute and store selfshadow infos (normal ad depth) in each hair primitive control point.

You later reuse that to approximate the "amount of hair matter" a light ray needs to penetrate in order to reach the control point.

I think the implementation works this way: you build a voxel grid around. Then you raymarch: for each voxel you let a ray "escape" and count the control points encountered along the way. I think it escapes around the hair normal. Can't remember. It's an oldie, done by R+H.

Anyway, each voxel stores the number of control points it contains.

p

One other thing you can do is shade Volumes using some sort of "hypertexture" techniques. You can access a Volume's gradient by simply trying to use its normal (N) in VEX. You could then use diffuse shading on this normal (without considering shadows, if you want) and so shade the density. Its a very old technique but it might give you what you want.

http://mrl.nyu.edu/~perlin/doc/hypertexture/

PS: Not that old is necessarily bad. See "texture-mapping". ;)

Looking into this too. Love the old trix! :)

Share this post


Link to post
Share on other sites

There is the option of using scattered points and performing some VexPointCloud illumination, too. See Mario Marengo's shader which simulates some multiple scattering in volumes for ideas. If you used this as your primary lighting calc (instead of mixing with direct illum of each sample), you could save on the sheer number of lighting calcs you do but still use high-quality density (for the hiding bit). So, softer illumination but faster renders, hopefully.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×