Density gradient between two surfaces
2330 5 2- nicole1
- Member
- 4 posts
- Joined: Dec. 2018
- Offline
Hello, I would like to create a density gradient inside a VDB (object in first image). I need the density values to be one along the bottom surface and transition smoothly into density values of zero along the top surface (see second image).
I have tried to mix together VDBs with different types of densities to achieve this effect but the gradient doesn't adhere to the curvature of the surfaces (see thrid image).
How do I blend the density smoothly and consistently between the two surfaces?
Example files would be helpful as I am still learning Houdini, thank you.
I have tried to mix together VDBs with different types of densities to achieve this effect but the gradient doesn't adhere to the curvature of the surfaces (see thrid image).
How do I blend the density smoothly and consistently between the two surfaces?
Example files would be helpful as I am still learning Houdini, thank you.
- Benjamin Lemoine
- Member
- 143 posts
- Joined: Oct. 2015
- Offline
- nicole1
- Member
- 4 posts
- Joined: Dec. 2018
- Offline
Hi Benjamin, thanks for getting back to me and including an example file. Your method works well and produces a much better result than my original attempt.
Perhaps I drew the arrows incorrectly in the original diagram. I think the VOP needs to use the normals from the top surface as well as the bottom surface. I have been through your file and made some adjustments in an attempt to get it looking closer to the gradient seen in the diagram. It's nearly there (not sure if this is the best way) but now I need to get rid of the white lines running vertically through the centre. I think this might be caused by the way the near point node is finding the closest points on the top surface where there is steep curvature.
Do you have any suggestions on how I could fix this please?
Perhaps I drew the arrows incorrectly in the original diagram. I think the VOP needs to use the normals from the top surface as well as the bottom surface. I have been through your file and made some adjustments in an attempt to get it looking closer to the gradient seen in the diagram. It's nearly there (not sure if this is the best way) but now I need to get rid of the white lines running vertically through the centre. I think this might be caused by the way the near point node is finding the closest points on the top surface where there is steep curvature.
Do you have any suggestions on how I could fix this please?
- Benjamin Lemoine
- Member
- 143 posts
- Joined: Oct. 2015
- Offline
Hello
You could use normal from the top surface too with the dame setup and compute one of the distance with it. but anyway this is a craft setup , cause the ray I'm sending won't be in the direction you want…it would mean do the opposite…from a point getting to know which point normal is passing trough then compute the distance… I'm not so good at math thinking but there must be a way !
I have no time to dig further.
But i will be happy to know if you find something…
Cheer
Benjamin
You could use normal from the top surface too with the dame setup and compute one of the distance with it. but anyway this is a craft setup , cause the ray I'm sending won't be in the direction you want…it would mean do the opposite…from a point getting to know which point normal is passing trough then compute the distance… I'm not so good at math thinking but there must be a way !
I have no time to dig further.
But i will be happy to know if you find something…
Cheer
Benjamin
- Benjamin Lemoine
- Member
- 143 posts
- Joined: Oct. 2015
- Offline
Hello again
I'm not at home but i just had an idea….
With volume sample and volume gradient you would get some direction and distance to the next surface , the problem would be to get the distance to the opposite surface, you could maybe negate the volume gradient vector…. But it will be more or less the same but with a better direction though…
Good work !
Benjamin
I'm not at home but i just had an idea….
With volume sample and volume gradient you would get some direction and distance to the next surface , the problem would be to get the distance to the opposite surface, you could maybe negate the volume gradient vector…. But it will be more or less the same but with a better direction though…
Good work !
Benjamin
- nicole1
- Member
- 4 posts
- Joined: Dec. 2018
- Offline
-
- Quick Links