Jump to content

Return Points in Volume in VOP?


Recommended Posts

How can I return points inside geometry volume in VOP shader? I've tried to use pcopen and pciterate but it seems it's not the right way, or I am doing something wrong and can't get it to work.

I need integer data 0,1 so I can plug it to switch node.In Softimage ICE there is node called "Point in volume" I need something similar in VOP.

Thank you!

Link to comment
Share on other sites

vops can not create new geometry. So you can not do this in a vop. -- you do mention you are using a vop shader.. which may imply you are creating your volume procedurally at rendertime? If so you may be able to use the pcwrite function, (which requires your volume to be rendered by mantra), which can give you a pointcloud based on the sampling/dicing of the micropolygons.

What you can do as well in sops is create some points first (points_from_volume sop), then create a vop sop. In the first input of your vopsop you plug in the points, in the second input of the vopsop you plug in your volume. Inside your vopsop you can use a "volume sample" or "volume sample from file" vop to sample values from the volume. (check out some of the examples in the help of the volume sample from file).

On a side note, there is a "attribfromvolume" sop that can provide similar results.

I have not used ICE "Point in volume". What does that function do exactly? - does it create a new point, or does it return the value of a specific voxel at a given point in space? (The first would be creating geometry, the second would be sampling.)

Link to comment
Share on other sites

Thanks a lot!This was very helpful and all your methods work very well in VOP SOP level.

What I was trying to do actually is to make the penetrating hair through geometry with 0 opacity (in this case the geometry is baked cloth simulation) .I thought maybe I can do it in the shader level because I was using fur procedural and everything should happen at render time. But today realized that I can actually use only the Fur Sop (just having two of them one for the view port and one for the render)without using the Fur Procedural Shop and do all of my modification in SOP level.Witch is cool because now I can actually pretty easy just delete the points in the Volume with your methods or maybe just using groups and bounding geometry.

But today I realized that I have one more problem, :) the delete in volume doesn't work very well for my case because I have moving fury character and the extruded cloth that I am using as volume it starts to affect parts of the character that shouldn't be affected(for example the arms). So I am really stuck right now and really need help on how I can fix this fur penetrating problem.

You can check this thread with more details on what I am trying to achive

Hope you can give me some hint how to fix this penetrating problem...

ICE "Point in Volume" doesn't crate new points it just returns a boolean value per point.

Sorry for the long post.

Link to comment
Share on other sites

First, you can create geometry with a VOP SOP. The node is called Point Cloud Write. You can create and write a point clouds to disk and then read them in to the SOP network as geometry.

Secondly, if you wish to trim hair to a surface, did you try using the Ray SOP? Set normals on your curves that simply point back to the original surface (simply transfer the surface normal to the points and negate). Then use the Ray SOP to fire the points on to your trim surface and enable the ray distance. Only those points that have normals that intersect the surface will have the ray distance attribute set. Cull the points by the ray distance.

See the example file: clip_hair_by_surface.hip

Now to deal with those individual strands that intersect the surface twice. You should have either a pintoanimation or gluetoanimation attribute on each hair where the root 0 vertex has a value of 1 and the rest have 0. Any bits of orphaned hair after the cutting will have all 0 for either of these two attributes. Easiest way I know to cull is to promote either of these two attributes as a Primitive attribute using Maximum and then remove all those with a primitive attribute of 0.

Link to comment
Share on other sites

Wow ...Thank you so much Jeff! This is exactly what I need it to get .

The only thing that I am concern now is that if I modify the fur in Sop level and not using FurProcedural maybe this will increase the exporting to Mantra and I will get very slow renders?

I will test it now and see how it goes.

I am new to Houdini and still learning the workflow (witch is very different from most 3d applications I've used )and I can say that I really love it. I didn't play with the Ray SOP yet but I thought of using it,just wasn't sure how :) Anyway.. Thank you again! You've been a great help for me last H learning mount . :)

Link to comment
Share on other sites

  • 2 years later...

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