Jesse-V/iVoxely

Optimize ShaderManager

Jesse-V opened this issue · 1 comments

The string operations carried out by the ShaderManager take a significant amount of time to complete. Assembling the shaders for 64_64_64 cubes with no caching takes approximately 40 minutes on my computer. This needs to be faster. The data structures used could be changed, multithread it, etc.

This may not be entirely the ShaderManager's fault. I'd like to profile this and see exactly where the time is spent. It could be that the delay is coming from sending the data down to the GPU.

Caching the shaders and reusing them should be extremely helpful, since there are only a relatively limited number of voxels. If the shader for the "dirt" voxel was cached and then recycled for all voxels representing dirt, then theoretically hundreds of thousands of dirt voxels could be created with little performance penalty.