Previous | Next --- Slide 17 of 21
Back to Lecture Thumbnails
tplatina

As mentioned in class that the vertex processing and fragment processing is where vertex shader and fragment shader comes in, and also shadertoy was introduced in class, I want to know are there any other recommended materials of how to write shaders, and if there are any recommendations on which shader language to start with since I found the shader language of unity is not that intuitive as what I see on GLSL language. Thanks!

adrian_TA

@tplatina If you want to dive into shaders and low level graphics in general, check out learnopengl.com. This shows you how to start from scratch with modern APIs, building concepts like lighting.

If you're interested in Unity shader programming, the definitive guide in my opinion is Catlike Coding's Rendering Tutorial Series. After working through those (dense!) tutorials you will be an expert on rendering in games :).

For a lighter introduction, you can also consider trying Unity's shader graph, a visual interface for building shaders.

Febgreen

I am wondering why do we need the "Primitive Generation" process. What are the input and output of this step?

motoole2

The vertex generation and vertex processing steps in this pipeline operate exclusively on vertices, but they say nothing about how the vertices are connected! This is where the primitive generation comes into play. This part of the pipeline takes the list of vertices (expressed in terms of screenspace coordinates) as input from the Vertex processing step and a specific primitive type (triangle, quad, line, triangle trip, triangle fan, points, etc.), and generates the appropriate set of primitives as output.

This is similar how we "rendered" our cube in the first lecture. We performed all our processing of vertices in one step to compute screenspace coordinates (vertex generation, vertex processing) and then connected the vertices together to generate a bunch of lines (primitive generation).