The Toby Foliage Engine

The Toby Foliage Engine
v1.0.0
(Asset Store Link)

Feel free to discuss the asset or request technical support.

Read The Documentation

Overview

Simple yet elegantly complex, introducing the Toby Foliage Engine (TTFE) - the innovative single-pivot vegetation system that attempts to simulate multiple pivots per mesh, similar to Pivot Painter.

The Toby Foliage Engine (TTFE) shaders provide a comprehensive solution for achieving realistic wind and plant shading. Its seamless integration and user-friendly interface make applying it to any mesh easy. There is no need to worry about conversion or any cumbersome steps as the shaders streamline this process.

TTFE is an automatic feature that works in conjunction with PBR shading. The wind physics is affected by internal mesh-based vertex position volumes. You can control the size of your volume to mask out wind in your material settings. Similarly, you can modify the behavior of your wind through the material settings.

Made entirely in the Amplify Shader Editor, these shaders offer fully customizable features and well-organized nodes that are easy to learn from.

○ Features

  • Two types of wind systems can be interchangeably used; “Gentle Breeze” and “Strong Wind”. The global features such as wind and seasons can be adjusted using the “(TTFE) Global Controller”.
  • Automatic wind system and adjustable wind mask volumes (mask can be defined in the material settings).
  • Trunk and branch bending system.
  • Real-time season control Including random color and contrast.
  • Self-shading (faux-mobile shading with additional vertex color features).
  • Vertex ambient occlusion and self-occlusion.
  • Accurate PBR shading.
  • New and Innovative deferred translucency that gets automatically occluded in shadow by a feature called “Translucency Ao”. Works in Built-in, URP, and HDRP (only additional to the diffusion profile In HDRP).
  • Translucency Fluffiness (makes fuzzy-looking grass).
  • Extra, Uber Cliff shader (triplanar cliff shader with grass/snow coverage and correct edge slope angle, 3 layers).
  • Amplify Shader functions.
  • Seven example scenes.
  • Original assets.

⚑ Limitations

TTFE is designed to work with instancing, static batching is not supported.
TTFE is slightly more expensive for mobile but can be optimized by removing features.
Shader Model 4.5+ capable devices are required (Desktop / High-End Mobile).
While Mobile is supported, the scenes are intended for performance testing and will not be suitable for mobile devices (performance-intensive scenes).
Only the latest LTS Unity versions are officially supported.

⚑ Due to the employed method, visible stretching may occur in the trunk and branches. Adjust the material settings until the desired outcome is achieved.

⚑ The TTFE feature is functional without the implementation of vertex colors. However, green vertex color is necessary for the “flutter feature” to work on leaves. Grass does not require any vertex colors.

⚑ TTFE is not a perfect alternative and may not produce identical results as Pivot Painter. The wind only relies on a single point of rotation!!

⚑ Performance Intensive Scenes! The demo scenes were created to test the performance of the TTFE shaders, which can be compared with other shaders or used for testing. For lower-end devices, you can set the “LOD bias to 1” in your “Preferences → Quality settings”.

⚑ Global Controller Notice! It has been observed that moving sliders in the global controller of a larger scene might appear to be laggy. It is worth noting that this issue might be resolved in the future, and it’s not yet suitable for real-time use in large scenes.

8 Likes

I’ll be away on vacation in April but I’ll attempt to reply to emails and troubleshoot questions whenever I can.

In the meantime, here’s a road map for future updates:

  • Interactive wind direction through the global gizmo.

  • Grass and trees, player interaction (touch bending).

  • Fix global controller lag in large scenes.

  • Particles that work with TTFE wind physics and season change.

  • Snow and winter addition.

  • Cliff shader with seasonal change.

  • TTFE terrain shader (not guaranteed).

  • More simple and mobile-friendly versions of the shaders.

  • Potentially include Shader Graph.

If you have any suggestions I would like to know.

2 Likes

For everyone who is noticing dark faces on vegetation in HDRP 2022+, the reason is not the built-in Unity SSAO but my “translucency occlusion” feature. It has been deprecated in HDRP as of now, here’s the quick fix.

If you own Amplify, you can remove the feature yourself.

9744730–1394359–HDRP 2022_TransFoliage - Fix.unitypackage (273 KB)

Added a quick tutorial vid on grass mask.

Quick setup tutorial with other assets.

Last video, enjoy an artistic one till the next update of the pack. Next, I’ll be making a basic version of the shaders to upgrade all my assets with. Rocky Hills needs an update.

Showing off a few screenshots of the vegetation assets included in the pack.


I made an even more optimized version of the shaders with only the core features. I will release it as a free sample version soon and update all my assets using it instead!

(Amplify functions will not be available in the free version but you will still be able to open the code)

Just published the FREE light version sample!

9784107--1403565--TTFE_CardImage_420x2802 x.jpg

3 Likes

Small update for The Toby Foliage Engine / Light:

  • Added basic trunk bending.
  • Updated SRP pipeline installs.

Hi Florian,
I opened a new HDRP project and import your free version of this foliage. Everything is pink.
Textures are visible and placed correctly, materials are just pink.
image

Hi, manually install the SRP version for your specific use case by double-clicking and importing one of the HDRP packages that fit your Unity version number located in “_The Toby Foliage Engine → (TTFE)Core → Pipelines”.

The lag issue when moving sliders in large scenes can now be avoided by using the shaders with terrain trees and terrain details. TTFE has improved integration with the terrain system so using the terrain to paint plants is recommended.

New Global Controller Bug Discovered*

  • For the global controller to work with Unity terrain when using prefabs as terrain trees and terrain details, there must be at least one prefab mesh of each material in the scene so the terrain can instance it. If there is no object, the controller will not function.

I improved the specular for “world up” normals by changing the fresnel to tangent space, which gives better results on specular for any type of custom normals. (Only works in Built-in and URP).
Feel free to integrate these nodes in the shader!


Hey there. I was wondering if your shader has motion vector support?

Hi, do you mean URP, and HDRP motion vectors?

I mean per object motion vectors in Built In. We need them for various post processing effects.

I’m not entirely sure if the Built-in pipeline supports motion vectors or if it’s a new feature added to URP and HDRP only. Or it could be that built-in has some motion vectors already. You could try the free version and see for yourself: The Toby Foliage Engine / Light | VFX Shaders | Unity Asset Store
If the free version works then so should the pro one.

From what I can understand you can it to the shader with a code by extending the shader template: Accessing the depth texture and motion vector texture

Apparently, Override baked GI is broken in HDRP and might cause some of the shaders to break for some people. If you experience issues, turn off the “override baked GI” option!

Here’s a quick fix:


9917535–1433880–TTFE Shader Fix.unitypackage (185 KB)