Table of Contents

Requirements and installation

Requirements

  • Unity 2022.3 or later. Shader Script is tested on Unity 2022.3, 6000.0, 6000.3 and 6000.6.
  • URP or HDRP, version 14 or later: the version that comes with your Unity version. You can have both installed at once; a shader then works on both.

The Built-in Render Pipeline isn't supported.

Some HDRP features have their own requirements, the same as for HDRP's own shaders: for example, ray tracing needs DirectX 12 and a GPU that supports ray tracing.

Installation

From the Asset Store

  1. Open Window > Package Manager.
  2. Select My Assets, find Shader Script and select Install.

From a package file

  1. Open Window > Package Manager.
  2. Select + > Install package from tarball (+ > Add package from tarball in Unity 2022.3) and choose the Shader Script .tgz file.

After installation

  • The Assets > Create > Shader Script menu appears, with templates for a URP or HDRP shader. Its URP and HDRP items appear only for the render pipelines installed in the project.
  • Scripts in the Assembly-CSharp assembly (scripts outside any assembly definition) can use Shader Script right away. For scripts in your own assembly definition, add Ahilevich.Shaderscript to its Assembly Definition References.
  • Your IDE shows the descriptions of Shader Script's types and methods in tooltips and code completion. If they don't appear, for example because the IDE was open while you installed or updated the package, restart the IDE.

A shader's .shaderscript asset is created when Unity compiles the shader's script. If a shader class has no .shaderscript asset next to it, for example because the project already contained the class when you installed the package, run Tools > Shader Script > Reimport All: it creates the missing assets and reimports every shader.

Next steps