Horde3D
http://horde3d.org/forums/

Shipping precompiled shaders?
http://horde3d.org/forums/viewtopic.php?f=2&t=1608
Page 1 of 1

Author:  johannes [ 13.12.2011, 14:32 ]
Post subject:  Shipping precompiled shaders?

Is there a simple way to precompile shaders instead of shipping .shader files with readable source with the executable?

Also, is there a suggested C++ container format to throw all ressource files into so I don't have to ship thousands of small files? Maybe just an uncompressed zlib wrapper used for streaming is a good idea, but I am not sure how well that would work.

Author:  DarkAngel [ 14.12.2011, 02:58 ]
Post subject:  Re: Shipping precompiled shaders?

GLSL simply doesn't support precompiled shaders :cry:

For file storage, we LZMA compress each file individually, then append them all together into a big binary blob with a table-of-contents (name to offset look-up table) at the start.

Author:  johannes [ 14.12.2011, 12:14 ]
Post subject:  Re: Shipping precompiled shaders?

:( Okay then, maybe I''ll just hardcode some checksum stuff into my code to make sure the users don't use modified shaders.

After careful selection, I just decided for PhysFS (http://icculus.org/physfs/), which seems pretty decent and can use 7zip (amongst a lot of others) as you suggested. Thank you for your help! :)

Author:  AcidFaucet [ 24.12.2011, 04:56 ]
Post subject:  Re: Shipping precompiled shaders?

I've been sticking my shaders (and most other resources) into an SQLite database. Pretty easy to use and there's a great C++ oriented wrapper for the C api on code project. However, I was already using SQLite for paging and alife so it made sense in my situation.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/