A Javascript octree using threejs.
This octree uses threejs, but could easily be modified to use your own WebGL wrapper (the only thing used are the Vector classes and Mesh for visualization).
Maximum entities per node:
Octree.prototype.entities_per_node
Maximum depth:
Octree.prototype.max_depth
Reimplement Octree.prototype.intersects
function to suit your needs (eg. to intersect OBB, convex hull or else).