Add-on that adds a fur node to the Godot engine, using a shell based approach to imitate fur strands.

Shell Fur Add-on for Godot Engine

Shell Fur Add-on for Godot v0.1.0 Released - Feature Overview

Add-on that adds a fur node to Godot 3.2. Demo project available here.

Discord Server

Patreon

Installation

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.

Purpose

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.

Warning

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.

Usage

Select any MeshInstance node and add the ShellFur node as a child beneath it.

72mqYGVOST

Parameters

The parameters for the fur is split into five sections.

Main

  • Shader Type - This allows you to select between shaders, the options are Regular, Mobile and Custom (Custom only appears when a shader is set in the Custom Shader field). The Mobile shader differs from the Regular shader in that it does not use depth_draw_alpha_prepass as that does not work well in my testing on Android, it also uses simpler diffuse and specular shading and disables shadows on the fur. Note: Both Regular and Mobile shaders work with GLES2.
  • Custom Shader - This option allows you to use a custom shader, selecting new will clone the currently active shader for you to edit.
  • Layers - The amount of shells that are generated around the object, more layers equals nicer strands, but will decrease performance.
  • Pattern Selector - This options allows you to select between the five included patterns. image
  • Pattern Texture - The pattern texture in use, use this to manually set your own pattern for the fur shape, if none of the built-in ones fit your purpose. See info on making your own patterns below.
  • Pattern UV Scale - The scale of the pattern texture on the model, increase this to make more dense and thin fur.
  • Cast Shadow - Whether the fur should cast shadow. This is expensive performance wise, so it defaults to off.

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.

  • Transmission: - The amount of light that can pass through the fur and the color of that light.
  • Ao: - Fake ambient occlusion applied linearly from the base to the tip.
  • Roughness - The roughness value of the fur, it's difficult to achieve realistic shiny fur with this approach, you will probably get the best result leaving this value at 1.0.
  • Albedo - Subcategory for albedo parameters.
    • Color - Color gradient used for the albedo of the fur, left is base of the fur, right is tip. The color interpolates linearly between the two.
    • UV Scale - UV Scale for the albedo texture below.
    • Texture - Texture for the color of the strands. Values are multiplied with the Color gradient so it can be used for tinting.
  • Shape - Subcategory for the shape parameters.
    • Length - The length of the fur. Set this to 1.0 if you are using blendshape styling and want the fur to exactly reach the blendshape key.
    • Length Rand - Controls how much randomness there is in the length of the fur.
    • Density - Lowering the value with randomly discard more and more hair strands for a more sparse look.
    • Thickness Base - The thickness at the base of the strand.
    • Thickness Tip - The thickness at the tip of the strand.
    • Thickness Rand - Controls how much the thickness of each strand gets multiplied with a with a random value.
    • Growth - This control can be animated either with an animation player node or a script for fur growth effect.
    • Growth Rand - This adds a random offset to the growth of each strands.
    • ldtg UV Scale - UV Scale for the ldtg texture below.
    • ldtg Textire - An RGBA texture that can be used to customize the Length(R), Density(G), Thichkness(B) and Growth(A) parameters.

