Shader

cosmos 28th May 2017 at 2:56pm
Computer graphics

Programs that often run on the GPU, to perform common operations needed in Computer graphics

  • Vertex shader – Takes a certain representation of a Scene, usually as Points (vertices), and transforms this vertices into another representation which is useful for latter processing. For instance, in OpenGL/WebGL, your vertices can be transformed to what is called clipspace, using Homogeneous coordinates, which are then automatically processed to project them as 2d points in the device screen. The 2d pixel coordinates corresponding to the vertices, as well as to all points inside the polygon primitives (often triangles) that go with those vertices, are often passed to the fragment shader, to decide which color they should appear as.
  • Fragment shader

WebGL shaders and GLSL