September 22, 2017 - Comments Off on Houdini Sample Sphere VOP

Houdini Sample Sphere VOP

Here's a very useful VOP/Vex node available in Houdini. Sample Sphere creates samples on a sphere. Before now, to sample spherically, I was making a direction then rotating it. But using this is far simpler. With a usample input, it takes a Vec2, or more simply put, 0-1 controls rotating around the circumference of a sphere, and another 0-1 controls the upward vector.
Just put this into a ForLoop, randomise the two Usample Vec2 inputs, and you can sample randomly spherically from a position.
The direction specifies the overall direction that the sphere is on, so if you rotate this, then the sample sphere rotates.

Here's an example fed into a add point, this way you can see the result: Houdini_SampleSphere_01CHoudini_SampleSphere_01B
What's the point? I hear you cry. Well, you can add this to a raycast/rayhit, and use it in the shader context to sample the scene at every pixel hit from Mantra. So think, AO, thickness, edges and much more. Here's a demo file:
SampleSphereDemo Hip

Published by: admin in Houdini

Comments are closed.