Hey guys,

I am currently working on my bachelor thesis which is about creating a 3D-Visualisation of a warehouse using the GWT plugin gwt-g3d.

I've come as far as being able to display the structual layout quite efficiently. Rendering 2 million+ vertextes at a decent framerate since i keep all the rendering within the shaders and minimize my gl.draw() calls. However I think i've come to a dead end using this technique since it is very static. What i need is a way to make my application more dynamic.
As I am used to object orientated programming in Java the shader language is quite hard to get my head around. Here's what I'm talking about...

I'm trying to render multiple areas (the number of these ares is UNKNOWN at initialisation) of my visualisation in a different manner (a different color to start with). So ive tried something like this within the fragment shader:

...
uniform vec3 alteredCoords[]; //a coordArray of positions that i want to render alternatively
...

// color each of these coords in grey
for (int i = 0; i < alteredCoords.length(); i++) {
if ( position.x == alteredCoords[i].x && position.y == alteredCoords[i].y && position.z == alteredCoords[i].z) {
gl_FragColor = vec4(100.0/255.0, 100.0/255.0, 100.0/255.0, 1.0);
return;
}
}

I know that this wont work as it is, because the array needs a constant size and there are casting issues.... try to ignore that for now since this wont work anyways because the shader language doesn't support dynamically sized arrays.

What i need is some sort of workaround for this issue...

any ideas?

Help please

EDIT:
to give you a better understanding of what i'm talking about here's a screenshot of what my layout looks like atm:



Notice that i've implemented my idea for a single area (grey square) already.... all i need is some way to dynamically render multiple areas that way