threejs-shell-fur-rendering
Skill4 starsChanged 17 days agoMITView on GitHub
Grows real-time fur on a character in three.js with shell rendering — one watertight sculpted body mesh whose COLOR_0 RGBA carries painted albedo and per-vertex fur length, drawn again as a single InstancedMesh of shells indexed by gl_InstanceID, pushed along the normal with gravity droop and wind, strands cut from jittered 3D rest-space cells that taper to the tip, coat darkened toward the skin, distance-based shell LOD, no shell shadows. Use when a creature, plush toy, mascot or animal needs fur, hair, fuzz, moss or grass-like coats in WebGL/R3F, or when a GLB can't carry hair.
In this repository30 other files it gives its agents.
- threejs-blender-glb-pipelineSkill
- threejs-boat-buoyancy-steeringSkill
- threejs-camera-guided-tourSkill
- threejs-cinematic-loading-screenSkill
- threejs-day-cycle-lightingSkill
- threejs-dreamy-glass-hudSkill
- threejs-first-person-bvh-walkSkill
- threejs-fish-school-boidsSkill
- threejs-floating-island-landmarkSkill
- threejs-ghibli-night-modeSkill
- threejs-ghibli-sky-cloudsSkill
- threejs-ghibli-toon-shadingSkill
- threejs-glb-realism-pipelineSkill
- threejs-gpu-butterfliesSkill
- threejs-headless-visual-verificationSkill
- threejs-hud-objective-markersSkill
- threejs-night-lights-lanternsSkill
- threejs-object-interactionSkill
- threejs-open-world-streamingSkill
- threejs-postprocessing-anime-gradeSkill
- threejs-procedural-vegetationSkill
- threejs-skeletonless-character-animationSkill
- threejs-stylized-rock-materialSkill
- threejs-webaudio-generative-soundtrackSkill
- threejs-webgl-performance-profilingSkill
- threejs-webgl-rain-effectSkill
- threejs-webgl-realistic-waterSkill
- threejs-webgl-underwater-effectSkill
- threejs-webgl-wake-simulationSkill
- threejs-webgl-waterfall-effectSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 65
If the character deforms in the vertex shader (head turn, blink, breathing), the fur material must run the same pose function before the …
- Distinctive: line 78
Markings painted close together: read as one zigzag once the fur blurs them.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Shell fur rendering
Produces a soft, readable fur coat on a stylised character (a big furry forest creature, a cat, a plush toy) at a cost that scales with distance. The body is one sculpted mesh; the fur is that same geometry drawn N more times as one instanced draw call, each shell a little further out, discarding everything outside a strand.
Stack: three.js WebGLRenderer (WebGL2 for gl_InstanceID), MeshStandardMaterial patched
with onBeforeCompile. Mesh from headless Blender. Vanilla or R3F.
When to use
- A character needs fur and a GLB can't carry hair cards/strands.
- A furry model looks like smooth plastic, or fur costs too much far away.
- Markings on a furry body blur into a single smear.
Paste-ready prompt
Recraft
{{character}}realistically: one watertight sculpted body mesh with COLOR_0 RGBA (RGB = painted albedo including markings, A = fur length), then grow the fur in three.js with shell rendering.
- Draw the shells as one
InstancedMeshof the body geometry, withgl_InstanceID/shellsas the layer. Push each shell alongobjectNormal × layer × length × color.a, add a little gravity droop and wind, and discard outside jittered 3D cells in rest space (no UV dependence). Strands taper asr = .55(1 − layer), and the colour is darkened deep in the coat (mix(.62, 1.12, layer)).- Choose the shell count by camera distance (24/14/6/3/0) and don't let the shells cast shadows.
- Paint markings as separate shapes with gaps.
- Eyes: a transparent clearcoat physical material, not a transmissive cornea. Verify close-up, at mid distance and far, and parse the GLB to confirm COLOR_0 is VEC4.
Implementation
Asset (Blender)
- One watertight body mesh (no separate floating parts under the coat); eyes, claws, nose as separate meshes/materials without fur.
- COLOR_0 as RGBA: RGB = painted albedo including markings, A = fur length (long on the back, short on the face and palms, 0 where the eyes sit).
- Export with
export_vertex_color='ACTIVE'. Blender's glTF exporter drops vertex-colour alpha by default ('MATERIAL'gives VEC3). Parse the GLB JSON and confirm the accessor isVEC4. - Paint markings (chevrons on a belly, stripes) as separate shapes with clear gaps between them.
Shells (references/shell-fur.js)
InstancedMesh(bodyGeometry, furMaterial, SHELLS)with identity instance matrices, added as a child of the body mesh;customProgramCacheKey = () => 'shell-fur'.- Vertex (after
<begin_vertex>):layer = (gl_InstanceID + 1)/shells;transformed += normalize(objectNormal)·layer·lenwithlen = color.a·0.028 m; droopy −= layer²·len·0.35; windxz += layer²·len·.25·uWind·(sin(1.7t + 9y), cos(1.3t + 7x)). - Fragment (after
<alphatest_fragment>): discard ifcolor.a < .02orlayer > a·1.15 + .05(short fur stops at fewer shells); cell grid in rest spaceq = position·420, nearest of the 2×2×2 neighbouring jittered cell centres (hash3·.8); keep ifd < .55·(1 − layer)— strands taper to a point. - Colour (after
<color_fragment>):rgb *= mix(.62, 1.12, layer)— deep in the coat is shadowed, tips catch the light. DoubleSide, roughness .95, metalness 0.- LOD: shell count by camera distance —
< 3 m: 24,< 7 m: 14,< 16 m: 6,< 40 m: 3, beyond: 0 — by settinginstancedMesh.counteach frame. - Shadows: shells
castShadow = false,receiveShadow = true; the body casts.
Posed characters
If the character deforms in the vertex shader (head turn, blink, breathing), the fur material must
run the same pose function before the shell push, and so must the body's depth material —
otherwise the coat stays behind when the head turns. Skinned meshes can't be instanced this way,
which is one reason to deform without a skeleton (threejs-skeletonless-character-animation).
Eyes
Swap a transmissive cornea for a transparent clearcoat MeshPhysicalMaterial. Transmission adds a
whole extra render pass.
Pitfalls
- COLOR_0 comes out VEC3 — alpha lost in export; fur length reads as 1 everywhere (or the code
bails). Use
'ACTIVE'and verify the accessor type. - UV-based strand cells show seams; rest-space 3D cells don't.
- Markings painted close together read as one zigzag once the fur blurs them.
- Shells casting shadows cost N× the shadow pass and darken the coat.
- Transmission for eyes adds an extra full render pass.
- Pose not applied to the shells → the fur lags the body.
Verify
- Close up (< 1 m): individual tapered strands, darker at the skin; face fur short; no fur on eyes.
- Mid (5 m) and far (20 m): coat still reads soft; check
instancedMesh.countdrops with distance. - Frame time with fur on/off; shadow pass unchanged.
Related skills
threejs-skeletonless-character-animation · threejs-blender-glb-pipeline ·
threejs-webgl-performance-profiling · threejs-ghibli-toon-shading
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

