code: static private GVRMaterial getMaterial(final GVRContext gvrContext,
              JSONObject materialSpec) throws JSONException, IOException {
  
          GVRShaderId shaderId = getShaderId(materialSpec);
          GVRMaterial material = new GVRMaterial(gvrContext, shaderId);
  
          final Iterator<String> iter = materialSpec.keys();
          while (iter.hasNext()) {
              final String key = iter.next();
              switch (MaterialProperties.valueOf(key)) {
                  case color:
                      final float[] color = getJSONColorGl(materialSpec,
                                                                 key);
                      material.setColor(color[0], color[1], color[2]);
                      break;
                  case ambient_color:
                      final float[] ambientColor = getJSONColorGl(materialSpec, key);
                      material.setAmbientColor(ambientColor[0], ambientColor[1],
                                               ambientColor[2], ambientColor[3]);
                      break;
                  case diffuse_color:
                      final float[] diffuseColor = getJSONColorGl(materialSpec, key);
                      material.setDiffuseColor(diffuseColor[0], diffuseColor[1],
                                               diffuseColor[2], diffuseColor[3]);
                      break;
                  case specular_color:
                      final float[] specularColor = getJSONColorGl(materialSpec, key);
                      material.setSpecularColor(specularColor[0],
                                                specularColor[1],
                                                specularColor[2],
                                                specularColor[3]);
                      break;
                  case specular_exponent:
                      material.setSpecularExponent((float) materialSpec
                              .getDouble(key));
                      break;
                  case opacity:
                      material.setOpacity((float) materialSpec.getDouble(key));
                      break;
              }
          }
  
          TextureFactory.loadMaterialTextures(material, materialSpec);
  
          return material;
      }
docs: TODO: MaterialFactory