Learning Shaders in Unity with Amplify Shader Editor

Ricardo Teixeira from Amplify Creations team overviewed their Amplify Shader Editor for Unity and talked about shader work in general.

What's Amplify Shader Editor

ASE is a community-driven shader editor for Unity inspired by professional development tools. We found that most editors available at the time of its conception were somewhat lacking and not extensible in any reliable manner that would allow users to adapt them to their specific pipeline requirements. Given our technical background and expertise in graphical computation, we began to develop our own vision of what a future-proof shader editor could be in an effort to offer a rich and complete feature set.

For beginners and professionals, our editor is designed to be easy to pick up by providing a familiar and consistent development environment based on Unity's own UI/UX conventions. Whether you’re looking to create your own game shaders, Sinespace compatible content, or even build a business around shader development at the Asset Store, our community and team are here for you.

Our editor is capable of creating shaders for both the legacy built-in renderer and the new Scriptable Rendering pipeline(HD/LW/URP). We include several shader types and samples to get you started, but our open approach allows users to extend its functionalities using our Custom Node API and Template system

Shader Work

Programing shaders can be hard for beginners. The initial learning curve will no doubt discourage many artists who might have an understanding of how things work but are unable to translate their ideas into functional code. Node editors, such as ASE, breaks down these barriers by allowing experimentation and iteration over a functional shader base without needing to write a single line of code.

You don't necessarily need to be a shader expert, but there are some basic concepts that users should learn in order to make the most out of any shader editor. Shader development books or online resources are a great way to get acquainted with the terminology used. A shader, a material, or even a texture for that matter, and how it relates to the lighting system are all basic concepts that you should learn before using the editor.

Anyone equipped with a basic Unity understanding can start creating simple shaders today, regardless of their area of expertise. We provide a simple Beginner's Guide that teaches users how to use basic techniques for creating interesting and useful effects such as Texture Blending or Animated Panning. The editor itself is quite easy to learn, the UI is simple and unobtrusive so you can focus entirely on your shader.

Simple Color Tint Shader example:

Start your shader development journey here: Amplify Shader Editor Beginners Series

There comes a point where you’ll need to dig deeper into the underlying math used in order to tackle advanced topics but, thankfully, shader development concepts are somewhat universal. There’s a multitude of knowledge out there that can help you improve your skills, don’t shy away from books or even tutorials aimed at other development environments, such as the Unreal Editor Material Editor.

It’s never too late to brush up on your math, Sebastian Lague’s channel and Catlike Coding are fantastic resources. We can’t recommend them enough along with one of our favorite books for beginners, “The Unity Shader Cookbook”.

Anatomy of a shader using a single texture:

Amplify Shader Editor equivalent:

How ASE Work

The editor functions by interpreting your node networks and automatically generating functional shader code, regardless of what you create. This means that you can iterate without running into syntax errors usually associated with programing your own shaders from scratch; you’re free to experiment. There are some exceptions but the Editor will do its best to warn you about possible issues before generating the actual shader.

Shaders created with ASE work just as shaders programmed manually and do not require the presence of the editor, which makes them very easy to distribute. Sharing snippets, or node networks as they are also known, is as easy as copying and pasting a link!

We simplify shader creation by including a set of templates that mimic the most common used shaders in Unity, such as the default Standard Metallic/Specular shaders or the new SRP HD variants. Users can quickly start working on what matters without worrying about what’s going on behind the scenes. Due to the editor's openness and expandability, this template system can be used to add other shader types more suitable to your project requirements; however, this is an advanced process that shouldn’t be necessary for most users, especially when starting out.

Interaction and editor performance play a big part in what makes ASE unique; its navigation is smooth and responsive while the shortcuts are simple and easy to get into. The minimalistic and clean approach to its UI and the ease in which you can manipulate multiple editor windows makes it seamlessly fit into your work environment instead of pulling you out of it.

Animating Shader Effects

There are a couple of techniques used to animate shader effects, some of the most common starting points being UV transforms panning/scale effects, vertex transforms, time-based value changes such as pulsating/flickering effects, lerping between values or sprite sheet animation.

