Reader small image

You're reading from  Become a Unity Shaders Guru

Product typeBook
Published inJul 2023
Reading LevelN/a
PublisherPackt
ISBN-139781837636747
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Mina Pêcheux
Mina Pêcheux
author image
Mina Pêcheux

Mina Pêcheux is a freelance content creator who has been passionate about game development since an early age. She is a graduate of the French Polytech School of Engineering in applied mathematics and computer science. After a couple of years of working as a data scientist and web developer in startups, she turned to freelancing and online instructional content creation to reconnect with what brightens her days: learning new things everyday, sharing with others and creating multi-field projects mixing science, technology, and art.
Read more about Mina Pêcheux

Right arrow

Having a peek at shader includes and tags

After this quick overview of the new shader script structure for URP, we now know that there has been an important change with the includes.

Thus, to better understand why and how it has changed, let’s briefly discuss how to import the new core shader tools for URP/HLSL shader scripts and how to update some of our most common built-in variables and function calls provided via macros. We will then talk about the two important shader tags you need to be aware of when writing shaders for URP.

Including the URP core module

As we discussed in the Structuring a Unity HLSL shader section, the new HLSL-based shader scripts cannot use the classic .cginc shader includes, as their predecessors did. Because they are based on the HLSL language, they have to include libraries written in that language, and more precisely in our case, modules from the new URP shader library.

The most common is the following:

#include "Packages/com...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Become a Unity Shaders Guru
Published in: Jul 2023Publisher: PacktISBN-13: 9781837636747

Author (1)

author image
Mina Pêcheux

Mina Pêcheux is a freelance content creator who has been passionate about game development since an early age. She is a graduate of the French Polytech School of Engineering in applied mathematics and computer science. After a couple of years of working as a data scientist and web developer in startups, she turned to freelancing and online instructional content creation to reconnect with what brightens her days: learning new things everyday, sharing with others and creating multi-field projects mixing science, technology, and art.
Read more about Mina Pêcheux