Jump to content
kvdo

Reflective volumes

Recommended Posts

I came across this video a little while back, and the poster doesn't seem to have much transparency about his method.

 

 

does anyone have any ideas on how one can get specular/reflections onto a volume in the shader?

Share this post


Link to post
Share on other sites

I think you can use the gradiend of the volume as a normal to compute the reflection

Share this post


Link to post
Share on other sites

It was for a job so I can't really go into specifics (I used some variation of it for the softtoys in my latest reel), but it's quite straightforward. The gradient of an SDF acts like a normal, so use that for shading.

Share this post


Link to post
Share on other sites

Thanks Skybar. I realise now I was going wrong in calling the gradient volume 'N'. That seems to not work for whatever reason. Also later realised that I needed to transform the gradient into the correct space.

Here's the hipnc for anyone else's future reference.

reflective volume_v02.hipnc

  • Like 3

Share this post


Link to post
Share on other sites

Thanks Skybar. I realise now I was going wrong in calling the gradient volume 'N'. That seems to not work for whatever reason. Also later realised that I needed to transform the gradient into the correct space.

Here's the hipnc for anyone else's future reference.

 

Hey Kevin, thanks for sharing

I just opened the scene you provided though and it doesn't work for me - I have an error in the shader on the ADD op regarding a data type mismatch...where you are trying to add the BSDF to the specular sum ?...care to open the provided hipnc file and see if it works for you ? Can't figure this out on my own...

 

thanks

Share this post


Link to post
Share on other sites

nevermind - aparrently the specular model in H14 is different than the H13 one, and was "leaking" some parameters. Opened in H14 and worked just fine.

so word of caution : H14 file.

 

thanks again, Kevin

Share this post


Link to post
Share on other sites

Ah, yes. That would be the issue. Pleasure Nicolae!

Share this post


Link to post
Share on other sites

Hi. Know this is an old thread, but was wondering if anybody can help out. Trying to get specular highlights on converted vdbs from particles.

Used the same method as the hip file (reflective volume_v02.hipnc) above, but the normals dont seem to be recognized.

Any help would be greatly appreciated!

I've attached a hip file to explain what i'm trying to do.

 

reflective volume_test_v01.hip

Share this post


Link to post
Share on other sites
2 hours ago, pupps09 said:

Hi. Know this is an old thread, but was wondering if anybody can help out. Trying to get specular highlights on converted vdbs from particles.

Used the same method as the hip file (reflective volume_v02.hipnc) above, but the normals dont seem to be recognized.

Any help would be greatly appreciated!

I've attached a hip file to explain what i'm trying to do.

 

reflective volume_test_v01.hip

It's because you have no normals. Take a look at the values on the node "point1", you tell it to add normals but a point doesnt have intrinsic normals so none will be added - the value for N is (0, 0, 0). Add point normals on the sphere instead, and the scatter will inherit those.

Share this post


Link to post
Share on other sites
30 minutes ago, Skybar said:

It's because you have no normals. Take a look at the values on the node "point1", you tell it to add normals but a point doesnt have intrinsic normals so none will be added - the value for N is (0, 0, 0). Add point normals on the sphere instead, and the scatter will inherit those.

Thx for the quick reply David. It worked like a charm. 

I actually have one more question. What I'm really trying to achieve is trying to get specular on my whitewater sim, which are cached out as points. I want to render them as a volume with specular highlights.

The cached points have no normals. Would I need to convert those to polygons via Particle Fluid Surface first to get the Normals and then convert to a VDB?

This guy that posted this on vimeo https://vimeo.com/159216723  states that he converted his FLIP particles to VDB with "VDB from particles", then used "VDB Analysis" to calculate the gradient field, but doesnt really go into detail about anything else.

Do you understand how he is doing this?

 

Share this post


Link to post
Share on other sites
4 hours ago, pupps09 said:

Thx for the quick reply David. It worked like a charm. 

I actually have one more question. What I'm really trying to achieve is trying to get specular on my whitewater sim, which are cached out as points. I want to render them as a volume with specular highlights.

The cached points have no normals. Would I need to convert those to polygons via Particle Fluid Surface first to get the Normals and then convert to a VDB?

This guy that posted this on vimeo https://vimeo.com/159216723  states that he converted his FLIP particles to VDB with "VDB from particles", then used "VDB Analysis" to calculate the gradient field, but doesnt really go into detail about anything else.

Do you understand how he is doing this?

 

Yeah, turn your particles into an SDF volume (with VDB From Particles), calculate the gradient of that (with VDB Analysis) and then sample that onto your particles to use as a normal. Even cheaper is to use the surface field from the sim, because we get that for free anyway (if it is a FLIP sim). Included both as an example here: particleNormals.hip

Hope it helps!

  • Like 1

Share this post


Link to post
Share on other sites
11 hours ago, Skybar said:

Yeah, turn your particles into an SDF volume (with VDB From Particles), calculate the gradient of that (with VDB Analysis) and then sample that onto your particles to use as a normal. Even cheaper is to use the surface field from the sim, because we get that for free anyway (if it is a FLIP sim). Included both as an example here: particleNormals.hip

Hope it helps!

Thx once again David. Would've never been able to come up with that on my own. Just to make sure, would I render out the points with a volume shader and connect the normal parameter to the specular (ex: PBR Specular, PBR Metallic) in the shader? 

I tried this approach and got the specular reflections, but wasn't sure if this is the correct method. 

Share this post


Link to post
Share on other sites
5 hours ago, pupps09 said:

Thx once again David. Would've never been able to come up with that on my own. Just to make sure, would I render out the points with a volume shader and connect the normal parameter to the specular (ex: PBR Specular, PBR Metallic) in the shader? 

I tried this approach and got the specular reflections, but wasn't sure if this is the correct method. 

I haven't done it myself for particles but I reckon that would work! If it looks good and works for you go for it :) 

Share this post


Link to post
Share on other sites
11 minutes ago, Skybar said:

I haven't done it myself for particles but I reckon that would work! If it looks good and works for you go for it :) 

Cool...Appreciate all of your help!

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

×