After creating a single PlaneGeometry instance, I proceeded to create 200 meshes that share this geometry and each have their own unique shaderMaterial instance. Below is a simplified version of the code snippet:
...
var geom = new THREE.PlaneGeometry(10,10,2,2);
var meshes = [];
var material=null;
for (var i=0 ; i<200 ; i++)
{
var elevations = getElevations(i); //return an array of 9 values, with different values for each mesh
var mat = new THREE.ShaderMaterial({
vertexShader : vsAlti, //process displacement on y coordinate of the vertex
fragmentShader : fsAlti,
attributes : { elevation : { type : 'f',value : elevations }}
};
meshes.push(new THREE.Mesh(geometry , mat));
}
...
Despite having different elevation attribute values for each mesh in the array, it seems that only one value is being applied to all meshes. It appears that only one instance of shaderMaterial is being applied to all meshes, when the expected behavior would be for each mesh to have its own matching shader.
Edit :
You can view the jsfiddle here: http://jsfiddle.net/McNulty/L584j/119/