What is the main difference between raster and vector fonts?
What is a Canvas and what can it do?
Name any 3 UI Elements
A shader is a program that runs in the rendering pipeline and tells the GPU how to render each pixel
A list of properties that can be set in a material's inspector
Properties
{
_MainTex("Texture", 2D) = "white" {}
_Intensity("Tint Intensity", Range(0, 1)) = 0.1
_Color("Tint", Color) = (1.0, 0.1, 1.0, 1)
}
Properties Documentation
Used for calculating how light reflects off of objects. Are per vertex - NOT per face!
The process of projecting a 2D image to a 3D surface
Works on vertex data from the mesh. Called once for each vertex. The most basic use is mapping vertex positions from object space to clip space.
// The data that will be read from the mesh
struct appdata
{
// The position of the vertex in object space
float4 vertex : POSITION;
};
// The data that will be passed to the fragment shader
struct v2f
{
float4 vertex : SV_POSITION;
};
// The vertex shader function
// It takes data from the mesh
v2f vert(appdata v)
{
v2f o;
// And converts the position from object to clip space
o.vertex = UnityObjectToClipPos(v.vertex);
return o;
}
The process by which a primitive
(most often a triangle) is converted to a 2D image
// The fragment shader function
// Gets interpolated data from the vertex shader in a v2f
float4 frag(v2f i) : SV_Target
{
// And uses it to produce some color
float4 color = float4(i.uv, 0, 1);
return color;
}
When handling transparent textures the process of merging the current pixel with the pixel "below" in the scene is called blending
We can get the final texture before it is rendered to the screen with the OnRenderImage method and apply a material to it with Graphics.Blit