It’s best to breakdown each effect before diving into the actual shader construction, carefully identifying which types you’ll need to construct and simplifying it ahead of time. A glowing fire effect could be easily achieved by using a time-based pulsating effect for the embers and a lerp to mix between regular and burned wood; top that with an additional emissive layer and bloom post fx and you have yourself a pretty cool looking shader.

Sometimes, all you need is a simple panning effect to get interesting results. Take this example below where we’re simply panning the UV position of the unwrapped model vertically.

It’s a simple but powerful technique that allows you to create a large variety of fx, such as the ASE radar shader below made by Jamie Degen.

You can also animate Material Properties, it’s a great way to get quick results when you’re starting off. In this community sample created by Gil Damoiseaux, he is deforming the mesh and overlaying the glowing metal color glow on top. The deformation is being handled by the shader but you could animate the material properties instead to manually control the effect.

Try to combine different techniques once you get more accustomed to shader development. The fire effect below uses a combination of panning, time-based value changes, vertex deformation, position-based variation and extra particles for the smoke/sparks.

ASE is quite useful when it comes to complex particle systems used for VFX. This is probably more suited for intermediate users but you will definitely take advantage of everything you learn from regular shaders when creating effects such as the flame haze below.

Shaders can quickly get out of hand when combining multiple effects, it’s important to consider using the least amount of instructions and textures possible and avoiding conditional statements. The performance will ultimately depend on the complexity of your operations so be sure to favor multiplication over division and consider using a lower precision value on lower-end devices.

Using ASE in Sinespace

If you already use ASE, you’ll be right at home when it comes to creating Sinespace content as there are no additional steps to make your shaders work with it. We’ve seen an increase in our Discord community since Sinespace has been made available, it’s a great place to find other Sinespace ASE shader creators.

There’s a lot you can do using only shaders! One of our ASE users, Xulain @SineSpace, has been developing a fake caustic system for his own Sinespace regions!

Future Development of ASE

ASE is strongly community-driven, we’re flexible when it comes to our roadmap, always on the lookout for suggestions and innovative solutions. Our own short/medium-term plans involve improving stability and polish, improve user experience and quality of life, additional shader templates to support all current and upcoming Unity features, new nodes and Shader Functions. As for our long-term plans, we have already begun researching our next-generation ASE iteration, in which we plan to roll out new shader types for raytracing and procedural texturing, as well as a handful of new ideas we're very keen on exploring.

We’ve also been improving our educational offer, having recently licensed the Vancouver Film School, we have a long term commitment to our community when it comes to shader samples and learning resources which we expect to add to in the future. We’re also intensively working on SRP support, both for the HD and Universal(Lightweight) pipeline, so you can expect it to be maintained for years to come.

Advice for Those Who Want to Start Creating Shaders

Start small, learn the basics before diving into more complex effects. If you’re struggling to create a specific effect, take a step back and examine each part of your shader to identify which areas you need to improve. Don’t be afraid to ask questions, join our Discord community and go into detail on what you want to build and which areas you’re having difficulty with.

Plan ahead, define what you want to create and which techniques you will need to use to achieve each step before placing a single node. There’s nothing wrong with tinkering and discovering things with some trial and error but you’ll improve your skills if you train yourself to recognize requirements and common shader development methods.

Learn what’s happening behind the scenes to improve your overall shader knowledge; this will help you immensely. From Unity specific to general shader development, there are many books out there to get you started. 

Practice as much as possible, try deconstructing you’re favorite effects and see if you can recreate them!

Ricardo Teixeira, Amplify Creations

Interview conducted by Daria Loginova

Keep reading

You may find this article interesting

Join discussion

Comments 1

  • Nikita Goncharuk

    Can someone tell me why I need to use the Amplify Shader Editor instead of the Shader Graph. I can't find a comparison anywhere

    0

    Nikita Goncharuk

    ·4 years ago·

You might also like

We need your consent

We use cookies on this website to make your browsing experience better. By using the site you agree to our use of cookies.Learn more