I dug up my slides from when we implemented [dl.acm.org] vdbToSpheres to help explain what's going on. Here's one way to think about it:
* for all of the points inside a level set, choose the one furthest from the surface.
* That point is the center of a sphere, with radius equal to that distance (or optionally clamp the max sphere size).
* remove all other points that exist inside that sphere
* update the distances to all remaining points
* repeat (until desired number of spheres, reach a size threshold, etc)
If you change the levelset, the distribution of possible points would change. Since your base object is changing over the animation, the level set would change, hence the spheres change during animation.
In practice in production, artists often run vdbToSpheres on a reference frame (eg. first frame of the animation), then wrap deform the spheres to the animated/deforming mesh. The result is a temporally-coherent number & location of spheres.
Found 68 posts.
Search results Show results as topic list.
Technical Discussion » Question About VDB to Sphere
- jbudsberg
- 92 posts
- Offline
Technical Discussion » VDB from Polygons: non-watertight geos?
- jbudsberg
- 92 posts
- Offline
In production, we get open surfaces from Modeling often. The common practice is to convert the mesh to an unsigned distance field prior to converting to a signed distance field.
I have an example in the Houdini example file https://www.openvdb.org/download/ [www.openvdb.org] Look for /obj/example_levelset/extruded_sdf
I have an example in the Houdini example file https://www.openvdb.org/download/ [www.openvdb.org] Look for /obj/example_levelset/extruded_sdf
Edited by jbudsberg - April 10, 2024 13:02:11
Technical Discussion » OpenVDB example file
- jbudsberg
- 92 posts
- Offline
Another update is available today! Took a while (to make sure I didn't break anything), but I've scrubbed the file and swapped everything I could to native SOPs.
A few opensource nodes/workflows remain (demonstrating new or slightly-different functionality), but I've tried to create parallel native workflows when possible.
A few opensource nodes/workflows remain (demonstrating new or slightly-different functionality), but I've tried to create parallel native workflows when possible.
Technical Discussion » OpenVDB example file
- jbudsberg
- 92 posts
- Offline
Thanks for the list! Yea I’m always running with the opensource nodes, but these days most things should have parity. I can totally scrub through and see what I can move to native nodes.
Technical Discussion » OpenVDB example file
- jbudsberg
- 92 posts
- Offline
hey all,
Heads up--in preparation for the OpenVDB Course at Siggraph, I've updated the examples HIP and it's now live on the website. A few updates throughout, but the big changes are new sections for extrapolation and AX. Let me know if you have any questions or would like to see anything else.
https://www.openvdb.org/download/ [www.openvdb.org]
This Houdini HIP file demonstrates many of the nodes in the toolkit and illustrates fundamental concepts such as OpenVDB tree structures, tiles and voxels, narrow-band level sets and fog volumes. More importantly, it presents recommended workflows for common tasks like particle surfacing, polygon conversion, fracturing, filtering, resampling, extrapolation, etc. The current hip file is tested with Houdini 19.5 and OpenVDB 9.1.
Heads up--in preparation for the OpenVDB Course at Siggraph, I've updated the examples HIP and it's now live on the website. A few updates throughout, but the big changes are new sections for extrapolation and AX. Let me know if you have any questions or would like to see anything else.
https://www.openvdb.org/download/ [www.openvdb.org]
This Houdini HIP file demonstrates many of the nodes in the toolkit and illustrates fundamental concepts such as OpenVDB tree structures, tiles and voxels, narrow-band level sets and fog volumes. More importantly, it presents recommended workflows for common tasks like particle surfacing, polygon conversion, fracturing, filtering, resampling, extrapolation, etc. The current hip file is tested with Houdini 19.5 and OpenVDB 9.1.
Solaris and Karma » Per-instance displayColor with PointInstancer
- jbudsberg
- 92 posts
- Offline
hey Chris, great to hear from you! Hope all is well. Thanks for the info, I'll file an RFE as this would be incredibly helpful for visualization.
Technical Discussion » Convert Numpy Array to VDB
- jbudsberg
- 92 posts
- Offline
That said, given your example is Houdini Python SOP, not sure we have access to that library. I poked at this briefly--perhaps you could convert your Numpy array to Houdini points, then build the appropriate VDB grid topology (I gave a couple options) and sample the point value into the VDB grid.
Technical Discussion » Convert Numpy Array to VDB
- jbudsberg
- 92 posts
- Offline
Sorry I'm late on the reply! But heads up there are VDB Python bindings (which do interface with Numpy).
import openvdb as vdb import numpy filename = '/work/stanford/Dragon.obj' print 'reading: %s' % filename points = [] triangles = [] quads = [] f = open(filename, 'r') lines = f.readlines() for line in lines: t = line.split() if t[0] == 'v': # vertex points.append( [ float(t[1]), float(t[2]), float(t[3]) ] ) elif t[0] == 'f': if len(t) == 4: # triangle triangles.append( [ int(t[1])-1, int(t[2])-1, int(t[3])-1 ] ) elif len(t) == 5: # quad quads.append( [ int(t[1])-1, int(t[2])-1, int(t[3])-1, int(t[4])-1 ] ) np_points = numpy.ndarray((len(points), 3), dtype=float) np_triangles = numpy.ndarray((len(triangles), 3), dtype=int) np_quads = numpy.ndarray((len(quads), 4), dtype=int) for i in range(0, len(points)): np_points[i] = points[i] for i in range(0, len(triangles)): np_triangles[i] = triangles[i] for i in range(0, len(quads)): np_quads[i] = quads[i] xform = vdb.createLinearTransform(voxelSize=0.5) grid = vdb.FloatGrid.createLevelSetFromPolygons(np_points, np_triangles, np_quads, transform=xform) grid.name = 'surface' print 'name:', grid.name, ' class:', grid.gridClass, ' background value:', grid.background, ' voxel size:', grid.transform.voxelSize()[0], ' active voxels:', grid.activeVoxelCount() vdb.write('/tmp/foo.vdb', grid)
Technical Discussion » Ray intersection with VDB?
- jbudsberg
- 92 posts
- Offline
depending on your use case, you shouldn't need to do a real trace. consider taking the vector rejection of the voxel vector (voxel center to ray position) and ray vector. if the vector "rejection" length is less than the voxel size you have a hit. if you need the hits sorted, sort by the vector "projection" length.
EDIT: ack! I have the group backwards in my GIF, but you get the idea. note if you have a transform on the VDB, you can invert both the VDB and ray vector by the VDB xform. Then your VDB is axis-aligned so the point XYZ positions are equal to the voxel_ijk.
EDIT: ack! I have the group backwards in my GIF, but you get the idea. note if you have a transform on the VDB, you can invert both the VDB and ray vector by the VDB xform. Then your VDB is axis-aligned so the point XYZ positions are equal to the voxel_ijk.
Edited by jbudsberg - July 12, 2023 18:26:45
Solaris and Karma » Per-instance displayColor with PointInstancer
- jbudsberg
- 92 posts
- Offline
Hi all! I'm investigating some ideas to manipulate PointInstancers with AttributeWrangle and I would love some UI feedback in the 3DV.
Is there a way to set v@primvars:displayColor such that it varies per instance? Refer to this trivial example where each instance is assigned a i@primvars:region, then I try to set different displayColor to each region.
Unfortunately, I haven't been able to get it to work--I've tried running over elements (or not), using v@primvars:displayColor (versus usd_setprimvar), etc. Note in the SceneGraphDetails tab I have an array of different displayColor values, the 3DV only seems to respect the first one.
I could dice up my PI with SplitPointInstacers and give each PI its own displayColor, but I would prefer to 1) not cut up my PointInstancers and 2) have more granular per-instance control.
Thanks!
Is there a way to set v@primvars:displayColor such that it varies per instance? Refer to this trivial example where each instance is assigned a i@primvars:region, then I try to set different displayColor to each region.
Unfortunately, I haven't been able to get it to work--I've tried running over elements (or not), using v@primvars:displayColor (versus usd_setprimvar), etc. Note in the SceneGraphDetails tab I have an array of different displayColor values, the 3DV only seems to respect the first one.
I could dice up my PI with SplitPointInstacers and give each PI its own displayColor, but I would prefer to 1) not cut up my PointInstancers and 2) have more granular per-instance control.
Thanks!
Edited by jbudsberg - July 12, 2023 17:47:39
Technical Discussion » is there a way to hide menubar with python or hscript?
- jbudsberg
- 92 posts
- Offline
thanks for the heads up! best I could find so far is this one:
hou.playbar.showRangeSlider(0)
Edited by jbudsberg - April 28, 2023 17:50:49
Technical Discussion » is there a way to hide menubar with python or hscript?
- jbudsberg
- 92 posts
- Offline
On a related note, is there a way to hide the playbar via Python? It's not in the pane list and I can't see to find anything obvious in the API. thanks!
Solaris and Karma » Display selection toggle via Python
- jbudsberg
- 92 posts
- Offline
Solaris and Karma » Display selection toggle via Python
- jbudsberg
- 92 posts
- Offline
hey all, can anyone point me how to toggle the
/stage
"Display selection" icon in the 3DV via Python? I poked around the viewpoint settings methods, but nothing jumped out at me. thanks!pane = hou.ui.curDesktop().paneTabOfType(hou.paneTabType.SceneViewer) settings = pane.curViewport().settings()
Edited by jbudsberg - Jan. 23, 2023 17:07:30
Technical Discussion » QDoubleSpinBox not consistent with hou.ui.stylesheet
- jbudsberg
- 92 posts
- Offline
do you have a ticket number? I just ran into the same issue, but can't find anything regarding QDoubleSpinBox in the search. thanks!
Technical Discussion » Disable QComboBox dropshadow
- jbudsberg
- 92 posts
- Offline
hi all,
I don't like the look of Houdini's QComboBox when it is disabled (left image) and want to disable the white dropshadow.
Does anyone know how to remove it? To adopt Houdini's style, you typically use the following:
style = hou.qt.styleSheet()
self.setStyleSheet(style)
self.setProperty(“houdiniStyle”, True)
I've tried modifying a few things in the stylesheet, but haven't been able to modify that white dropshadow. FYI:
/rel/third_party/houdini/16.5.739_64/houdini/config/Styles/base.qss
I've also seen something like this, but I haven't had any luck there either.
e = QGraphicsDropShadowEffect()
e.setEnabled(False)
e.setBlurRadius(0)
self.repoComboBox.setGraphicsEffect(e)
Any ideas?
thanks!
I don't like the look of Houdini's QComboBox when it is disabled (left image) and want to disable the white dropshadow.
Does anyone know how to remove it? To adopt Houdini's style, you typically use the following:
style = hou.qt.styleSheet()
self.setStyleSheet(style)
self.setProperty(“houdiniStyle”, True)
I've tried modifying a few things in the stylesheet, but haven't been able to modify that white dropshadow. FYI:
/rel/third_party/houdini/16.5.739_64/houdini/config/Styles/base.qss
I've also seen something like this, but I haven't had any luck there either.
e = QGraphicsDropShadowEffect()
e.setEnabled(False)
e.setBlurRadius(0)
self.repoComboBox.setGraphicsEffect(e)
Any ideas?
thanks!
Edited by jbudsberg - Dec. 16, 2019 12:28:55
Technical Discussion » When should use "Distance VDB" or "Fog VDB"?
- jbudsberg
- 92 posts
- Offline
I suggest you spend some time digging into my OpenVDB example HIP file:
https://www.openvdb.org/download/ [www.openvdb.org]
It walks you through many of these concepts in detail, which should give you more information on the different VDB grid types and respective tools.
Jeff
https://www.openvdb.org/download/ [www.openvdb.org]
It walks you through many of these concepts in detail, which should give you more information on the different VDB grid types and respective tools.
Jeff
Technical Discussion » OpenVDB metadata writing in Houdini
- jbudsberg
- 92 posts
- Offline
hey Diego, primitive attributes should be transferred to per-grid metadata. I checked and it seems to work in both the native ROP as well as OpenVDB Write/ExportDriver.
hope that helps!
-Jeff
hope that helps!
-Jeff
% openvdb_print /tmp/foo.vdb -metadata creator: Houdini/SOP_OpenVDB_Write PlatonicSolid float (-12,-12,-12)->(12,12,12) 25x25x25 7.67KVox 2.33MB background: 0.3 voxel size: 0.1 index to world: [0.1, 0, 0, 0] [0, 0.1, 0, 0] [0, 0, 0.1, 0] [0, 0, 0, 1] class: level set custom_float: 42 custom_int: 23 custom_string: bar custom_vetor: [2.5, 1.2, 23.4] file_bbox_max: [12, 12, 12] file_bbox_min: [-12, -12, -12] file_compression: blosc + active values file_mem_bytes: 2554568 file_voxel_count: 7674 is_local_space: false is_saved_as_half_float: false name: PlatonicSolid value_type: float vector_type: invariant
Edited by jbudsberg - June 27, 2019 14:46:13
Technical Discussion » Convert Fogvdb to Polygons
- jbudsberg
- 92 posts
- Offline
To create a mesh set from a fog volume, internally it must first build a level set which requires values on both sides of the interface. Hence, need to increase the “isovalue” to a small value above zero to get a result. make sense?
Edited by jbudsberg - Jan. 4, 2019 20:00:23
Houdini Indie and Apprentice » Deform VDB along "normal" (volume gradient)
- jbudsberg
- 92 posts
- Offline
Hi TheCrisis!
I suspect what you know as a VDB is a “fog volume”, where inside values are positive scalar values and 0 outside (for example density). VDB is not limited to only fog volumes, you can store all sorts of data in the VDB structure.
A level set is a different and very efficient way of describing a surface–it is a signed-distance field that extends from the surface. Voxels inside the surface are negative scalar values describing the distance to the closest point on the surface, while outside voxels are positive (0 at the boundary). Typically, you are only interested in the area near the surface, hence we often only store the first few voxel bands around the surface (the “narrow band”).
You should spend some time looking through my OpenVDB example HIP file; it walks you through many VDB concepts, as well as the tools available in Houdini. I have an entire section devoted to building and manipulating level sets.
http://www.openvdb.org/download [www.openvdb.org] look for “Houdini Examples zip”
-Jeff
I suspect what you know as a VDB is a “fog volume”, where inside values are positive scalar values and 0 outside (for example density). VDB is not limited to only fog volumes, you can store all sorts of data in the VDB structure.
A level set is a different and very efficient way of describing a surface–it is a signed-distance field that extends from the surface. Voxels inside the surface are negative scalar values describing the distance to the closest point on the surface, while outside voxels are positive (0 at the boundary). Typically, you are only interested in the area near the surface, hence we often only store the first few voxel bands around the surface (the “narrow band”).
You should spend some time looking through my OpenVDB example HIP file; it walks you through many VDB concepts, as well as the tools available in Houdini. I have an entire section devoted to building and manipulating level sets.
http://www.openvdb.org/download [www.openvdb.org] look for “Houdini Examples zip”
-Jeff
-
- Quick Links