Extend or change the asset shader
The asset was designed with the most common use cases in mind. This means that the effect order and features have been carefully crafted to cover the most frequent project requirements. However, these carefully designed defaults may not perfectly match your specific project’s unique needs. In such cases, you may want to modify a particular effect’s implementation, change effect execution order, or add entirely new effects. Let’s explore these customization options.
Before we start, let’s cover the basics. The main shader file is located here:
Assets/Plugins/AllIn1Assets/AllIn13DShader/Shaders/Generic Shaders/AllIn13DShader.shader
In this file we’ll add or change the base properties of the shader that the effects use.
You don’t need to worry about the other shader variants files since the asset will automatically update them based on the changes made to the base “AllIn13DShader” file.
The main shader only defines the shader properties and shader passes, the rest of the code is scattered across the files in AllIn13DShader/Shaders/ShaderLibrary. You only need to know about these:
- AllIn13DShader_ShaderFeatures: Shader keywords that define the effects
- AllIn13DShader_FragmentEffects: Fragment Shader or Color effects code
- AllIn13DShader_AlphaEffects: Alpha or Transparency effects code
- AllIn13DShader_VertexEffects: Vertex or Mesh effects code
- AllIn13DShader_UVEffects: Uv or Texture Coordinates effects code
- AllIn13DShaderCore: Order of the effects
Now that we’ve covered the basics, let’s get into the steps to make custom changes to better match your requirements.
Modify effect implementation
Section titled “Modify effect implementation”First we’ll need to localize the shader keyword of the effect we need to change. Say we want to change the Hue Shift effect code. So we’ll go into the Material Inspector, hover the mouse over the effect and we’ll get the shader keyword name (the name of the effect in code):

From version 2.81 you can also right click the effect and pick Copy keyword, which puts it on the clipboard.
Alternatively, you can also enter the main shader and look for “Hue”, there you’ll find the Keyword name in the [Toggle(SHADER KEYWORD)]:

Once you have that, open the relevant effects file. In this case, since it’s a color effect, we’ll open “AllIn13DShader_FragmentEffects” and look for the shader keyword “_HUE_SHIFT_ON” and we’ll find:

And if we Ctrl+Click on the HueShift method or Ctrl+Shift+F “HueShift(” we’ll find the effect implementation that we can change however we want:


Change the effect order
Section titled “Change the effect order”Just like before, we’ll first locate the shader keyword, once we have it, we’ll go into the “AllIn13DShaderCore” file. If we search again for the Hue effect shader keyword we’ll find it here:

To change the order of the effect we just need to move this block or code up or down. For example if we want the Hue Shift to happen after the Contrast And Brightness effect, we’ll move it to after the _CONTRAST_BRIGHTNESS_ON block.
Add a new effect
Section titled “Add a new effect”The easiest way to add a new effect is to find a similar one and repicate what it’s doing. Since we are using Hue Shift as an example let’s make a new test color effect called “Color Tint Sine” that will do a tint animation using a sine wave. Probably a terrible effect, but let’s do it for teaching purposes.
1.Let’s start at the base “AllIn13DShader” file, look for the Hue Shift reference we are using and add the properties for our new effect:

Here I copied the whole Hue Shift block and started renaming and tweaking the properties to match the new effect requirements.
2.Next step is to declare the shader keyword. To do so we’ll go into “AllIn13DShader_ShaderFeatures” and create the new shader keword that we already defined in step 1 (inside the [Toggle(SHADER KEYWORD)]:
#pragma shader_feature_local _HUE_SHIFT_ON#pragma shader_feature_local _COLOR_TINT_SINE_ON3. Declare the shader properties so that the effect code can use them. To do so we open AllIn13DShader_BufferPropertiesDeclaration.hlsl, which both render pipelines use, find how Hue Shift is doing it and replicate it with our new properties:
#if defined(_HUE_SHIFT_ON) || defined(ALWAYS_DECLARE_PROPERTY) DECLARE_PROPERTY_FLOAT(_HueShift) DECLARE_PROPERTY_FLOAT(_HueSaturation) DECLARE_PROPERTY_FLOAT(_HueBrightness)#endif
#if defined(_COLOR_TINT_SINE_ON) || defined(ALWAYS_DECLARE_PROPERTY) DECLARE_PROPERTY_FLOAT(_TintSineSpeed) DECLARE_PROPERTY_FLOAT4(_TintSineColor)#endif4.Finally we add the effect code. We’ll go to “AllIn13DShaderCore”, search again for the shader keyword “_HUE_SHIFT_ON” (the effect we are using as a template) and add the effect logic right below it like this. Where you add it is also where it runs, as in Change the effect order:

For a longer effect, write it as a function in “AllIn13DShader_FragmentEffects”, the way HueShift is written there, and call it from this spot in “AllIn13DShaderCore”.
This implementation is just an example. With these knowledge and using other effects as a template I’m sure you’ll able to create any effect you wish. Also using ChatGPT or Claude may be helpful to you in this process since these tools are very good at following patterns to generate new content and code.