Physics

  • Custom Physics Pivot - If you are using the fur on a skinned mesh where animation is moving the mesh, use this option to set the physics pivot to the center of gravity of your character. You can use the Bone Attachment node to set up a node that will follow a specific bone in your rig.
  • Gravity - Down force applied on the spring physics.
  • Spring - Amount of springiness to the physics.
  • Damping - Amount of damping to the physics (to imitate air and friction resistance stopping the fur's movement over time).
  • Wind Strength - Amount of wind strength, the wind is applied as a noise distortion in the vertex shader due to current limitations so it does not interact with the spring physics. If the Wind Strength is set to 0 the calculations are skipped in the shader.
  • Wind Speed - How quickly the wind noise moves accross the fur.
  • Wind Scale - Scale of the wind noise.
  • Wind Angle - The angle the wind pushes in degrees around the Y-axis. 0 means the wind is blowing in X- direction.

Spring physics and wind in action

OjUGl0gCwP

Blendshape Styling

  • Blendshape - This pull down will list any blendshapes available on your base mesh. Selecting one of them will activate Blendshape Styling.
  • Normal Bias - This option only appears when a blendshape is selected above. This option mixes the fur direction of the blendshape with the normal direction of the base shape for a more natural look.

Blendshape styling being applied

JKYwI1ItFD

Lod

  • Lod 0 Distance - The distance up to which the fur will display at full detail.
  • Lod 1 Distance - The distance at which the fur will display at 25% of it's layers. The fur will smoothly interpolate between Lod 0 and Lod 1. Beyond Lod 1 distance the fur will fade away and the fur object will become hidden.

API

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_")

TIPS

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. image

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.

Current Limitations

  • Since the fur is made up of shells that are parallel to the surface, the fur can look pretty bad when seen from the side. This is somewhat mitigated by using the blendshape styling but could be further improved by adding in generated fur fins around the contour of the mesh.
  • Limitations to skinned meshes. When the fur is applied to skinned meshes, MultiMeshInstance method cannot be used, so a custom mesh is generated with many layers. This is heavy on skinning performance and currently blendshapes are not copied over, so the fur will not adhere to blendshape changes on the base mesh. Using material passes would bypass this issue, but would cause a lot of draw calls. I'm still looking into a solution for this.

Acknowledgements

  • Thanks to my patrons Little Mouse Games, Winston, Johannes Wuensch, spacechase0, Dmitriy Keane and Marcus Richter for all their support.
  • Kiri (@ExpiredPopsicle) was a huge help in answering questions and pointing me in the right direction with this.

Contributing

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.

License

Comments
  • New version

    New version

    Hello. It does not work under Godot 3.4.2. Plan You to add support for 3.4 or it is dead already?

    UPDATE: It does work. But if You will create sub-scene it will not render fur, Screenshot_20220305_204947

    Thank You.

  • "LOD 1" seems doesn't work at all, eats all the performance at any value.

    If fur is:

    • toggled invisible - 76 fps
    • LOD == 100% of scene visible - 66 fps.
    • LOD == 20% - 68

    Intel HD620, Linux.

    So, what is the point of LOD? Is the scene too small to see LOD's power? But fps even with rtx2060m is below 200 in this scene. Is "cull invisible" works with fur? Or I'm just don't understand something.

    (Don't look at fps on this picture, just an example) image

  • Reparenting object with shell fur applied causes brief

    Reparenting object with shell fur applied causes brief "flash" of partially unshaded object

    Just wanted to say, this plugin is great and super intuitive to use, thanks for your hard work. The issue below can be worked around by processing the transform to follow the bone manually rather than reparenting, I guess, or possibly by disabling the fur physics for a moment during reparenting, I haven't tried that yet.

    Describe the bug

    When reparenting a node which has the fur effect applied, for a couple of frames part of the "original" object is visible through the effect.

    To Reproduce

    • Create RigidBody with MeshInstance, SphereMesh, apply ShellFur with default settings
    • At runtime, remove RigidBody from original parent node, and reparent by adding as child to a different node

    Expected behavior

    The node is reparented without disruption to fur effect

    Screenshots

    https://user-images.githubusercontent.com/233380/115468555-27cd6e00-a22b-11eb-877a-452e0487c86d.mp4

    Environment

    • OS: Linux 5.11
    • Graphics card: RTX 2080 SUPER
    • Godot version 3.3 rc9
    • Plugin version: 0.2.0
    • Renderer used: GLES3
  • Gradient

    Gradient

    Is your feature request related to a problem? Please describe. Can't create an adequate looking fur gradient for an animal.

    Describe the solution you'd like At least it could be a texture template, but better will be a sliders with some coefficients.

  • Non constant fur length

    Non constant fur length

    Describe the bug Length is not so big, so should they be so long?

    To Reproduce Fur + Wind (settings are on the screenshot)

    Expected behavior Constant long

    Screenshots Screenshot_20220309_155649

    Environment Arch Linux Intel hd 620 / rtx2060 Godot 3.4.x Plugin 0.2.0 GLES3

  • Old intel cards don't do LOD correctly, and certain types of fur are corrupt (hard black blotches)

    Old intel cards don't do LOD correctly, and certain types of fur are corrupt (hard black blotches)

    Describe the bug 1.a. There is some sort of LOD effect (or perhaps just a glitch--I can't tell) even when close to an object where the texture reverts to some sort of static rendering of fur that doesn't go past the edge of the object. 1.b. When further away, a "shaved" version of the object appears--that couldn't possibly look right ever, unless very far away or on mobile (and if the texture matched the fur better). 2. The peaks on the moss have hard black edges, and when further away, other types of fur have it--some sort of missing range limiting call perhaps.

    The glitch flashes on and off randomly, more or less than once per second, except the black which stays that way and seems to depend on distance (more distance also changes glitch 1a above to 1b). Getting very close to the moss doesn't fix the black clipping on the moss though getting somewhat close to other objects fixes the black clipping.

    Though 3 of the screenshots are in the editor and 1 is running the mobile scene, the glitches are the same when running the demo_desktop scene. The glitch also occurs when clicking "Run" from the main Godot menu, even though the FPS goes up to 60 average due to the editor not being open.

    To Reproduce Steps to reproduce the behavior:

    1. Open the demo scene using old Intel integrated GPU that has a very low FPS (~10 or so) in the editor.

    Expected behavior

    1. The LOD should always revert to some sort of static rendering of the fur (screenshot A, but ideally hanging off the object rather than limited by it) rather than "shaved" (screenshot set B; perhaps optionally) and never reduce the quality when close (screenshot A).
    2. The peaks should be smooth rather than black on the moss.

    Screenshots A. Some sort of LOD effect occurs even when close: image B. Only when further away from the object, sometimes it reverts to the "shaved" look. Also, peaks are black for the moss, and sometimes for other things: image image image

    Environment

    • OS: Debian 10
    • OpenGL ES 3.0 Renderer: Mesa DRI Intel(R) Haswell Desktop;
    • Godot Engine v3.3.2.stable.mono.official
    • Plugin version (or commit hash if you got it from Github directly)
    • Renderer used: OpenGL ES 3.0; OpenGL ES Batching: ON
  • The project file doesn't respect case sensitive platforms.

    The project file doesn't respect case sensitive platforms.

    Describe the bug Due to case sensitivity on non-Windows platforms, cottage, rat, and log tscn files are said to be missing. The files start with uppercase letters but in the project file they are listed as all lowercase.

    To Reproduce Steps to reproduce the behavior:

    1. Open the file on Linux.

    Expected behavior There shouldn't be a missing resources error for each of the those files. To fix this on Windows probably isn't possible without editing the project file: When I've tried to change the case of filenames by adding a letter to the filename then removing it and changing the case, git for Windows doesn't apply the change in git. You must either rename the files on Linux (or perhaps GitHub) or edit the project file with a text editor.

    Environment

    • OS: Debian 10
Cross platform GUI in Go based on Material Design
Cross platform GUI in Go based on Material Design

About Fyne is an easy to use UI toolkit and app API written in Go. It is designed to build applications that run on desktop and mobile devices with a

Jan 3, 2023
GPU based Electron on a diet

Muon is a lightweight alternative to Electron written in Golang in about ~300 LoC, using Ultralight instead of Chromium. Ultralight is a cross-platfor

Jan 2, 2023
Flutter on Windows, MacOS and Linux - based on Flutter Embedding, Go and GLFW.
Flutter on Windows, MacOS and Linux - based on Flutter Embedding, Go and GLFW.

go-flutter - A package that brings Flutter to the desktop Purpose Flutter allows you to build beautiful native apps on iOS and Android from a single c

Jan 9, 2023
Cross platform rapid GUI framework for golang based on Dear ImGui.
Cross platform rapid GUI framework for golang based on Dear ImGui.

giu Cross platform rapid GUI framework for golang based on Dear ImGui and the great golang binding imgui-go. Any contribution (features, widgets, tuto

Dec 28, 2022
GTK3-based dock for sway
GTK3-based dock for sway

nwg-dock Fully configurable (w/ command line arguments and css) dock, written in Go, aimed exclusively at sway Wayland compositor. It features pinned

Dec 23, 2022
A minimal material design based UI toolkit for Tiny Go projects
A minimal material design based UI toolkit for Tiny Go projects

A minimal material design based UI toolkit for Tiny Go projects.

Sep 3, 2022
Create desktop apps using Go and Web Technologies.
Create desktop apps using Go and Web Technologies.

Build desktop applications using Go & Web Technologies. The traditional method of providing web interfaces to Go programs is via a built-in web server

Dec 29, 2022
A full desktop environment for Linux/Unix using Fyne
A full desktop environment for Linux/Unix using Fyne

About FyneDesk is an easy to use Linux/Unix desktop environment following material design. It is build using the Fyne toolkit and is designed to be ea

Dec 31, 2022
Compute shader in GO (using go-gl/glfw)
Compute shader in GO (using go-gl/glfw)

shadr (compute shader using go-gl/glfw) structure main.go contains intialisation

Jan 20, 2022
Idiomatic Golang GUI using Lorca
Idiomatic Golang GUI using Lorca

Dali Summary Dali is a pure Golang library built on lorca in order to provide Go developers a way to create GUI-based applications using idiomatic Go.

Jul 11, 2022
Example Go desktop app using HTML

webview-example This repo contains an example/starter for building a webview app

Jun 14, 2022
W32find - Find parent windows and their children windows using win32api.

w32find Package w32find provides a set of interface to win32 APIs that can be used to find windows and their controls. Install go get -v github.com/mo

Jan 5, 2022
Boilerplate for writing Go applications without framework using hexagonal application development approach
Boilerplate for writing Go applications without framework using hexagonal application development approach

Boilerplate for writing Go applications without framework using hexagonal application development approach

Dec 2, 2022
Two approach for solving common items problem using Golang

Compare Two Arrays For Common Items Given two seperate arrays of integers, create a function that take two arrays and check for common itemss. Example

Nov 28, 2021
network-node-manager is a kubernetes controller that controls the network configuration of a node to resolve network issues of kubernetes.
network-node-manager is a kubernetes controller that controls the network configuration of a node to resolve network issues of kubernetes.

Network Node Manager network-node-manager is a kubernetes controller that controls the network configuration of a node to resolve network issues of ku

Dec 18, 2022
Golang-for-node-devs - Golang for Node.js developers

Golang for Node.js developers Who is this video for? Familiar with Node.js and i

Dec 7, 2022
K6 extension that adds support for browser automation and end-to-end web testing using playwright-go
K6 extension that adds support for browser automation and end-to-end web testing using playwright-go

k6 extension that adds support for browser automation and end-to-end web testing using playwright-go

Dec 21, 2022
painless task queue manager for shell commands with an intuitive cli interface (execute shell commands in distributed cloud-native queue manager).

EXEQ DOCS STILL IN PROGRESS. Execute shell commands in queues via cli or http interface. Features Simple intuitive tiny cli app. Modular queue backend

Dec 14, 2022
ap 是一个 shell 工具,可以让其它 shell 命令的输出能够自动进入交互翻页模式

ap -- auto-pager ap 是一个 shell 工具,可以让其它 shell 命令的输出能够自动进入交互翻页模式。 ap 由两部分组成,一个 Go 语言编写的二进制程序,负责捕获命令的输出并支持翻页, 和一组 shell 脚本,负责为用户指定的命令清单创建与之同名的 wrapper。 经

Apr 12, 2022
Assume-shell - A tool to create a shell with AWS environment credentials set

assume-shell This tool will request AWS credentials for a given profile/role and

Sep 29, 2022