{
  "name": "@exercise/shader-attributes",
  "version": "1.0.0",
  "main": "server.js",
  "dependencies": {},
  "scripts": {
    "start": "node server.js"
  },
  "readme": "# Exercise\n\nFor this exercise, you are given a program which will draw a colored triangle, however the attributes are initially screwy.  To fix this, you should switch the location of the color and position attributes.  That is, you must:\n\n* Set the location of the position attribute to `0`\n* Set the location of the color attribute to `1`\n\n# Attribute Locations\n\nIn addition to uniforms, the way to get data into a shader is with attributes.  Attributes are processed by the vertex shader and used to generate primitives, which are then rasterized by the GPU.\n\nIn this lesson, we are going to go through some of the first steps of setting up attributes for a program.\n\nLike uniforms, each vertex attribute is bound to a *location*. However, unlike uniforms these locations can be specified by the user. Attribute locations are represented by integers and data stored in buffers (more on this later) can be accessed from them.\n\nTo set an attribute location, you must call the `bindAttribLocation` command on a program object **BEFORE** linking. For example,\n\n```javascript\nvar program = gl.createProgram()\n\n// ... set up shaders, etc.\n\ngl.bindAttribLocation(program, 0, 'position')\ngl.linkProgram(program)\n```\n\n## `gl.bindAttribLocation(program, index, name)`\n> Sets the location of the attribute called `name` in `program` to `index`.\n\nThe location of an attribute must be between `0` and `gl.MAX_VERTEX_ATTRIBS-1`\n",
  "readmeFilename": "README.md",
  "description": "For this exercise, you are given a program which will draw a colored triangle, however the attributes are initially screwy.  To fix this, you should switch the location of the color and position attributes.  That is, you must:",
  "_id": "@exercise/shader-attributes@1.0.0",
  "_shasum": "3d37bcede5f207fef7f5258e39e472df832d866d",
  "_from": "exercises/shader-attributes",
  "_resolved": "file:exercises/shader-attributes"
}
