Add-on that adds a fur node to the Godot engine, using a shell based approach to imitate fur strands.
351
stars
104
commits
GDScript
primary language
Oct 1, 2023
updated
Add-on that adds a fur node to Godot 3.4. Demo project available here.
ShellFur is available on the Godot Asset Library, so the easiest way to install it into your project is directly inside Godot. Simply go to the AssetLib screen and search for "Fur" and the add-on should appear. Select it and press Download -> Install.
Alternatively you can press the green Code button at the top of this page and select Download ZIP, unzip the file and place the "shell_fur" folder in your project like so "addons/shell_fur*.
Once the files are in your project, you need to activate the add-on from the Project -> Project Settings... -> Plugins menu.
I was inspired by games like Shadow of the Colossus and Red Dead Redemption 2 which use this technique, to try and make my own implementation in Godot.
This tool is not meant for grass and foliage. This method is way too performance expensive on fillrate when the fur takes up large parts of the screen for it to be used for effects like that. Use the effect for hero props or characters.
Select any MeshInstance node and add the ShellFur node as a child beneath it.

The parameters for the fur is split into five sections.
Main

Material
The material subsection is dynamically generated based on the content of the shader in use. The Regular and Mobile shader have the same shader parameters, but if you choose to customize the shader any parameters you add will be displayed here. See writing custom shaders for details.
Physics
Spring physics and wind in action

Blendshape Styling
Blendshape styling being applied

Lod
If you want to communicate with the fur script with your own scripts you can call all the public setters and getters on the tool, in addition to the setters for the parameters seen in the inspector, these three functions may be useful.
| Function | Return Type | Description |
|---|---|---|
| get_current_LOD() | int | Returns the current LOD level |
| get_shader_param(param : String) | variant | Returns the given shader parameter |
| set_shader_param(param : String, value) | void | Sets the given shader parameter - DO NOT SET INTERNAL PARAMS (prefix "i_") |
Using your own fur patterns
If you want to use your own pattern for the fur, you need use a texture with noise in the R channel used for the fur strand cutoff. You can leave G, B and A channel at full value and the shader will work, but you will not have any options for random length, density, thickness and growth. To have that you'll need to have random values corresponding to the cells of each strand in those channels as seen below.
Breakdown of Very Fine texture - Left to right: Combined pattern texture, R channel, G channel, B channel and A channel.

The easiest way to do this is to use this file which shows examples of how I generate fur textures. It is made in the free texture generation program Material Maker.
Be sure to enable Filter, Mipmaps and Anisotropic and set Srgb to Disable when importing your own pattern textures.
Writing Custom Shaders
When writing custom shaders for the tool there are a few things to keep in mind.
The tool uses certain uniforms that should not be customized as that will break the tool. These uniforms are prefixed with "i_" and are:
| Uniform name | Description |
|---|---|
| i_layers | Used by the shader to correctly spread the layers |
| i_pattern_texture | The pattern texture set by the selector in the main section |
| i_pattern_uv_scale | UV scale of the above texture |
| i_wind_strength | Controls for the wind system |
| i_wind_speed | Controls for the wind system |
| i_wind_scale | Controls for the wind system |
| i_wind_angle | Controls for the wind system |
| i_normal_bias | Used to blend in the normal at the base when using blendshape |
| i_LOD | Used by the LOD system |
| i_physics_pos_offset | Used by the physics system to pass spring data |
| i_physics_rot_offset | Used by the physics system to pass spring data |
| i_blend_shape_multiplier | Used when setting up the extrusion vectors for the shells |
| i_fur_contract | Used by the LOD system to pull the fur into the mesh |
Uniforms that do not start with "i_" will be parsed by the ShellFur's material inspector so they can easily be used in the tool. If the uniforms start with any of the below prefixes they will automatically be sorted into subcategories in the material section.
| Prefix name | Subcategory name |
|---|---|
| albedo_ | Albedo |
| shape_ | Shape |
| custom_ | Custom |
mat4 uniforms containing "color" in their name will be displayed as a gradient field with two color selectors.
Mobile Support - experimental
The shader works with GLES2, however rotational physics and Custom Physics Pivot does not work in GLES2.
I suggest using the Mobile shader when targeting mobile, but if you have a newer device, the Regular shader might work as well.
In my testing there appeared to be a bug where skinned meshes with blendshapes don't render on Android. https://github.com/godotengine/godot/issues/43217. So if you want to use blendshape styling, you might need to work around this by having a separate mesh where you have removed the blendshape, that is getting rendered. I had to do this in my current android demo scene, so have a look at the demo project to see how I did it there.
No testing has been done on iOS devices.
If you want to contribute to the project or just work on your own version, clone the repository and add WAT - Unit Testing Framework into the project as I don't include it in this repository, but I've started using it for running automated tests. I also use Todo Manager and Godot Plugin Refresher when working on the project, so you might want to consider adding them as well. If you want to add something in, simply do a pull request and I'll have a look at it.
104 commits
GDScript
99.4%
Add-on that adds a fur node to the Godot engine, using a shell based approach to imitate fur strands.
351
stars
104
commits
GDScript
primary language
Oct 1, 2023
updated
Add-on that adds a fur node to Godot 3.4. Demo project available here.
ShellFur is available on the Godot Asset Library, so the easiest way to install it into your project is directly inside Godot. Simply go to the AssetLib screen and search for "Fur" and the add-on should appear. Select it and press Download -> Install.
Alternatively you can press the green Code button at the top of this page and select Download ZIP, unzip the file and place the "shell_fur" folder in your project like so "addons/shell_fur*.
Once the files are in your project, you need to activate the add-on from the Project -> Project Settings... -> Plugins menu.
I was inspired by games like Shadow of the Colossus and Red Dead Redemption 2 which use this technique, to try and make my own implementation in Godot.
This tool is not meant for grass and foliage. This method is way too performance expensive on fillrate when the fur takes up large parts of the screen for it to be used for effects like that. Use the effect for hero props or characters.
Select any MeshInstance node and add the ShellFur node as a child beneath it.

