Home

Awesome

Slang Unity Plugin

This is a plugin to use Slang code from within Unity ShaderLab shaders. It adds 2 new asset types, .slangshader and .slang. The .slangshader asset type is like a regular Unity shader, but where you can write Slang code in CGPROGRAM and CGINCLUDE blocks. The .slang asset type is just a shader include file.

For more information about Slang, check out their website.

Installation

Either clone the repo and add it as a local package, or add the package directly from the Unity package manager using the git link https://github.com/pema99/SlangUnityPlugin.git:

image

Alternatively, if you are VRChat Creator Companion user:

Caveats

This plugin was mostly made for me to play around with the Slang language inside of Unity, and at some point out of stubbornness. Adding support for a new shading language entirely from within user code, isn't exactly a supported usecase, and for this reason, the plugin makes use of several undocumented features and engine hacks/tricks. It should "just work" for most use cases, but there are some noteworthy unsolved caveats: