tezvyn:

In WebGL, what is the difference between attributes and uniforms?

Source: webglfundamentals.orgadvanced

Tests per-vertex versus per-draw-call data flow. Attributes vary per vertex from buffers; uniforms are constant per draw call. Cite vertex positions as attributes and an MVP matrix as uniform.

Tests whether you deeply understand WebGL shader data flow and the cost of per-vertex versus per-draw-call state. A strong answer defines attributes as data pulled from bound buffers via vertexAttribPointer, yielding one value per vertex, and uniforms as values set with gl.uniform calls that stay constant for the entire draw call. It gives a concrete example such as vertex positions as attributes and a model-view-projection matrix as a uniform.

Read the original → webglfundamentals.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.

In WebGL, what is the difference between attributes and uniforms? · Tezvyn