mtwoodard/hypVR-Ray

Improve initialization speed.

mtwoodard opened this issue · 2 comments

I've been trying to figure out what has been causing the initialization of the program to slow down so much. Once loaded the program runs smoothly so I figure it must be something to do with the loading of the shader files. I did find this response to someones question regarding loading a large file on stack overflow A commenter mentions that the way three loads files uses excessive memory. I think this is likely our issue.

A possible solution would be to break up the shader file into more digestible parts. I went ahead and tried this method for the time being since it's relatively simple.

Another option would be to either find some other loading library for loading large files to strings or to write our own. Both of these options would likely be the best solutions however would take a little while to implement.

So I've asked around on a few different forums and apparently this slow down could be due to shader compiling to directx hlsl code on Windows devices. Windows can use native opengl or a intermediary called angle that may be able to help us Mr Doob has written about it here.

We can also run the program on Mac or Linux. As there is no DirectX to compile to it will just compile normally to OpenGL instead. You can read about this further on this post or this post.