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

Coding our lit PBS shader logic

Alright, we now have a nice structure for our PBS lit shader with the proper keywords and include statements. We also know what our data structures look like, so the next step is to discuss how to compute all these fields and fill in the logic to use all of this.

In the upcoming sections, we will prepare the various properties that our shader will offer to users to better control the shading result, then see how to initialize our SurfaceData and InputData structures, and finally, design the vertex and fragment shader functions.

Preparing our shader properties

We saw in the Discovering Unity PBR-related tooling section that we wanted our shader to support the most frequent PBS options – albedo, metallic or specular reflections, occlusion, normals, and so on.

Of course, we want our users to be able to tweak all of these parameters, so we want to expose various properties in the inspector panel for them. Let’s have a look at each...

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