Builtin Unity shaders source

Source code for Unity built-in shaders can be always found here: Download Archive

The source code is provided for reference and learning purposes. You don’t need to put the shaders into your project; they’re all built-in. If you do, be sure to modify shader name at start of the file, otherwise names will collide with the builtins and it will be confusing which one means which.

13 Likes

Thank you Aras

This is must learn for me.

I seemingly did need to put these into my project, and I don’t see any problems arising due to the names. Any reason for this? I guess I’ve been using Unity successfully in some kind of cripple state, but I have no idea what is going on.

No, you don’t need to put them into your project. These are the sources if you want to develop your own shaders and want to take a look at how built-in ones are done.

Presumably your Unity installation is corrupt (or maybe you’re out of disk space?). Try reinstalling Unity.

For any other neophytes that seem to have this problem, just get out of debug mode and pick your shader then. Thanks, Daniel!

Updated with Unity 2.0 and 1.6.2 shaders.

When someone has a chance, could we please have the 2.1 shader update?

Thanks,
-Jon

http://unity3d.com/download_unity/builtin_shaders.zip is always the latest deployed version, we have an automatic process that uploads the release.

4 Likes

Even better, thank you!

Edited the initial post, now always links to latest shaders.

Thank you! :twisted:

If I want to deliberately replace one of the builtin unity shaders with a slightly modified one, how would I do that ?

If I add it to my project with the same name… which one will be used ?
for example the vertex_lit shader that unity uses on the detail objects. like bushes and rocks.

if you add your own one with the same name, yours will override the builtin one.

thats how the SM3 enhanced terrain shader (showcase board) works :slight_smile:

awesome, thanks

@Aras: With the file replaced with the latest R3 release, where can I find the Unity 2.6.1 builtin shaders zip file?

[edit]
got it: http://download.unity3d.com/download_unity/builtin_shaders-2.6.1.zip

here is 3.2 versions sources :

http://download.unity3d.com/download_unity/builtin_shaders-3.2.0.zip

As Aras said, the link in the first post always has the current shaders.

I downloaded the file that contains the source code for the built-in shaders, but the (plain) “Specular Shader” isn’t in there. I was hoping to see how it creates that beautiful, realistic glow which the other specular shaders in Unity don’t seem to produce.

Welcome to the forum, HonoraryBob!

The code for the Specular shader (at the root of the menu) is actually included in the archive but the filename is a bit misleading - it’s in the Normal-Glossy.shader file.

Hi Aras, Are the 3.5 beta shaders available? Im getting some requests to make my shader pack compatible to the new functionality.
If I’ve missed a thread some where id be happily re directed to it.

Cheers
Brn