Skip to content

Use Unity's timeline to blend material properties

Notifications You must be signed in to change notification settings

D4KU/unity-material-timeline

Repository files navigation

This is a Unity Timeline extension to animate and blend material properties. It consists of two custom tracks:

Track Description
Material Track Change properties of a material directly, changing it everywhere in the scene.
Renderer Track Overwrite a selection of a renderer's material slots, changing only one specific object.*

* Material Property Blocks are used, so instancing isn't broken.

Features

Material Track Renderer Track
Layers (a.k.a. Override Tracks)
Clip extrapolation
Set/Blend Float/Range/Color/Vector
Set/Blend* Texture2D/RenderTexture
Set/Blend Texture Tiling/Offset
Set Texture3D
Blend Texture3D
Set CubeMap
Blend CubeMap
Overwrite with entire Material**

All blending can be done between two clips, or with the original value set in the material.

* See Use texture blending for how to activate this feature.
** Just uses Material.Lerp internally, so it's not able to blend textures.

Installation

In your project folder, simply add this to the dependencies inside Packages/manifest.json:

"com.d4ku.material-timeline": "https://github.com/D4KU/unity-material-timeline.git"

Alternatively, you can:

  • Clone this repository
  • In Unity, go to Window > Package Manager > + > Add Package from disk
  • Select package.json at the root of the package folder

Use texture blending

This package ships a shader to blend textures, named TextureBlend. To tell Unity to include it in builds, even if no scene has a dependency to it, add it to the list of always included shaders under ProjectSettings > Graphics. Without this shader the package functions normally, but textures are switched instead of blended.

About

Use Unity's timeline to blend material properties

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published