This paper presents a novel approach that uses graphics hardware to dynamically calculate a voxel-based representation of a scene. The voxelization is obtained on run-time in the order of milliseconds, even for complex and dynamic scenes containing more than 1,000,000 polygons. The voxelization is created and stored on the GPU avoiding unnecessary data transfer. The approach can handle both regular grids and locally optimized grids that better fit the scene geometry. The paper demonstrates applications to shadow calculation, refraction simultation and shadow volume culling/clamping.