XaiJu
Furrier
Furrier

patreon


DevBlog - Making Fur More Reactive – Fluid Interaction in the Fluffy Game Framework

For my Fluffy Game framework, I’ve been experimenting a lot with ways to make fur more reactive and dynamic. One of the biggest challenges?
πŸ‘‰ Making fur react to fluids in real-time and behave accordingly!

This is tricky but possible, so let me explain my technique.

Realtime Fur Fluid Interaction – The Core Idea

Every character has a body-specific RenderTargetβ€”essentially a texture that exists on the GPU and updates in real-time.

This 16-bit texture has three channels, each representing a different fluid effect in the fur material:

πŸ”΄ Red Channel – Wetness (Black = Dry, White = Wet)
🟒 Green Channel – Sticky Liquid (Yes, that one... >3)
πŸ”΅ Blue Channel – Dirt Accumulation

πŸ‘‰ The red channel (wetness) fades over time, simulating drying.
πŸ‘‰ The green & blue channels (sticky/dirt) remain until "washed" away by a fluid marked as water.

(Image showing RenderTarget in action)

Painting Fluids onto a Skeletal Mesh – The Challenge

Applying fluid effects in real-time without performance issues is a major technical challenge because:
βœ” Per-poly collision is expensive.
βœ” Characters move, making fluid placement dynamic.

My Solution: The PaintJobManager

When a fluid interacts with fur, here’s what happens:
1️⃣ The physics asset (a simplified collision model) detects the hit.
2️⃣ The hit’s relative location & rotation are recorded along with the character reference & affected bone.
3️⃣ This data is sent to the PaintJobManager, which queues paint jobs.
4️⃣ Instead of applying all paint jobs in one frame (which kills performance), the PaintJobManager:
πŸ”Ή Applies the latest & a random paint job per frame.
πŸ”Ή This ensures many fluids can interact with fur smoothly without FPS drops.

(Image showing character physics asset)

πŸ‘‰ The result? Fluid interactions happen seamlessly, even if some paint jobs are delayed by a frame or two!

Beyond Visuals – Fur Fluid for Game Logic

Fur fluid interactions aren’t just visualβ€”they also affect gameplay!

(Image showing dirt data structure)

βœ” Each character stores wetness/dirtiness values per bone in its Character Structure.
βœ” This means characters have hundreds of points that track fluid interactions.
βœ” This is used for scent mechanics (e.g., wet or dirty fur emits different smells for AI detection).

Saving & Loading Fur Fluid States

Since RenderTargets exist only on the GPU, saving fur states for loading later is tricky.
πŸ’Ύ My solution:
1️⃣ Convert the RenderTarget into a list of bytes.
2️⃣ Save this list inside the character’s savegame file.
3️⃣ When reloading, reconstruct the RenderTarget from the saved bytes.
4️⃣ Use a special shader to initialize the character’s RenderTarget from this texture.

Painting a Skeletal Mesh – The "Pancake" Trick

Painting a skeletal mesh dynamically is very different from painting on a static mesh. My workaround is silly but effective:

πŸ”Ή When a fluid paint event occurs, the character temporarily "flattens" like a pancake. πŸ₯ž
πŸ”Ή This is done by stretching the character’s UVs (texture coordinates).
πŸ”Ή A scene capture camera snaps an image of this flattened version.
πŸ”Ή A second shader renders the desired paint color onto the flattened mesh.
πŸ”Ή The generated mask is then added to the RenderTarget, updating the fluid effect.

πŸ‘‰ This all happens between frames, so you never notice itβ€”but technically, every time you make a character dirty, they briefly turn into a pancake. πŸ˜‚

(image showing character turned into pancake)

(Image showing Shader responsible for making 3d object into flat 2d uv representation)

The Fluid System

The fluid is driven by a particle system that dynamically tracks and connects particles to create a fast, real-time 3D fluid simulation. Each fluid strand can:

βœ” Attach to objects (sticky behavior).
βœ” Paint onto surfaces at any point in 3D space.

This allows for realistic interactions, making fluids feel dynamic and natural within the game world.

The Fur System

Fur has two distinct states depending on whether it’s wet or dry:

βœ” Wet Fur β€“ A separate undercoat is revealed, featuring shorter, denser hair that clings to the body.
βœ” Dry Fur β€“ The overcoat returns, becoming fluffy and soft, just as you'd expect~ :3

Additionally, fur reacts dynamically to dirt:
🟀 Dirt accumulation affects fur color over time.
🀍 White, creamy fluids leave visible stains even after drying.

This system ensures fur looks and behaves naturally, adapting to environmental interactions in a believable and immersive way.

The Result?

βœ” Realtime, performance-friendly fur fluid interactions.
βœ” Wetness, stickiness, and dirt persist and influence game mechanics.
βœ” Characters dynamically change based on their environment.
βœ” No noticeable performance hit, even with lots of fluids!

Next up, I’ll show you The level generation process and the differences between the Cell and Grid type generators i made!

β™₯u,
Your furrier πŸΎ

DevBlog - Making Fur More Reactive – Fluid Interaction in the Fluffy Game Framework DevBlog - Making Fur More Reactive – Fluid Interaction in the Fluffy Game Framework DevBlog - Making Fur More Reactive – Fluid Interaction in the Fluffy Game Framework DevBlog - Making Fur More Reactive – Fluid Interaction in the Fluffy Game Framework DevBlog - Making Fur More Reactive – Fluid Interaction in the Fluffy Game Framework

More Creators