# Volume density from texture?

## Recommended Posts

Hello magicians,

I saw a great image by Lee Griggs the other day and I tried to replicate, here is the original effect

He did it with Arnold (i think in maya), by projecting a texture into a volume density, here is some explanation https://support.solidangle.com/pages/viewpage.action?pageId=55710284

I didnt know how to project a texture into density, so I projected a texture, the deleted by color and converted that into vdb > fog, but that way I don't get any depth, any ideas? I've read about a rest field that does something like UV on volumes but cant figure out how

Here are my attempts:

Hip file attached,

Cheers!

volnoise3.hip

• 3

##### Share on other sites

@f1480187 @Atom @eetu any of the wizards got a clue on this?

Cheers

##### Share on other sites

Figured out, not sure if this is the best option but seems to work, scattered points and used a point cloud, I'm glad I finally understood the point cloud stuff

Hip attached in case someone finds useful

Cheers!

voldensed.hip

• 1

##### Share on other sites

There are many ways you can project onto volume. The rest field is one of them and as you mentioned it can been used as UVs. I tend to skip that step and directly use the P which has been fitted to a the bounding box of the desired projection.

It's easier to try that on a volumeVOP to begin with. Let's say you want to project along the Y axis between x and z values of -10 to 10. All you need to do it fit the x and z values within that range so you have a 0 to 1 and feed that to the UVs (st) of the texture node. You can even have a second object as input and automatically get its bounds to calculate your fit range. Now if you want the projection to be on an arbitrary axis, you will have to do some extra maths to rotate the P, project and rotate back within VOPs, or if it's easier, you can do it at the SOP level.

What is important to keep in mind, is that volumeVOP will operate on a voxel level and you will never get any sharper detail than the voxel size. But once you do this, you can easily transfer the same nodes/logic onto a volume shader, which operates on rendered samples, which means you can go as sharp as your texture. But of course if you move your camera away from your projection axis, the texture representation will get blurred along that axis.

But then again, that's just one approach and maybe there are other ways that may give you more control and better results.

• 2

##### Share on other sites

@ch3 thanks for the info!, about the rest field, how do I add that manually? rest sop has nothing to do with it, right?, I readed that when you do a pyro sim the rest stuff can be added checking a box, but how do I add manually in the sop context, ie: if I create my own vdb?

About volume vop, I understand the half of the stuff  but will play with Houdini until I get there, thanks again for the direction!

Cheers

##### Share on other sites

I may be wrong about the rest volume, but can't you just manually make 3 volumes one for each axis and use a volume wrange to populate the values like that?

@restX = @P.x;

@restY = @P.y;

@restZ = @P.z;

I believe this makes sense to use when you advect it together with density, so you can have a reference to a "distorted" coordinate to drive noises with. Otherwise using the above rest fields will be the same with using world space P in the shader (P transformed from screenspace to worldspace)

• 1

##### Share on other sites
On 14/7/2017 at 0:49 PM, ch3 said:

I may be wrong about the rest volume, but can't you just manually make 3 volumes one for each axis and use a volume wrange to populate the values like that?

@restX = @P.x;

@restY = @P.y;

@restZ = @P.z;

I believe this makes sense to use when you advect it together with density, so you can have a reference to a "distorted" coordinate to drive noises with. Otherwise using the above rest fields will be the same with using world space P in the shader (P transformed from screenspace to worldspace)

Thank you! Will give a shot!

## Create an account

Register a new account