AntTweakbar related question & Compilation related question

share shaders here
  • Author
  • Message
Offline
*blah-blah-blah maniac*
Posts: 565
Joined: 05 Apr 2014, 10:29
Location: Taiwan

Re: AntTweakbar related question & Compilation related quest

number6,
Just plain & simple global variable with gui annotations.

Code: Select all

int INDEX <
	string UIName="PS INDEX";
	string UIWidget="spinner";
	int UIMax=4;
	int UIMin=0;
> = {1};
Found it on some stackflow post, not sure if there is any side effect though.
_________________
Intel Xeon L5639 6C12T @3.96GHz | Gigabyte ga-x58a-ud3r | MSI GTX680 4G | 48G RAM | Intel 760p Nvme w clover bootloader
Flickr
YouTube

Offline
User avatar
*master*
Posts: 229
Joined: 21 Feb 2013, 03:21
Location: Los Angeles, CA

Re: AntTweakbar related question & Compilation related quest

Thanks, that's a great technique there ;) So for Prod80's original issue with branching code this seems like a pretty good solution. I would guess the main downsides this this would be:
- compile time for the multiple shaders in the pass
- code might need to be rewritten to have minimal duplication between the shaders
- replacing multiple either or gui annotations with a single integer is a less than ideal user experience

Prod80 said:
Using Techniques section isn't good for this purpose... I'll try and fiddle a bit more.
Prod80, can you explain more why this wouldn't work for what you are trying? Thanks.
_________________
i7-4970K 4.8ghz, 16gb ram, Geforce Titan X 12gb vram, win7

Offline
*sensei*
Posts: 372
Joined: 28 Jul 2013, 23:26

Re: AntTweakbar related question & Compilation related quest

Prod80 said:
Using Techniques section isn't good for this purpose... I'll try and fiddle a bit more.
Prod80, can you explain more why this wouldn't work for what you are trying? Thanks.
Because it's effect ... would results in many different techniques to compile different parts of shader for different effect combinations. Anyway I solved the branching issue with recoding the entire effect in a more efficient way (4 if statements, but no branch compared to old 6 if statements and 9 branches)
Post Reply