Jump to content

Question of Volume sample from file.


Recommended Posts

Hey guys,

 

I am doing study on vex node rencentlty and I just coufused about this node Volume sample from file.

in help it said "Samples a specific volume primitive.", it has two input P and filename.

My question is what kind of result does this node output? I saw someone use this to ouput vel, but why it need P infromation as input instead of only using the filename input?  I do want to get it function on each input.

 

thanks for your answers:)

 

 

Link to comment
Share on other sites

Volume Sample From File VOP has 3 inputs.

1. Geometry File

2. Primitive Number

3. Sample Position

 

1. is your volume, this can either be a file on disk or another node in your scene that has a volume primitive.

2. is the primitive which you want to sample. If you have a vector field you have 3 primitives (0, 1 ,2) - so here you specify which one to sample from. In the case of a vector volume you probably want to sample it three times to get a vector, so you'd put down three Volume Samples and sample each primitive.

3. this is the position inside the volume you want to sample. For example some particles. 

 

The value you get is the value the volume (1) has at the position (3).

Link to comment
Share on other sites

Basically you get information about the volume at that specific point in space.

Imagine you were in the living room in your house with 1 of your friends, and another one is in the kitchen, for example. The entire house is the volume container, the room where the 2 of you are is the volume density (in other words - there's 'fog' only in the living room, the rest of the house is empty but still inside the volume container). 

Now, if I connect you and your friends as P and the house as the volume primitive, I will get information about your position in the house in respect to the room! where the 2 of you are. In the case of a SDF volume, the two of you will return a negative value, and your friend in the kitchen will return a positive value. That's basically tell me if you are inside the living room. 

 

Hope that makes it somewhat clear. It's a cool way to check for intersections. There's also the volume gradient from file node which returns .. well ... the gradient of the volume. So you can use that to push points in the opposite direction. 

 

http://www.sidefx.com/docs/houdini13.0/nodes/vop/volumegradient

 

 

edit; Actually, the whole container stuff - scratch that. I realised it doesn't make much sense so I tested my theory really quickly and the bounds of your volume make no difference. Just clarifying that in case I got someone else confused :D 

Edited by Georgie
Link to comment
Share on other sites

thanks for the replys from skybar and Georgie.

I am trying to understand it like this way:

1. this node only get sample result from "P" and it has negtive and positve;

2. Primitive Number is a index number for defining the axis where sample is get from.

 

I guess the node works like this and return a 2D distance vaule in specific axis:) but anyway, I already got the idea. thanks again!

Link to comment
Share on other sites

well, technically it returns just a single number - the closer you are to the surface - the closer it gets to 0. If you're inside, it's negative. ( that's in case you're using SDF) 

 

Primitive number is something VERY different. It's there so you can specify which prim (another word you can use is grid ; or field)  you want to sample.  

 

http://i.imgur.com/J5arree.png

 

 

Also, maybe it seems weird that you have to plug P but imagine you created a simple constant that's used to initiate something else once the volume moves close to it or something. Well, anything. Houdini is awesome that way. 

 

Read Skybar's explanation again. It's really, really good. If you got any questions, ask again. Cheers :} 

Edited by Georgie
Link to comment
Share on other sites

well, technically it returns just a single number - the closer you are to the surface - the closer it gets to 0. If you're inside, it's negative. ( that's in case you're using SDF) 

 

Primitive number is something VERY different. It's there so you can specify which prim (another word you can use is grid ; or field)  you want to sample.  

 

http://i.imgur.com/J5arree.png

 

 

Also, maybe it seems weird that you have to plug P but imagine you created a simple constant that's used to initiate something else once the volume moves close to it or something. Well, anything. Houdini is awesome that way. 

 

Read Skybar's explanation again. It's really, really good. If you got any questions, ask again. Cheers :} 

thanks georgie., your explanation is very straightforward:)

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...