Let's begin this chapter by taking a look at how we can access the information of a model's vertex using the vertex function in a Surface Shader. This will arm us with the knowledge to start utilizing the elements contained within a model's vertex to create really useful and visually appealing effects.
A vertex in a vertex function can return information about itself that we need to be aware of. You can actually retrieve the vertices' normal directions as a
float3 value, the position of the vertex as
float3, and you can even store color values in each vertex and return that color as
float4. This is what we will take a look at in this recipe. We need to see how to store color information and retrieve ...