I haven't worked with webgl, but here are just some general OpenGL pointers you might find useful.
Don't worry about hiding bricks whom are blocked by others, let the OpenGL Z-Buffer handle that for you. This because OpenGL does the calculations anyway. Testing brick visibility yourself would probably be even slower as a result of the overhead.
Doing your own visibility tests is only useful when working with HUGE models, in such engines you could do pre-processing using frustum culling, in order to eliminate whole submodels (located behind the camera etc) before sending them to OpenGL.
Don't worry about hiding bricks whom are blocked by others, let the OpenGL Z-Buffer handle that for you. This because OpenGL does the calculations anyway. Testing brick visibility yourself would probably be even slower as a result of the overhead.
Doing your own visibility tests is only useful when working with HUGE models, in such engines you could do pre-processing using frustum culling, in order to eliminate whole submodels (located behind the camera etc) before sending them to OpenGL.