Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 1,088 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
effect_load for string content #369228
05/02/11 19:50
05/02/11 19:50
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Hi,

I consider compiling shaders during runtime and I wanted to ask you, if you could modify effect_load or create a new funtion for loading shaders from STRING* or char* data. This way, I could add dynamic code in front of the first line of a .fx file, for instance #define's, which are being added due to Lite-C compiler defines (like disabling specific sections of a shader, because it is disabled in a Lite-C header file or in a options menu, e.g. low/high shader quality).

Is that a reasonable feature suggestion? I hope so smile

best regards,
-Christian

Last edited by HeelX; 05/02/11 19:52.
Re: effect_load for string content [Re: HeelX] #369234
05/02/11 20:33
05/02/11 20:33
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Passing a string containing shader code to effect_load() in place of the filename will run that shader code too grin

Re: effect_load for string content [Re: DJBMASTER] #369251
05/02/11 23:03
05/02/11 23:03
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
also, you could compile low and high versions of shaders to .fxo files(like ssao_low.fxo and ssao_high.fxo) and then define materials for each of them and select the according material according to shader quality settings.


3333333333
Re: effect_load for string content [Re: Quad] #369263
05/03/11 07:46
05/03/11 07:46
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline OP
Senior Expert
HeelX  Offline OP
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
The user has to do this, because I rely on default.fx, which is different for A7 and A8 - so, if he uses A8, he can simply compile the shaders by himself. Also, I intend to concatenate a dynamically composed preamble of defines with a shader stub, that react on these defines. This way, Lite-C defines can be passed on startup to the shader code and optimized version can be compiled then. Also, if I pass static variables (like blur radius, blur samples, AO approximation passes, etc.) this way to a shader, things will get optimized, too.

I also intend to design my framework so that if some values change, shaders are getting re-compiled, like blur quality, etc. This way, I write a shader once and if the gamers wants a different shader quality (for, e.g, speed reasons), the user can pass this through a function to my solution and the very special shader gets re-compiled with the new settings. I also target to replace the different object shaders for my extra render views with one file for all and compile them differently for each object type.

Last edited by HeelX; 05/03/11 07:47.

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