A method of rendering a scene by ray tracing using an acceleration structure for testing ray intersections with a three dimensional scene geometry represented by a plurality of surface primitives, comprising merging a first and a second input hierarchy to form a merged hierarchy, wherein each of the first and second input hierarchies is a multi-level linked structure comprising multiple levels, each level comprising one or more nodes, and wherein each node (802; 812) represents a region of space (702; 712) and references zero or more lower level nodes (804 0, 804 1; 814o, 814,) representing regions (704 0, 704 1; 714 0, 714 1) contained in said region of space (702; 712), wherein nodes that do not reference lower level nodes are leaf nodes, and wherein the regions of space represented by the nodes of each of the first and second input hierarchies comprise spatial positions of a respective set of one or more objects to be rendered in the scene, each object being composed of surface primitives contained in leaf nodes (806 0, 806 1, 806 2, 806 3, 806 4; 814 1, 816 0, 816 1), and wherein each non-leaf node in the first and the second input hierarchies is associated with a sub-hierarchy within the corresponding input hierarchy descending from said node as the root node, the method characterised by comprising: for each of the first and second input hierarchies, identifying a level as a merging level, wherein a level is identified as the merging level based on the amount of spatial overlap between the one or more sub-hierarchies descending from the one or more nodes of said identified level in the first input hierarchy and the one or more sub-hierarchies descending from the one or more nodes of said identified level in the second input hierarchy being greater than a threshold, and identifying the sub-hierarchies in the first and second input hierarchies descending from nodes of the merging level as the sub-hierarchies to be included in the merged hierarchy; parsing the first and second input hierarchies between the top level and the merging levels to identify leaf nodes, if any, existing in those levels of the input hierarchies to be included in the merged hierarchy; building a node of the merged hierarchy which references the nodes (804 0, 804 1, 814 0, 814 1) of each of the identified sub-hierarchies comprised in a level which is one level below the merging level, wherein the built node represents a region of space including the regions of space (704 0, 704 1, 714 0, 714 1) represented by the nodes of each of the identified sub-hierarchies comprised in a level which is one level below the merging level; storing said built node of the merged hierarchy and storing indications of the references between the built node of the merged hierarchy and the referenced nodes (804 0, 804 1, 814o, 814 1) of the identified sub-hierarchies, and storing for each identified leaf node, if any, indications of one or more primitives to indicate which primitives are present within the region of space represented by the leaf node; and using the merged hierarchy as the acceleration structure for rendering the objects. for each of the first and second input hierarchies, identifying a level as a merging level, wherein a level is identified as the merging level based on the amount of spatial overlap between the one or more sub-hierarchies descending from the one or more nodes of said identified level in the first input hierarchy and the one or more sub-hierarchies descending from the one or more nodes of said identified level in the second input hierarchy being greater than a threshold, and identifying the sub-hierarchies in the first and second input hierarchies descending from nodes of the merging level as the sub-hierarchies to be included in the merged hierarchy; parsing the first and second input hierarchies between the top level and the merging levels to identify leaf nodes, if any, existing in those levels of the input hierarchies to be included in the merged hierarchy; building a node of the merged hierarchy which references the nodes (804 0, 804 1, 814 0, 814 1) of each of the identified sub-hierarchies comprised in a level which is one level below the merging level, wherein the built node represents a region of space including the regions of space (704 0, 704 1, 714 0, 714 1) represented by the nodes of each of the identified sub-hierarchies comprised in a level which is one level below the merging level; storing said built node of the merged hierarchy and storing indications of the references between the built node of the merged hierarchy and the referenced nodes (804 0, 804 1, 814o, 814 1) of the identified sub-hierarchies, and storing for each identified leaf node, if any, indications of one or more primitives to indicate which primitives are present within the region of space represented by the leaf node; and using the merged hierarchy as the acceleration structure for rendering the objects.