I am shipping my app. I am facing the issue of shaders and their representation. Should I embed shaders to code directly or use external file and load them via "fopen"?
For the first approach - in binary
1) faster load time
2) shaders are "less easy to copy" (but only for beginners, the text is visible in hex binary)
Against the first approach - in binary
1) Larger binary - more memory needed
2) Shader is basically loaded only once at startup
--
For the second approach - external file
1) Easier shader update - just edit file, no rebuild needed
2) Smaller binary - less memory needed
3) Unified Virtual File System - load everything with one logic
Against the scond approach - external file
1) Slower load (especially on mobile devices, where files are in resource - unpacking them may be slow)
What are your thought? For me, I am more inclined to the second approach - extrenal file, but maybe I am missing something?
↧