On top of the low-level native plug-in interface, Unity also supports low level access to the shaderA small script that contains the mathematical calculations and algorithms for calculating the Color of each pixel rendered, based on the lighting input and the Material configuration. More info
See in Glossary compiler, allowing the user to inject different variants into a shader. It is also an event driven approach in which the plug-inA set of code created outside of Unity that creates functionality in Unity. There are two kinds of plug-ins you can use in Unity: Managed plug-ins (managed .NET assemblies created with tools like Visual Studio) and Native plug-ins (platform-specific native code libraries). More info
See in Glossary will receive callbacks when certain builtin events happen.
The shader compiler access extension definition exposed by Unity is to be found in IUnityShaderCompilerAccess.h and it’s provided with the editor.
These extensions are supported for now only on D3D11. Support for more platforms will follow.
In order to take advantage of the renderingThe process of drawing graphics to the screen (or to a render texture). By default, the main camera in Unity renders its view to the screen. More info
See in Glossary extension, a plug-in should export UnityShaderCompilerExtEvent. There is a lot of documentation provided inside the include file.
A plug-in will get called via UnityShaderCompilerExtEvent whenever one of the builtin events is triggered by Unity. The callbacks can also be added to CommandBuffers via CommandBuffer.IssuePluginEventAndData or CommandBuffer.IssuePluginCustomBlit command from scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary.
In addition to the basic script interface, Native Code plug-ins in Unity can receive callbacks when certain events happen. This is mostly used to implement low-level rendering in your plug-in and enable it to work with Unity’s multithreaded rendering.
Headers defining interfaces exposed by Unity are provided with the editor.
Unity provides an interface (IUnityShaderCompilerExtPluginConfigure) to which the shader compiler access is configured. This interface is used by the plug-in to reserve its own keyword(s) and configure shader program and gpu program compiler masks ( For what types for shader or GPU programs the plug-in should be invoked )
New feature in Unity 2017.1 NewIn20171
2017–07–04 Page published with no editorial review
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thanks for helping to make the Unity documentation better!