The parameters for the fur is split into five sections.
Main

Material
The material subsection is dynamically generated based on the content of the shader in use. The Regular and Mobile shader have the same shader parameters, but if you choose to customize the shader any parameters you add will be displayed here. See writing custom shaders for details.
Physics
Spring physics and wind in action

Blendshape Styling
Blendshape styling being applied

Lod
If you want to communicate with the fur script with your own scripts you can call all the public setters and getters on the tool, in addition to the setters for the parameters seen in the inspector, these three functions may be useful.
| Function | Return Type | Description |
|---|---|---|
| get_current_LOD() | int | Returns the current LOD level |
| get_shader_param(param : String) | variant | Returns the given shader parameter |
| set_shader_param(param : String, value) | void | Sets the given shader parameter - DO NOT SET INTERNAL PARAMS (prefix "i_") |
Using your own fur patterns
If you want to use your own pattern for the fur, you need use a texture with noise in the R channel used for the fur strand cutoff. You can leave G, B and A channel at full value and the shader will work, but you will not have any options for random length, density, thickness and growth. To have that you'll need to have random values corresponding to the cells of each strand in those channels as seen below.
Breakdown of Very Fine texture - Left to right: Combined pattern texture, R channel, G channel, B channel and A channel.

The easiest way to do this is to use this file which shows examples of how I generate fur textures. It is made in the free texture generation program Material Maker.
Be sure to enable Filter, Mipmaps and Anisotropic and set Srgb to Disable when importing your own pattern textures.
Writing Custom Shaders
When writing custom shaders for the tool there are a few things to keep in mind.
The tool uses certain uniforms that should not be customized as that will break the tool. These uniforms are prefixed with "i_" and are:
| Uniform name | Description |
|---|---|
| i_layers | Used by the shader to correctly spread the layers |
| i_pattern_texture | The pattern texture set by the selector in the main section |
| i_pattern_uv_scale | UV scale of the above texture |
| i_wind_strength | Controls for the wind system |
| i_wind_speed | Controls for the wind system |
| i_wind_scale | Controls for the wind system |
| i_wind_angle | Controls for the wind system |
| i_normal_bias | Used to blend in the normal at the base when using blendshape |
| i_LOD | Used by the LOD system |
| i_physics_pos_offset | Used by the physics system to pass spring data |
| i_physics_rot_offset | Used by the physics system to pass spring data |
| i_blend_shape_multiplier | Used when setting up the extrusion vectors for the shells |
| i_fur_contract | Used by the LOD system to pull the fur into the mesh |
Uniforms that do not start with "i_" will be parsed by the ShellFur's material inspector so they can easily be used in the tool. If the uniforms start with any of the below prefixes they will automatically be sorted into subcategories in the material section.
| Prefix name | Subcategory name |
|---|---|
| albedo_ | Albedo |
| shape_ | Shape |
| custom_ | Custom |
mat4 uniforms containing "color" in their name will be displayed as a gradient field with two color selectors.
Mobile Support - experimental
The shader works with GLES2, however rotational physics and Custom Physics Pivot does not work in GLES2.
I suggest using the Mobile shader when targeting mobile, but if you have a newer device, the Regular shader might work as well.
In my testing there appeared to be a bug where skinned meshes with blendshapes don't render on Android. https://github.com/godotengine/godot/issues/43217. So if you want to use blendshape styling, you might need to work around this by having a separate mesh where you have removed the blendshape, that is getting rendered. I had to do this in my current android demo scene, so have a look at the demo project to see how I did it there.
No testing has been done on iOS devices.
If you want to contribute to the project or just work on your own version, clone the repository and add WAT - Unit Testing Framework into the project as I don't include it in this repository, but I've started using it for running automated tests. I also use Todo Manager and Godot Plugin Refresher when working on the project, so you might want to consider adding them as well. If you want to add something in, simply do a pull request and I'll have a look at it.
104 commits
GDScript
99.4%