Jump to content

Normal passes on Volume renders?


Neil78

Recommended Posts

Inside the volume material read the normal for each sample with a Volume Gradient Sample from File VOP, and pipe the result to the Surface Normal output.

Looks like it has to be multiplied with opacity to get a normalised result.

  • Like 1
Link to comment
Share on other sites

IIRC you can use the 'N' global variable in a surface shader without having to create it in SOPs or read it from a file, as it gets computed automatically at render time. You should then multiply it by dPdZ and opacity to make it more usable in compositing.

--jon

Hi

Whats a good way / is it possible - to render normal passes of volume / pyro renders?

Thanks Odforce

Link to comment
Share on other sites

  • 2 weeks later...

IIRC you can use the 'N' global variable in a surface shader without having to create it in SOPs or read it from a file, as it gets computed automatically at render time. You should then multiply it by dPdZ and opacity to make it more usable in compositing.

--jon

Hi guys - thanks for both replies - and sorry for delay in getting back to you - i was sidetracked with work

so i've got a new pyro shader in H12 - ive added a global variables vop - and the surface position is routed to the volume gradient from file vop - and that is routed to the surface normals of the surface output vop..

Does this sound right to you guys - and how do i multiply by BSDF? or opacity?

Thanks

Link to comment
Share on other sites

Inside the volume material read the normal for each sample with a Volume Gradient Sample from File VOP, and pipe the result to the Surface Normal output.

Looks like it has to be multiplied with opacity to get a normalised result.

Hi guys - thanks for both replies - and sorry for delay in getting back to you - i was sidetracked with work

so i've got a new pyro shader in H12 - ive added a global variables vop - and the surface position is routed to the volume gradient from file vop - and that is routed to the surface normals of the surface output vop..

Does this sound right to you guys - and how do i multiply by BSDF? or opacity?

Thanks

Link to comment
Share on other sites

  • 2 weeks later...

I don't have access to Houdini 12 so I don't know what is possible in the pyro shader, but the setup to render normals is pretty simple. Create a material where you take the N global variable, normalize it and then multiply it by the computed opacity of the volume density, then plug it into Cd and plug opacity into Of. The attached image and Houdini 11 scene demonstrates this.

Cheers,

Jon

post-2980-132874530273_thumb.png

Hi guys - thanks for both replies - and sorry for delay in getting back to you - i was sidetracked with work

so i've got a new pyro shader in H12 - ive added a global variables vop - and the surface position is routed to the volume gradient from file vop - and that is routed to the surface normals of the surface output vop..

Does this sound right to you guys - and how do i multiply by BSDF? or opacity?

Thanks

shaded_volume_normals.hipnc

  • Like 1
Link to comment
Share on other sites

I don't have access to Houdini 12 so I don't know what is possible in the pyro shader, but the setup to render normals is pretty simple. Create a material where you take the N global variable, normalize it and then multiply it by the computed opacity of the volume density, then plug it into Cd and plug opacity into Of. The attached image and Houdini 11 scene demonstrates this.

Cheers,

Jon

post-2980-132874530273_thumb.png

Many Thanks jonp - ill check out right away - sorry for delay in getting back

Link to comment
Share on other sites

Many Thanks jonp - ill check out right away - sorry for delay in getting back

Hi jonp - thanks for the hip - really helpful - 'ive since discovered that H12 has yet to sort out the global "N" for volumes (whether it remains available as a global or has to be computed manually, and if so how and at what cost) - which explains why i was having trouble :(

really appreciate the help though

Best

Link to comment
Share on other sites

  • 1 year later...

The method that utilizes Volume Sample from File works unless you add shader noise or other render-time details. In that case you can use the gradient() vex function. It doesn't come wrapped in a vop node currently but it's simple to set up with an Inline Code. Here's an example of it in action, the pyro sim in this file has a rest field which is used to calculate noise in the Billowy Smoke shader. The red nodes in the shader are doing the normal calculation. Since the gradient function returns a vector in screen space it's important to transform it to world coordinates, though if kept in screen space the R and G channels can be used for 2d heat distortion in comp :)

volN.hip

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 2 years later...

I downloaded this example file but it doesnt seem to work anymore ? 

 

I don't have access to Houdini 12 so I don't know what is possible in the pyro shader, but the setup to render normals is pretty simple. Create a material where you take the N global variable, normalize it and then multiply it by the computed opacity of the volume density, then plug it into Cd and plug opacity into Of. The attached image and Houdini 11 scene demonstrates this.

Cheers,
Jon
attachicon.gifshader_volume_normals.png

  • Like 1
Link to comment
Share on other sites

i think h14 doesn't auto calculate the normal for volumes anymore.  you need to calculate the gradient yourself using a gradient vex function in an inline block.  look at the rendering subforum for a recent discussion on this.

 

honestly tho, N from a transparent surface might be a bit odd.  it's going to end up being a blend of all the samples it hits which could throw things way off.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...