Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 975 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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