Hardware-Related Issues

This manual section describes typical hardware and implementation-related issues that can happen during development of a WebGL application.

Too Many Attributes

Once in a while when working on your scene you may face a problem where some objects are not rendered at all and the browser console shows the following error:

"Too many attributes" error in the browser console

This error means that some objects (apparently, the ones that couldn't be rendered) surpass the maximum amount of vertex attributes that can be used per shader.

How many attributes an object uses depends on different factors: the presence and the number of shape keys (Blender) / morph targets (3ds Max) / blend shapes (Maya), the presence of skinning, certain material nodes, etc...

Here's the table that explains how to calculate the number of attributes used:

Number of Attributes Description
3 Mandatory attributes: position, normal, uv.
+2x Add for each shape key (Blender) / morph target (3ds Max) / blend shape target (Maya). Maximum amount of attributes for this category is capped to +12.
+2 Add if the object uses skinning.
+1x Add for each of the following nodes in the object's material that use different* vertex colors:
  • Blender: Attribute, Vertex Color
+1x Add for each of the following nodes in the object's material that use different* uv maps except the first one (already covered by the mandatory uv attribute, see the first row):
  • Blender: UV Map
  • 3ds Max: Bitmap (only if "Mapping Type" set to "Texture"), Gradient Ramp, Noise (only if "Mapping" set to "Explicit Map Channel")
  • Maya: place2dTexture
+1 Add if the object's material has one of the following nodes:
  • Blender: Normal Map, Tangent (only in "UV Map" mode)
  • 3ds Max: Normal Bump
  • Maya: aiNormalMap, bump2d (only if the "Bump Interp" input > 0), samplerInfo
+1 Add if the object's material has one of the following nodes:
  • 3ds Max: Vertex Color

*if several nodes use the same vertex color or a uv map then all those nodes count as a one node towards the limit.

Generally, it's enough to stay in the limit of 16 vertex attributes (although some old / low-end devices can support only 8). Most often you should be concerned only about objects that use several shape keys. Other than that the amount of vertex attributes usually stays under the limit for a typical object/material.