This is a shader for SpeedTree version 8.x for Unity. The shader has advanced settings compared to the standard Unity shader for SpeedTree.
The shader fully functions in Forward Rendering and Deferred Rendering (including Subsurface Emission). Shaders have great scalability. The shader allows you to increase performance, but to the detriment of appearance, or to get a better image, but to the detriment of performance.
Using this shader, you can adjust the wind (speed, amplitude, swaying branches, etc.). The wind settings in the shader, allow you to fix incorrectly configured wind settings in SpeedTree, as well as synchronize and adjust the wind for all vegetation separately. You can adjust the wind parameters for each vegetation individually.
Features:
- Wind setting.
- Advanced settings for visualization of vegetation.
- Support for all functions in Forward Rendering and Deferred Rendering.
- Good performance.
Only Built-in Render Pipeline.
For Unity version of at least 2019.1.8 (64-bit)
Current version 3.2
Information
This shader does not work with SRP (HDRP, URP)!
Attention! The speed of shader compilation when importing into a project depends on the power of your CPU in your PC. Initial compilation can take a lot of time, so wait for compilation, the shader is large and complex.
On the processor level i3-8100, i5-6600, AMD Ryzen 5 1400, compilation time will take more than 2 minutes.
I recommend importing this asset into a new project. Study the operation of the asset and copy the components you need to your project.
Shaders Settings (/ STC8)
Geometry
•
Billboard - billboard geometry type
•
Backface Culling - culling is an optimization that does not render polygons facing away from the viewer. All polygons have a front and a back side. Back - Don’t render polygons that are facing away from the viewer i.e. back-facing polygons are culled. Front - Don’t render polygons that are facing towards the viewer. Used for turning objects inside-out. Off - Disables culling - all faces are drawn. Used for special effects.
•
Alpha Cutoff - determine the cutoff point for the which areas will be shown. For "Billboard" and frond, leaf.
Texture and Color Settings
•
Main Texture (Transparency) - main texture, depending on the type of geometry, with or without transparency.
•
Hue Variation - enable hue variation, the hue depends on the set hue color, and the intensity of the hue depends on the position of the object in world space. In this way you can get many shades for the forest with one material.
•
Hue Color - color of the hue, HDR. Alpha channel also affects the intensity of the hue.
•
Main Color - main color, HDR. Final color hue depends on "Hue Color" and "Color and Light Tuning".
•
Extra Maps (Smoothness, Metallic, AO) - enable Extra Maps, disabled by default. You can use Extra Maps exported from SpeedTree 8, or create your own textures and pack them in Extra Maps using the
Extra Maps Creator.
•
Smoothness (R), Metallic (G), AO (B) - extra maps texture, green channel. R channel - Smoothness, G channel - Metallic, B channel - Ambient Occlusion.
•
Smoothness Strength - strength of the smoothness texture (Extra Maps R channel), according to the principle of contrast. HDR.
•
Smoothness Intensity - is a multiplier for smoothness texture (Extra Maps R channel). HDR.
•
Metallic Strength - strength of the metallic texture (Extra Maps G channel), according to the principle of contrast. HDR.
•
Occlusion Strength - strength of the occlusion texture (Extra Maps B channel), according to the principle of contrast. HDR.
•
Smoothness - by default, without a Extra texture map assigned, the smoothness of the material is controlled by a slider. This slider allows you to control the “microsurface detail” or smoothness across a surface.
•
Metallic - the metallic parameter of a material determines how “metal-like” the surface is. When a surface is more metallic, it reflects the environment more and its albedo colour becomes less visible.
•
Subsurface (Emissive) - enable emission, disabled by default. For the effect of subsurface emission (fake for deferred rendering path).
•
Subsurface (RGB) - subsurface texture, all channels.
•
Subsurface Color - subsurface emission color, HDR.
•
Subsurface Indirect - it is a combination of diffuse coefficient and indirect illumination.
•
Subsurface Rough - rough subsurface emission.
•
Normal Map - enable bump map, disabled by default.
•
Normal Map Texture - bump map texture.
•
Strength Normal - intensity of the bump map texture.
Color and Light Tuning
•
Enable Tuning - enable color and light tuning, disabled by default.
•
Light - vertex light, HDR.
•
Brightness - final color brightness, HDR.
•
Saturation - final color saturation, HDR.
•
Contrast - final color contrast, HDR.
Wind Settings
•
Wind Quality. None - disabled Wind. Fastest - highest performance, only basic parameters. Fast - high performance, basic parameters and leaf ripple. Better - quality and performance, basic parameters, leaf and branch ripple, branch twitch. Best - high quality, basic parameters, leaf and branch ripple, leaf tumble, branch twitch. Palm - high quality, basic parameters and palm settings.
•
Wind Speed - general wind speed.
•
Wind Amplitude - general amplitude of wind.
•
Wind Degree Slope - general amount of slope due to wind power.
•
Leaf Ripple - effect of leaf ripples using offset.
•
Leaf Ripple Speed - speed of leaf ripples.
•
Leaf Tumble - tumbling effect of the leaves, relative to the attachment point.
•
Leaf Tumble Speed - leaf tumbling speed.
•
Branch Ripple - effect of branch ripples using offset.
•
Branch Ripple Speed - speed of branch ripples.
•
Branch Ripple - effect of branch ripples using offset.
•
Branch Ripple Speed - speed of branch ripples.
•
Elasticity - elasticity of branches and leaves.
•
Turbulences - degree of turbulence effect.
•
Branch Force Wind - wind force acting on branches (along the X axis).
•
Branch Heaviness - wind force acting on branches from top to bottom (along the Y axis).
Deferred and Forward rendering path
The STC8 shader supports Deferred and Forward rendering paths. But due to the difference in rendering in the rendering paths of Deferred and Forward, the shader (material) settings for different rendering paths will be different.
Screenshots
License
This project is licensed under
MIT License