Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (kzhao, AndrewAMD, bigsmack), 824 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
PP Shader with more than 4 parameters #432317
11/04/13 19:34
11/04/13 19:34
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline OP
Member
yorisimo  Offline OP
Member
Y

Joined: Mar 2007
Posts: 197
I am building a postprocessing (pixel) shader that needs more than 4 parameters. The manual specifies use of the material's vecSkill1 (skill1-skill4) to modify parameters. This works for me, but only allows 4 parameters to be passed. How can I pass more information?

Re: PP Shader with more than 4 parameters [Re: yorisimo] #432321
11/04/13 19:42
11/04/13 19:42
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
What I normally do (instead of using Material skills) is define vars (or floats or VECTORs) in lite-C and use those in the shader as follows:

var game_time = 0;
...
while(1)
{
game_time += time_frame;
wait(1);
}

Shader:

float game_time_var; // the _var / _flt feature is explained in detail in the manual

return (0.5+0.5*sin(game_time_var)); // pixel shader


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: PP Shader with more than 4 parameters [Re: Superku] #432322
11/04/13 19:56
11/04/13 19:56
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline OP
Member
yorisimo  Offline OP
Member
Y

Joined: Mar 2007
Posts: 197
Thanks! Looks like that should work. Didn't know about this feature laugh


Joris Lambrecht
My Contributions: Relative Rotation, Window Sizing
Re: PP Shader with more than 4 parameters [Re: yorisimo] #432324
11/04/13 20:14
11/04/13 20:14
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
there's also vecSkill5, 9 and 13 and 17


POTATO-MAN saves the day! - Random
Re: PP Shader with more than 4 parameters [Re: Kartoffel] #432326
11/04/13 20:26
11/04/13 20:26
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline OP
Member
yorisimo  Offline OP
Member
Y

Joined: Mar 2007
Posts: 197
Thanks. That works too. I misread the manual. I was trying to use vecSkill2 which doesn't exist


Joris Lambrecht
My Contributions: Relative Rotation, Window Sizing

Moderated by  Blink, Hummel, Superku 

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