This article is based on the video:
Welcome to a mini sample of what’s to come on the Gamelogic YouTube channel, where we share useful game development techniques. I’m Herman from Gamelogic, and today we’re diving into a shader technique for creating fur effects in games.
[Image: Spheres covered with various fur types]
Introduction
This fur effect technique dates back to 2001—and while modern hardware now offers many alternatives, what I love about this method is its clever use of illusion. Instead of modeling each individual hair strand, we create the appearance of fur by rendering multiple cross-sections in layers. Think of it like those intricate paper sculptures made of thousands of overlapping sheets; here, the layers come together to form continuous strands.
[Image: Sculpture made from layered paper sheets]
This tutorial uses Unity, but the technique is adaptable to any 3D game engine. So, let’s break down the magic behind shell texturing.
How It Works
The Basics: Setting Up the Shader
We start with a simple quad. Our shader requires two key textures:
- Main Texture: Defines the fur color.
- Alpha Texture: Defines the shape of each strand’s cross-section.
This setup allows us to control the visual style of the fur from the start.
[Image: Material setup showing albedo and alpha textures]
Creating the Illusion of Fur
Layering: The shader automatically creates layers of our quad. Each layer is displaced by a parameter we call “length control,” which determines how long and dense the fur appears.
[Image: Quad with layered cross-sections and a length slider being manipulated]
Strand Tapering: To achieve natural-looking fur, we need each strand to taper. Using a gradient in our alpha texture, we let the strands fade toward the edges. Adjusting a thickness cutoff slider allows us to fine-tune the appearance at different points along the strand.
[Image: Comparison of fur strand before and after adjusting thickness cutoff]
Dynamic Tapering Based on Layer Depth:
Here’s where things get interesting. By linking the cutoff threshold to the layer depth, higher layers (closer to the tip) use lower cutoff values, resulting in thinner strands. A dedicated slider controls exactly where this tapering begins.
[Image: Visual comparison showing tapering across layers]
Adding Natural Flow:
Real fur isn’t perfectly straight. By offsetting vertices to the side—and scaling that offset based on layer height—we can add subtle bends to each strand, giving them a natural flow.
[Image: Animation frame showing vertex offset creating a slight bend]
Fine-Tuning Strand Placement
Once the basic strand is working, it’s time to see how the arrangement affects the overall fur effect.
Regular Grid: Arranging strands in a regular grid can look too mechanical and unnatural.
[Image: Grid pattern of fur strands, looking too uniform]
Random Placement: Random positioning improves the look, but can sometimes feel a bit chaotic.
[Image: Fur strands with completely random positioning]
Poisson Disk Distribution: This method strikes a balance—it’s random yet evenly spaced, resulting in a natural-looking distribution.
[Image: Fur strands arranged using a Poisson disk distribution for even coverage]
Changing the main texture and various properties lets you mimic fur from different animals—or even create entirely different materials like coral textures.
Expanding Possibilities
This basic shell texturing technique is incredibly versatile. Here are a few enhancements you might consider:
- Color Variation: Add subtle color shifts along each strand.
- Wind Animations: Animate the layers to simulate wind blowing through the fur.
- 3D Textures: For even more complex effects, try using 3D textures.
[Image: Examples of fur effects with color variations, wind animations, and 3D textures]
Considerations and Limitations
While this technique is powerful, it does have some limitations. Since it relies on transparency, interactions with other transparent objects can sometimes produce unexpected results. Check out the notes for links to techniques that address these issues.
Final Thoughts
And that’s it! Now that you know how shell texturing creates realistic fur effects through layered illusions, it’s your turn to experiment. Use this technique in your projects, tweak the parameters, and share your results—I’d love to see what you create.
Resources
Want to go further? Check out these resources:
- The original paper: Real-time fur over arbitrary surfaces (2001) by Jed Lengyel, Emil Praun, Adam Finkelstein, and Hugues Hoppe. https://hhoppe.com/proj/fur/
- Unity 2021 Shaders and Effects Cookbook (4th ed. 2021, p366-374) by John P. Doran.
- Real-time rendering of fur (thesis, 2004) by Gary Sheppard.
👍 If you find this helpful, remember to like, subscribe, and click the notification bell for more game development content from Gamelogic!