Hi all

Been reading these forums for ages a learnt loads so thanks for that to start with

I have recently (today) decided to write a new tool which should replace an artists repetitive task of creating illumination volumes for our game engine. Each volume has a gridded point cloud inside it storing lighting information in 3 dimension making them quite memory heavy

unfortunately im not happy with the solution i have come up with and thought i would ask for some input before continuing.

Currently any room that an artist models needs these illumination volumes created manually. Each volume is represented by a simple world aligned box. The number of volumes per room should be as low as possible with as little wastage as possible outside the graphics geometry

For example, if a room is in a L shape the artist would create 2 boxes to encompass the room, one covering the length of the room and another covering the area around the corner, easy by hand

My current script looks at the bounds of the object in plan view generates points in the xz plane based on a stride value, fires rays up into the geometry to see if it hits

If it does it will create a box the height of the first and last intersect point so to cover the whole height of the room positions the box and steps onto the next point

This gives me a lot of tall boxes, i combine these based on bounds and object centres if they are within a tolerance. The combinations only test to see if the x and y component are the same as the z definitely will be

The problem im having is because these volumes are generated in strips running along the x at the stride intervals then moving across to the next row (y) some of the time there will be very long thin volumes which the game engine doesent like, and because each volume must overlap slightly to ensure a smooth transition this is not a great solution

Any suggestions on how to generate volumes that encompass all of a mesh with as little of the volumes outside the geometry as possible would be greatly appreciated, I was thinking about using octrees to somehow find the extremes of the graphics mesh? if the subdivided octree has a single vertex contained and is furthest away from the bounds center then it should be the border, not sure that would work.

Any help would be greatly appreciated

Thanks in advance

d.b