Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, juanex, Grant), 1,018 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 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 | chip programmers | 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