Gamestudio Links
Zorro Links
Newest Posts
Zorro version 3.0 prerelease!
by Grant. 02/24/26 22:21
WFO Training with parallel cores Zorro64
by Martin_HH. 02/24/26 19:51
ZorroGPT
by TipmyPip. 02/23/26 21:52
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (TipmyPip, Quad), 6,365 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Automatically update shaders #390886
01/05/12 16:52
01/05/12 16:52
Joined: Sep 2007
Posts: 101
Luxembourg
K
krial057 Offline OP
Member
krial057  Offline OP
Member
K

Joined: Sep 2007
Posts: 101
Luxembourg
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 smile

DOWNLOAD:
http://dl.dropbox.com/u/6859456/st.h
)


Last edited by krial057; 01/05/12 17:20.
Re: Automatically update shaders [Re: krial057] #390890
01/05/12 17:04
01/05/12 17:04
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
You know that there is a "RELOAD" flag for shaders [MATERIALS] ?

Or didn't I get something?

Re: Automatically update shaders [Re: Rei_Ayanami] #390893
01/05/12 17:16
01/05/12 17:16
Joined: Sep 2007
Posts: 101
Luxembourg
K
krial057 Offline OP
Member
krial057  Offline OP
Member
K

Joined: Sep 2007
Posts: 101
Luxembourg
Seriously? -.-
Holy crap yes... autoreload
Didn't know about it tongue
Then my script is useless tongue Sorry -.-

Re: Automatically update shaders [Re: krial057] #390895
01/05/12 17:30
01/05/12 17:30
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
No problem, sorry about your wasted time^^

Re: Automatically update shaders [Re: Rei_Ayanami] #390899
01/05/12 17:40
01/05/12 17:40
Joined: Sep 2007
Posts: 101
Luxembourg
K
krial057 Offline OP
Member
krial057  Offline OP
Member
K

Joined: Sep 2007
Posts: 101
Luxembourg
It wasn't wasted, learned some new winapi functions and about the autorelaod flag grin


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1