tezvyn:

Explain the roles of vertex and fragment shaders in WebGL

Source: developer.mozilla.orgintermediate

WHAT IT TESTS: GPU pipeline separation between geometry transform and pixel color. ANSWER OUTLINE: vertex shaders write gl_Position per vertex; fragment shaders write gl_FragColor per pixel. RED FLAG: swapping their outputs or claiming CPU/DOM access.

WHAT IT TESTS: your understanding of GPU pipeline separation between geometry transformation and per-pixel coloring. ANSWER OUTLINE: vertex shaders run once per vertex, manipulating 3D coordinates and writing gl_Position for clip-space projection; fragment shaders run once per pixel, computing RGBA and writing gl_FragColor. RED FLAG: confusing the two stages, saying fragment shaders operate on vertices, or claiming either shader accesses DOM or CPU memory directly.

Read the original → developer.mozilla.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Explain the roles of vertex and fragment shaders in WebGL · Tezvyn