A method and system of increasing the speed of a ray-casting algorithm for producing direct volume rendering images in the melt-through interaction mode. Since the viewing direction is not changed during a melt-through interaction, it is possible to reuse the samples calculated along each ray from one frame to another. The samples along each ray are partitioned into different groups, and the samples within each partition can be composited to generate an RGBA-tuple (Red Green Blue and Alpha, which is an opacity factor) for the partition. The associative property of the composition operation allows computation of the final RGBA value for each ray by compositing the RGBA-values of the partitions, instead of compositing the RGBA-values of each sample along the ray.