Skip to content

Commit

Permalink
[UPDATE] *VolumeTexture* now has the ability to export Density, Color…
Browse files Browse the repository at this point in the history
… and SDFs.
  • Loading branch information
Ambrosiussen committed Feb 16, 2022
1 parent 548c63e commit 0c2f89a
Show file tree
Hide file tree
Showing 21 changed files with 7,882 additions and 0 deletions.
87 changes: 87 additions & 0 deletions help/nodes/sop/labs--volume_texture-1.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
= Labs VolumeTexture Export =

#type: node
#context: sop
#internal: labs::volume_texture::1.0
#icon: volume_texture
#tags: sidefxlabs, gamedev, volumes

""" Take a volume as an input and export a texture of the density field. """

The Volume Texture Export is useful for converting volumes into textures that can be used in a realtime engine. Instead of creating a custom 3D texture, this outputs a 2D texture that can be read by all engines and then processed to be used as volumetric data at realtime.

Use the dropdown presets to match UE4's expected volume texture inputs.

Internally the volume is converted to the target output resolution. That means one voxel equals one pixel and the resulting volume is a cube.

NOTE:
When exporting Density, make sure you are using a Fog VDB.

When exporting SDF, make sure you are using a Distance VDB.

When exporting Color, make sure you have a volume named `Cd`.

@parameters

Render:
#id: render
Generate the texture.
Valid Frame Range:
#id: trange
Use the dropdown to render a single frame or a sequence.

Start/End/Inc:
#id: f
Start and End Frame as well as how many increments in between.
Mode:
#id: mode
Select the mode which should be used for exporting the VolumeTexture.

Density:
Density will simply export the density values from your volume into a texture. All RGB values will have the same value.
SDF:
SDF will export your SDF as a texture, either raw or remapped to 0-1.
Color:
Color will export a volume named `Cd` to RGB, and optionally the `density` volume to A.
Equalize Range:
#id: equalizedensity
When turned on this will remap the `density` values to exactly 0-1 range.
Density in Alpha:
#id: densityalpha
When turned on this will export the `density` volume in the A channel when mode is set to Color.
Invert Density:
#id: invertdensity
When turned on this will flip the values used for exporting density.
Remap:
#id: remap
When mode is set to SDF this will enable remapping of values to 0-1. Use the `SDF Range` parameter to set the min and max values for the remap.
SDF Range:
#id: sdfrange
Set the range from which your SDF should be remapped to 0-1.
== Sampling ==

Up Axis:
#id: up_axis
By default, the texture is exported with Z up to match UE4.
Frame Frozen:
#id: frozenframe
Optionally lets you export a specific frame in your framerange.
Frame:
#id: frame
Sets the frame that should be exported.
== Slicing ==

Slices:
#id: slices
Sets the total number of slices that should be generated.
Resolution per Slice:
#id: frameresolution
Sets the desired resolution per slice.
== Output ==

Preview:
#id: preview
Generate a preview of the texture in the viewport.
Output Picture:
#id: output_picture
Path of exported image.
Binary file modified hip/volume_texture_demoscene.hip
Binary file not shown.
14 changes: 14 additions & 0 deletions otls/volume_texture.1.0.hda/INDEX__SECTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Operator: labs::volume_texture::1.0
Label: Labs VolumeTexture Export
Path: oplib:/labs::Sop/volume_texture::1.0?labs::Sop/volume_texture::1.0
Icon: opdef:/labs::Sop/volume_texture::1.0?IconSVG
Table: Sop
License:
Extra:
User:
Inputs: 1 to 1
Subnet: true
Python: false
Empty: false
Modified: Wed Feb 16 15:46:46 2022

