Shader Templates - Custom Shader Types

Learn all about the latest features and improvements.

Shader Templates - Custom Shader Types

Postby Amplify_Borba » Thu Feb 08, 2018 12:29 pm

Image

Shader Templates allow you to finally break free from standard surface shaders. No longer will you be limited to default shader types, it’s the ideal solution for custom shader pipeline requirements that take advantage of node-based shader authoring. Templates are just as regular Unity shaders but with special ASE tags placed at key points. Be sure to check the official wiki page for additional information.

Available Templates
* Post-Process
* Default Unlit
* Default UI
* Default Sprites
* Particles Alpha-Blended

With templates we are aiming to fill the gap of only being able to create surface shaders. This feature allows you to create an ASE shader from an already existing shader which will be used as base, or template ( hence the feature name ).

For you to create an ASE shader using templates you can hit the right mouse button on your project view, select Create > Amplify Shader and from that menu you'll be listed with the default ASE Surface Shader plus all the available templates.

Image

You can, at any time, swap which template your are using on a given shader by hitting the Shader Type dropdown option on your Output Node properties window and selecting a new one. You can even switch to our original default surface shader.

Mobile Friendly Templates

Sometimes what's needed is a specific vertex/frag shader that does a very simple job, for instance, particles, sprites, UI, etc. For these cases and others ASE allows the injection of shader code into pre-existing shaders that we call "templates". These are regular vertex/frag shaders that were modified by adding some tags the editor can read to know where to inject new code and what code already exists in the template.

Image

The reason they might be important for mobile shaders is that these templates can be extremely simple with barely any code at all. If the idea is to save performance, a generic unlit template can serve as a base to build upon since these are editable inside the editor and extra features can be added either by construction a more complex graph tree or by editing the original template. The only caveat being the user must have a bit of shader knowledge to edit or create the original template shader. Fortunately ASE already provides a few templates that any user can pick and use as any other shader.


Last but not least, we already have some examples created using templates. You can find them at AmplifyShaderEditor > Examples > Official > TemplateExamples.


Learn more: Official Wiki Page
Check out Amplify Shader Editor: Asset Store Page
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Return to Amplify Shader Editor - Features and Updates!

Who is online

Users browsing this forum: No registered users and 0 guests

cron