Render an Image You'll be Rendered Awesome
Looking for the Houdini 15 Tutorial?
Follow the link here.
Before You Begin
- Set up Houdini using the Getting Started page.
- Download the pre-formatted VDB volume of the Isolated
Galaxy sample data set from the
RIGHT HERE.
(Source: yt repository, linked on the Download page.)
Tutorial Outline
This tutorial will take you through the steps to load a VDB volume, modify an exsisting shader to add colors based on the data's density, and render an image to the screen.
If you are already familiar with loading data and shaders in Houdini, a HIP file with the modified shader pre-installed is listed as the "isolatedvolume_shader.hiplc" file on the Houdini Files and Scripts page.
- Overview of Houdini's Windows
- Load VDB Volumetric Data
- Load Pre-Built Volume Shader
- Assign Pre-Built Shader to Volume
- Modify Shader Settings
- Add a Color Scheme and Save a Render
NOTE: many steps have been simplified but can be expanded by clicking on the "Give Me More Information" links at the bottom of each step.
Houdini's Windows
If you now open Houdini (or Houdini Apprentice), you will see a lot of buttons and windows. The main windows you'll see are:
- Scene View: Where all your models and data will appear, along with cameras
and other scene objects.
- Network View: Where all your models, data, cameras, etc will appear as nodes,
which you can wire together to create dependencies.
- Parameters: Once you have an object selected, you can manipulate several
properties of each object. Some options include position and color.
Load the Volumetric Data
- Download the IsolatedGalaxy.vdb file if you have not already
- Import a geometry node within the Network View window
- Double click on the Geometry Node to access its inner file structure
- Replace the default "file1" "Geometry File" within the Geometry Node with the location of your IsolatedGalaxy VDB.
Houdini accepts several graphics data formats natively, including .vdb, .geo, .bgeo, .json, .pdb, and .obj. We will be importing a .vdb volume object. Again, make sure you have downloaded the IsolatedGalaxy.vdb file.
Step 1: Put your mouse over the Network View window and press the TAB key on your keyboard. This will bring up the TAB Menu.
Start typing "geometry" and the Geometry menu option will appear.
Step 2: Press the Enter key on your keyboard or click on the Geometry menu option to select it, and then press Enter or click once again, to place the Geometry node down in the Network View window.
This will also create a box in your Scene View, which is a default filler geometry that Houdini creates for you.
Note that not only does a Geometry Node appear in the Network View, but a dialog box appears in the Parameters Panel as well.
Step 3: Press Enter or double-click on the "geo1" node to step inside it.
You will see a node named "file1".
Step 4: In the Parameters window, locate the "Geometry File" parameter, and type in the path to the IsolatedGalaxy.vdb file on your computer, or select the button to the right of the text area to open a file browser.
Step 5: Place your mouse cursor over the Scene View window and press the "g" key on your keyboard to frame the view.
Load Pre-Built Shader
Before you start, make sure you have downloaded the sample_shader_h16.hdanc file.
- Install this pre-built shader by navigating to the Menu bar, and click on File -> Import -> Houdini Digital Asset.
- Type in or navigate to the path of your installed sample_shader_h16.hdanc file in the "Digital Asset Library" text field, and select "Install and Create".
This will have taken you to away from the "obj" (object) Network View, and inte the "shop" (shader operator) Network View. You should now see a node called "sample_shader1".
Again, make sure you have downloaded the sample_shader_h16.hdanc file.
Step 1: In the Menu bar, navigate to File -> Import -> Houdini Digital Asset.
Step 2: Type in or navigate to the path of your installed sample_shader_h16.hdanc file in the "Digital Asset Library" text field, and select "Install and Create".
This will have taken you to away from the "obj" (object) Network View, and inte the "shop" (shader operator) Network View.
You should now see a node called "sample_shader1".
Assign Shader to Volume Object
- Return to the object view by clicking on "shop" in the Network View, and selecting "obj" in the menu that appears.
- Select the "Render" tab in the Parameters window, and click on the selector button next to the text field.
- Navigate to and select the "sample_shader1" shader, and click "Accept".
- Select the "Render View" tab above the Scene View window and hit "Render" to render an image to the view port.
Step 1: To assign this shader to our data object, we need to return to the object view.
Do this by clicking on "shop" in the Network View, and selecting "obj" in the menu that appears.
Step 2: Select the "Render" tab in the Parameters window, and click on the selector button next to the text field.
This will open up a tree view of your material(s)/shader(s). Navigate to and select the "sample_shader1" shader, and click "Accept".
Step 3: Do a test render by selecting the "Render View" tab above the Scene View window and hitting the "Render" button.
Modify the Shader Settings
- Return to the shop view by clicking on "obj" in the Network View, and selecting "shop" in the menu that appears.
- To remap the shader min and max to the data min and max (0 and 1, repectively), enter 0 in the "Min Data Value" field, and 1 in the "Max Data Value" field.
- Remove the diffuse component of the volume's color by setting "Smoke Intensity" to zero, and unchecking "Use Smoke Color" and "Use Point Color" in the Parameters view.
- Set the background to black by setting "Smoke Color" to black by entering 0, 0, 0, as the R, G, B values repectively.
- Render only high density values by moving the lower box on the "Density Ramp" graph of the Parameters window to x=0.2 or so.
- Select the "Render View" tab above the Scene View window and hit "Render" to render an image to the view port.
Step 1:To return to the shop Newtork View, select "obj" and then "shop" in the dropdown menu.
Now let's mess with some values in the Parameters window.
Step 2: The range of values in this Isolated Galaxy data set is 0-1, so enter 0 in the "Min Data Value" field, and 1 in the "Max Data Value" field.
Since our data is self-luminescent, we want to do is to remove the diffuse component of the volume's color.
Step 3: Set "Smoke Intensity" to 0, uncheck "Use Smoke Color" and "Use Point Color", and set "Smoke Color" to black by entering 0 0 0 as the R G B values.
To see structure in our data, we want to only look at higher densities, instead of both low and high densities which simply show the entire volume as a white cube.
Step 4: Scroll down in the Parameters window until you see the "Density Ramp" graph. To begin with, there is a straight line going from 0 at one end, to 1 at the other end. Click on the graph at around x=0.2 to create another point with a value of 0.
You can click and drag to move this around, or you can type in an exact value below the graph. Now we are actually able to see something!
Add a Color Scheme and Save Render
Now that we have set the opacity as we like it, let's add some color. Here, you will see that the "Temperature Field" is set to "temperature" by default. If our data had multiple variables, we could use one to drive the opacity, and another to drive the color; but in this example, we only have one. So, set the "Temperature Field" to "density".
- In the Parameters window, switch to the "Temperature" tab
- Set the "Temperature Field" to "density".
- Double-click on the "Map Temperature to Emission Color" area to create new points with color on this color map. You can move them around or edit them as you like.
Feel free to go back to the "Density" tab and modify the opacity ramp as well.
Try playing with other values in both the Density and Temperature tabs.
To save your rendering, right-click on the image in the Render View and select "Save Frame...".
Step 1: In the Parameters window, switch to the "Temperature" tab. Here, you will see that the "Temperature Field" is set to "temperature" by default. If our data had multiple variables, we could use one to drive the opacity, and another to drive the color; but in this example, we only have one. So, set the "Temperature Field" to "density".
Step 2: Now, double-click on the "Map Temperature to Emission Color" area to create new points with color on this color map. You can move them around or edit them as you like.
That Was Easy! Now Let's Complicate Things...
We provided you with downloadable files in order to skip a few important steps, and we glossed over a few important concepts. To learn more, come back later to check out these tutorials: