Toon shaders have exploded in popularity recently, especially amidst the Blender community. Grease Pencil and BEER specifically have been gaining quite a scrap of traction, and scrolling Instagram gives no shortage of blender artists such as Dédouze playing around with these new non-photorealistic rendering (NPR) techniques. Games like Zelda and Genshin Bear on also likely contribute to this growing popularity.

Sadly, I'm not proficient in Blender at the moment, so I can only make express use of the vast majority of these available resources. Information technology seems there is not nearly every bit much resources online for getting the same effects on Houdini. While I could reasonably learn Blender, I thought it would be a good projection to attempt to replicate these in Houdini, as well as potentially being helpful for anyone else interested in the aforementioned matter.

With regards to a target scene, I'1000 especially addicted of Studio Ghibli films, so the scene shown on Figure 1 makes for simple plenty geometry for a good test subject.

Figure 1

Figure i: Scene from My Neighbour Totoro, Studio Ghibli.

Water Shader

In this post, I'll exist focusing on an animated water effect. This involves a (nearly) static shoreline cream and ripples radiating outward from it that gradually disappear. These is quite a lot of blender tutorials for this, but none (that I've establish) in Houdini. As an additional notation, I'm implementing this as a fabric shader in Octane, though porting the aforementioned ideas to Mantra's material shader should be adequately simple.

Measuring Distance to Shoreline

Before we get to the material shader, nosotros demand to first figure out a altitude betwixt any signal on the water to its nearest shoreline betoken. This is required so that we can attune where the cream is placed. Some blender tutorials seem to place cream depending on the raycasted depth, so that this unabridged procedure tin be done in-shader, merely I thought that we can leverage Houdini'southward built in tools to actually have a proper distance measurement.

Figure 2

Figure ii: Measuring distance to closest point.

Finding the required distance is easy given Houdini'due south distance from geometry SOP. We desire to use this distance SOP on the flat water plane itself, so all we actually need to practice is to set our collision geometry (the ground and the rocks), then use a grouping create on the water plane, selecting grouping based on an input bounding object. This selects all points on the water airplane that intersects with our collision geometry.

Figure 3

Figure 3: Points on the h2o airplane intersecting with the collision geometry.

At this bespeak, nosotros simply apply the distance from geometry SOP, selecting the created grouping equally the reference. The rest of the nodes are for cleanup, attribute remap normalizes the output distances to [0,1] and attribute mistiness removes artifacts due to depression grid resolution.

Animated Ripples

The bones idea of doing blithe ripples is taking reward of our precomputed distance metric and applying a bit of math to move a sine moving ridge outwards over fourth dimension.

Figure 4

Effigy 4: Points on the water airplane intersecting with the collision geometry.

Shown above is the overall network. We start off with out initial altitude metric. Notice that this is simply a linear gradient ramp from black to white.

Figure 5

Figure 5: Distance metric.

Nosotros use a gradient ramp with an input parameter to control how far in the ripples reach. Note that I used a decent amount of input parameters to control diverse properties of the ripples. Theoretically you tin can get abroad with a much more minimal network but this network made the most sense to me based on the math's order of operations.

Figure 6

Effigy vi: Remapped distance metric.

Next, we add together a fourth dimension parameter and throw information technology into a sine function. Note that this sine is rotated to be constant in the xz plane. At this point, we will have a function that is effectively \(\sin{(d+t)}\), which achieves the bones effect of waves that progressively move outwards from the shoreline. Note that we do need to take the fourth dimension modulo 1 in order to become repeating waves.

Figure 7

Figure 7: Sine modulated by time and the altitude to the shoreline.

The remainder of the nodes are for tweaking the await of the moving ridge. As can exist seen above, the current expect is not all too appealing, so we add together in a ramp to command the foam thickness, as well as multiply the result by the initial distance to force information technology to fade out every bit it reaches the middle.

Figure 8

Effigy 8: Moving ridge with controlled thickness and fade out at distance.

Side by side, we want the wave to break up into pieces rather than fade every bit a whole band. To achieve this, nosotros multiply in a Perlin noise, which is also animated over time to give a random breakdown for each ripple.

Figure 9

Figure 9: Perlin noise to modulate the breaking of each ripple.

Multiplying this dissonance into our existing ripple and using a final ramp to adjust the threshold for what is considered part of the ripple and what is not gives the final ripple effect.

Figure 10

Figure 10: Concluding animated ripple.

Animated Shoreline

Doing the shoreline more straightforward and uses a lot of the same nodes. Instead of animating a sine moving ridge, we just use the distance itself, use a ramp to control how wide the shoreline foam is, another ramp to animate the foam thickness over time to accomplish a rising and falling consequence

Figure 11

Figure 11: Network for animative a shoreline foam.

Figure 12

Effigy 12: Final animated shoreline.

Combining Everything

At this point, we merely add the two effects together, then apply a material mix node, using the ripple itself every bit a mask, to combine a white toon material for the foam and a blue toon textile for the water itself.

Figure 13

Effigy 13: Mixing materials together.

Figure 14

Figure xiv: Last toon shader.

Et voilĂ . You lot can additionally add in a reflection by mixing in a specular Octane material on summit of the toon material.

A download of this animated ripple shader can be institute on the sidebar. Just a reminder that this is implemented in Octane, so it won't open properly unless you take the Octane plugins installed (this does work perfectly fine with the demo version of Octane).

I'll be doing more exploration of shaders to go closer to the Studio Ghibli style, and hopefully I'll be able to get dainty enough results to be able to post about it hither again. I'thou currently working on the grass, a working case of which is visible in the teaser moving picture at the acme. I'yard not quite happy with the manner information technology renders so I'll withal be working on it for a fleck.