I just did a push with some usability updates. I added a field flag so the gui inspector can display buttons instead of the hacked checkboxes:
If anyone wants to try it out you just place the volume around the area you want to use it on and then go through the steps from top to bottom. voxelSize
: size of each voxel in torque units. When you change this you need to regen volume. regenVolume
: voxelizes the area within the area and clears all the light and propagation grids. You can visualize it the editor with showVoxels. injectLights
: pulls the pointlights from the scene (pointlights only for now, will add spot and sun very soon), visualize in editor with showDirectLight. propagateLights
: propagates the lights through the grid. You can press this as many times as you want until you get a result you like. Visualize it in the editor with showPropagated.exportPropagated
: exports the results of propagation to the GPU to be displayed. exportDirectLight
: exports the results of injectLights to be used for reflections (optional). Check off renderReflection to enable the shader to display reflection within the volume. This property will save with the volume so you can turn it on/off.
Lastly, saveResults/loadResults. This exports the results from your propagation grid, and your direct light grid to the file path chosen in fileName. These results are loaded back in when the mission loads (or when you press the load button). These final results hold only what it needs to send to the GPU. You cannot propagate them further or work with them in the editor when you load from saved files. You have to start back at regenVolume and go through all the steps again. By doing it this way the final results are loaded straight to the GPU from temp buffers. This gives minimal memory usage when using them in a game.