Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Shader tweakables

Author
Message
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 30th Jan 2014 00:54
Is it possible to change the values within the game?

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
zeroSlave
17
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 30th Jan 2014 02:27 Edited at: 30th Jan 2014 02:27
If you mean change the values of shader variables from within the game, yes.

SET EFFECT CONSTANT BOOLEAN Effect Number, Constant String, Constant Value
SET EFFECT CONSTANT INTEGER Effect Number, Constant String, Constant Value
SET EFFECT CONSTANT FLOAT Effect Number, Constant String, Constant Value
SET EFFECT CONSTANT VECTOR Effect Number, Constant String, Vector Number
SET EFFECT CONSTANT MATRIX Effect Number, Constant String, Matrix Number

As far as changing variables inside the game from the shader, I do not believe so.

Best of luck!

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 30th Jan 2014 06:37
For example i have this shader here:


you can see there are tweaks Color,Bumpyness etc. can i change them within the game with the above commands?

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 30th Jan 2014 11:04
Yes you can. I admit that the name "constant" is a bit misleading in the sense that you can indeed change their values, but I suppose it means it is "constant" within the shader itself, won't change during a single run-through of it and only to be modified from the outside.


"Why do programmers get Halloween and Christmas mixed up?"
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Jan 2014 19:19
Yes. The values given in the shader are the default values used if you don't change them using the set effect constant commands as Rudolpho says.

You can also change the "tweakable" variables in the shader itself if you need to. Probably best not to though as it rather defeats the object of having an externally adjustable constant - and could make the code harder to follow and debug.



Powered by Free Banners

Login to post a reply

Server time is: 2026-07-07 07:34:57
Your offset time is: 2026-07-07 07:34:57