Hi,
EDIT: forget this script, there's an autoreload flag -.-
(
I've written a shader tester and want to share it with you. So here is what it does:
While the game runs, you can edit your shaders with the editor you want (SED, notepad, ...)
If you save your shader in that editor, my shader tester will recognize it and will update the modified shader in the game.
There are 2 methods, when to check if shader files got modified:
1st) only check if the gamestudio windows gets active again
2nd) even if the game window is in background, check in a specific interval (in seconds)
NOTICE: For both of the methods, only shaders who got modified will be reloaded(checks are done via the winapi)
How to implement it in your game:
- copy the shader tester to your game folder
- add the following line to your mainscript:
#include "st.h" - that's all
Change between the 2 modes:
if you comment the line 14 out (#define STUpdateInterval 1), the shader check will be done if the windows get focused
otherwise you can set the intercall by changing 1 to the time in seconds you want
IMPORTANT: The script won't work if the shaders are inside another folder than the main folder and they get used by a #define PRAGMA_PATH.
To fix this, you have to put all the shader effect files into one folder and then enter the path into the string at line 16 ( char* STShaderPath="Your shader Path";)
An alternative would be to write in each material the relative path in the effect property (ex: effect="Shaders/blob.fx")
Have fun
DOWNLOAD:
http://dl.dropbox.com/u/6859456/st.h)