4 changes: 4 additions & 0 deletions otls/volume_texture.1.0.hda/Sections.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
""
INDEX__SECTION INDEX_SECTION
houdini.hdalibrary houdini.hdalibrary
labs_8_8Sop_1volume__texture_8_81.0 labs::Sop/volume_texture::1.0
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"hdaroot/volumemix6.def":1566597070,
"hdaroot/merge2.def":1644855560,
"hdaroot/volume_mask3.def":1566510625,
"hdaroot/volume_mask2.def":1566510625,
"hdaroot/volume_mask1.def":1566510625,
"hdaroot/volumemix5.def":1566597070,
"hdaroot/volumemix3.def":1566597070,
"hdaroot/convertvdb4.def":1566509483,
"hdaroot/merge4.def":1644857595,
"hdaroot/volumebound2.def":1566596944,
"hdaroot/convertvdb3.def":1566509483,
"hdaroot/switch2.def":1644853450,
"hdaroot/volume2.def":1566597008,
"hdaroot/volume1.def":1566597008,
"hdaroot/volumebound1.def":1566596944,
"hdaroot/convertvdb2.def":1566509483,
"hdaroot/VOLUMEOUT.def":1510873723,
"hdaroot/volumemix2.def":1566597070,
"hdaroot/cop2net1/switch2.def":1645014818,
"hdaroot/cop2net1/channelcopy2.def":1644858069,
"hdaroot/cop2net1/sopimport6.def":1566510203,
"hdaroot/cop2net1/color1.def":1644856140,
"hdaroot/box1.def":1645017677,
"hdaroot/cop2net1/sopimport5.def":1566510203,
"hdaroot/volume3.def":1566597008,
"hdaroot/cop2net1/sopimport3.def":1566510203,
"hdaroot/cop2net1/delete1.def":1566511478,
"hdaroot/merge3.def":1644855621,
"hdaroot/cop2net1/sopimport2.def":1566510203,
"hdaroot/cop2net1/rop_comp1.def":1510874581,
"hdaroot/2D_OUT.def":1566591595,
"hdaroot/attribwrangle1.def":1644855881,
"hdaroot/cop2net1/switch3.def":1645014868,
"hdaroot/merge1.def":1566510874,
"hdaroot/cop2net1/channelcopy1.def":1566511467,
"hdaroot/volume_height.def":1566510625,
"hdaroot/volume_mask.def":1566510625,
"hdaroot/cop2net1/sopimport4.def":1566510203,
"hdaroot/switch1.def":1565122558,
"hdaroot/cop2net1/OUT.def":1644854715,
"hdaroot/timeshift1.def":1565122410,
"hdaroot/volumewrangle1.def":1644850066,
"hdaroot/switch_preview.def":1510877369,
"hdaroot/cop2net1/vopcop2filter2/output1.def":1644856208,
"hdaroot/volume4.def":1566597008,
"hdaroot/cop2net1/vopcop2filter1/copinput2.def":1644856266,
"hdaroot/volumemix4.def":1566597070,
"hdaroot/cop2net1/vopcop2filter1/copinput1.def":1644856266,
"hdaroot/cop2net1/vopcop2filter2/copinput1.def":1644856266,
"hdaroot/cop2net1/vopcop2filter2/global1.def":1644856208,
"hdaroot/cop2net1/vopcop2filter1/output1.def":1644856208,
"hdaroot/volumebound3.def":1566596944,
"hdaroot/volumemix1.def":1566597070,
"hdaroot/cop2net1/vopcop2filter1.def":1644856208,
"hdaroot/cop2net1/__netbox3.netboxinit":1645014934,
"hdaroot/cop2net1/vopcop2filter2.def":1644856208,
"hdaroot/volumevisualization1.def":1467988806,
"hdaroot/cop2net1/__netbox2.netboxinit":1645014928,
"hdaroot/output1.def":1510874672,
"hdaroot/cop2net1/vopcop2filter1/global1.def":1644856208,
"hdaroot/cop2net1/switch1.def":1644854680,
"hdaroot/cop2net1/__netbox1.netboxinit":1645014921,
"hdaroot/object_merge1.def":1566512119,
"hdaroot/cop2net1.def":1510873355,
"hdaroot/__netbox4.netboxinit":1510877625,
"hdaroot/__netbox3.netboxinit":1510877625,
"hdaroot/__netbox2.netboxinit":1510877652,
"hdaroot/switch3.def":1644855578,
"hdaroot/__netbox1.netboxinit":1510877625,
"hdaroot/IN.def":1494882769,
"hdaroot/cop2net1/equalize2.def":1510879461,
"hdaroot.def":1644933967
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"values":["0.4","19.0.529"
],
"indexes":{
"hdaroot/box1.userdata":1,
"hdaroot/volumemix6.userdata":1,
"hdaroot/volume4.userdata":1,
"hdaroot/volume_mask3.userdata":1,
"hdaroot/volume_mask2.userdata":1,
"hdaroot/merge3.userdata":1,
"hdaroot/volume_mask1.userdata":1,
"hdaroot/merge2.userdata":1,
"hdaroot/volumemix4.userdata":1,
"hdaroot/volumebound3.userdata":1,
"hdaroot/volume2.userdata":1,
"hdaroot/VOLUMEOUT.userdata":1,
"hdaroot/cop2net1/switch2.userdata":1,
"hdaroot/volumemix2.userdata":1,
"hdaroot/cop2net1/channelcopy2.userdata":1,
"hdaroot/volumebound2.userdata":1,
"hdaroot/merge4.userdata":1,
"hdaroot/cop2net1/color1.userdata":1,
"hdaroot/cop2net1/sopimport6.userdata":1,
"hdaroot/cop2net1/sopimport4.userdata":1,
"hdaroot/cop2net1/equalize2.userdata":1,
"hdaroot/volumemix1.userdata":1,
"hdaroot/cop2net1/delete1.userdata":1,
"hdaroot/cop2net1/sopimport2.userdata":1,
"hdaroot/cop2net1/channelcopy1.userdata":1,
"hdaroot/merge1.userdata":1,
"hdaroot/volume_height.userdata":1,
"hdaroot/cop2net1/sopimport3.userdata":1,
"hdaroot/cop2net1/sopimport5.userdata":1,
"hdaroot/convertvdb3.userdata":1,
"hdaroot/switch1.userdata":1,
"hdaroot/volumemix5.userdata":1,
"hdaroot/cop2net1/vopcop2filter2.userdata":1,
"hdaroot/switch2.userdata":1,
"hdaroot/switch_preview.userdata":1,
"hdaroot/IN.userdata":1,
"hdaroot/volume3.userdata":1,
"hdaroot/cop2net1/vopcop2filter1/output1.userdata":1,
"hdaroot/convertvdb4.userdata":1,
"hdaroot/cop2net1/rop_comp1.userdata":1,
"hdaroot/volumemix3.userdata":1,
"hdaroot/volumebound1.userdata":1,
"hdaroot/cop2net1/switch3.userdata":1,
"hdaroot/cop2net1/vopcop2filter2/global1.userdata":1,
"hdaroot/2D_OUT.userdata":1,
"hdaroot/switch3.userdata":1,
"hdaroot/cop2net1/vopcop2filter1/global1.userdata":1,
"hdaroot/convertvdb2.userdata":1,
"hdaroot/cop2net1/switch1.userdata":1,
"hdaroot/volume1.userdata":1,
"hdaroot/cop2net1.userdata":1,
"hdaroot/object_merge1.userdata":1,
"hdaroot/volume_mask.userdata":1,
"hdaroot/timeshift1.userdata":1,
"hdaroot/cop2net1/vopcop2filter2/output1.userdata":1,
"hdaroot/cop2net1/OUT.userdata":1,
"hdaroot/cop2net1/vopcop2filter1.userdata":1,
"hdaroot/volumevisualization1.userdata":1,
"hdaroot.userdata":0,
"hdaroot/output1.userdata":1
}
}
Loading

0 comments on commit 0c2f89a

Please sign in to comment.