Learn about determining Bifrost channel data ranges.
- [Instructor] To begin the chapter on shading, let's visualize Bifrost channel data as particle color. This will make it easy for us to determine the range of values for the various channels, such as velocity in churn. We need that information to effectively use channel data in a shading network. I've got to scene here that has a BIF simulation cache. I'm going to advance it into the simulation range to frame 120 That may take a moment to load in.
Once it does, we can see that the particles are displayed in blue and white. And by default, that color is mapped to Velocity. Let's select the liquid shape node from the Outliner. And in the Attribute Editor under Particle Display, we've got color. And that is the enable switch for particle color. We can disable it and deselect the shape node. And the particles are displayed in the standard wire frame color of dark blue.
I'll reselect the shape node back in the attributes, re-enable color, and we see the Color Channel has a pull down list. It's assigned to Velocity by default. If we change it to something else, like density or churn, we may not see good results. It may turn solid white or solid blue. The reason is that the color depends not just upon this setting here, but upon the settings within this section labeled Color Channel Remap.
Open that up, cuz that's easy to miss. In this section, we have total control over the mapping of channel data to particle color. Before we start playing with this, we need to understand the signal flow or order of operations. First, the incoming values are captured within a range that we specify with Color Channel Min and Max up at the top. That data is normalized from zero to one, and then sent to the function graph at the bottom.
Finally, the output of that function graph is mapped to the position on the color gradient in the middle. So the signal flow, is input range, function graph, and color gradient. Color Channel Min and Max values establish the boundaries for sampling and normalizing the data. It's just like the input Min and Max values on a standard Maya shading node. We set the min and max values, so that we don't clip off any of the available data.
And then the range of values we specify gets normalized and mapped to a range of zero to one. And then the function graph down here, multiplies that normalized data. If you leave the function graph at its default linear graph of zero to one, then it passes the data through transparently at unity gain. Finally the output of that function graph goes to the color gradient in the middle. And so that we can see this better, I'll set the Color Channel back to Velocity.
I also like to change the interpolation type for this left hand flag or color swatch. I want to change that to an interpolation type of linear, so that I'm not introducing any nonlinear color transitions into the data. You can change the RGB values, if you need to, to get better contrast to visualize the data. Maybe the slowest particles can have a color of bright green, and the fastest particles on the right a color of bright red.
Different Bifrost data channels, have different ranges. If you want to use the channel data in a shading network, you'll need to know the value range of the data. You can adjust the Color Channel Min and Max values until you see particles from every color of the gradient with no clipping. Let's try it. Set the Color Channel to droplet. Leave Color Channel Min at zero, and set Color Channel Max to value of one and press enter.
Now we see the droplets score mapped onto particle color. So this is an example of a value range, from zero to one. We can choose to set the input Min and Max to other values to achieve different visual results, and perhaps isolate different sections of the fluid. I'll set Color Channel up here to churn. And then set the Color Channel Max to a value of two.
And now only the areas with the greatest amount of churn are going to be displayed in red. Now I can experiment and play around, trying to find an ideal range for this channel, if it were to be used in a shading network. Maybe I'll bring Color Channel Max down to 1.5. Now I've isolated just the areas with the greatest amount of churn. Some channels can have positive or negative values, such as curvature. Let's try that.
Curvature, set the Color Channel Min to negative one and Color Channel Max to positive one. Maybe I want to change the data range, in order to isolate those highly curved areas. Set the Color Channel Max to 2.5. At a value of 2.5, none of my particles are showing up as bright red. So that tells me, I'm not using the range very well. So maybe I'll bring this down to two, and that looks like a good range for the curvature.
We should also look at representative frames of the simulation. I'll set the current time to frame 180, or perhaps the very end of the simulation on frame 360. Take notes of your findings with the ideal values for Color Channel Min and Max, so you'll know what ranges to use in a shading network later. The Color Channel Remap settings are very helpful, and that's how to use them to determine channel data value ranges.
- Bifröst basics
- Analyzing the node structure
- Emitting from a polygon mesh
- Colliding with a polygon mesh
- Adding velocity, friction, and drag with motion fields
- Optimizing space and time accuracy
- Caching simulations
- Meshing and exporting liquids
- Render-time meshing in Arnold
- Applying channel data to Arnold shaders
- Generating foam from a liquid
- Rendering and shading foam in Arnold