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
1 registered members (7th_zorro), 793 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to send a 3d vector from lite-c in a shader? #182345
02/06/08 14:21
02/06/08 14:21
Joined: Mar 2006
Posts: 2,252
Hummel Offline OP
Expert
Hummel  Offline OP
Expert

Joined: Mar 2006
Posts: 2,252
Hi,
can someone show me to do this? I was able to send a single value with my.Skill41=floatv(player_pos.x) from Lite-C to the shader (vecSkill41). But when I try to use vecSkill42 and 43 I always get no values in the shader.
I also tried the mtlSkills -> no sensefull results!!!
PLEASE HELP!!!

Re: How to send a 3d vector from lite-c in a shade [Re: Hummel] #182346
02/06/08 22:09
02/06/08 22:09
Joined: May 2005
Posts: 83
Texas
mocosgames Offline
Junior Member
mocosgames  Offline
Junior Member

Joined: May 2005
Posts: 83
Texas
in your game script you use skill41-44 but in the shader code it is vecSkill41.x vecSkill41.y vecSkill41.z and vecSkill41.w

Re: How to send a 3d vector from lite-c in a shade [Re: mocosgames] #182347
02/07/08 12:08
02/07/08 12:08
Joined: Mar 2006
Posts: 2,252
Hummel Offline OP
Expert
Hummel  Offline OP
Expert

Joined: Mar 2006
Posts: 2,252
nice^^ Thank you very much!!!

Re: How to send a single value to the shader [Re: Hummel] #182348
02/12/08 14:06
02/12/08 14:06
Joined: Mar 2006
Posts: 2,252
Hummel Offline OP
Expert
Hummel  Offline OP
Expert

Joined: Mar 2006
Posts: 2,252
Hi,
I was able to sent the players position with vecSkill41. But now I need two values more. I used vecSkill41.w for one-> no Problems. Now I thought that I can use two mtlSkills on the same way, but I thought wrong
...a little bit Code:

function mat_event()
{
my.Skill44=floatv(x);
mtl.skill1=floatv(x);

str_for_num(test_str1, my.Skill44);
str_for_num(test_str2, mtl.skill1);
//both test strings show me the same value!
}

MATERIAL* terr_mat=
{
flags=ENABLE_RENDER;
event=mat_event;
effect=
"
float4 vecSkill41;
float mtlSkill1;

....vertexshader etc. .....
pixelshader:
....
float tx1 = 0.25 * vecSkill41.w;
float tx2 = 0.25 * mtlSkill1;

float4 c1 = tex2D(texture,float2(Tex.x+tx1,Tex.y));

float4 c2 = tex2D(texture,float2(Tex.x+tx2,Tex.y));

return c1; //what I want
return c2; //unuseable result!!!


";
}

I want to modify Tex.y too-so I need a second value, but mtlSkill doesnt works!
Whats the problem?
Thx.

Re: How to send a single value to the shader [Re: Hummel] #182349
02/12/08 14:55
02/12/08 14:55
Joined: Mar 2006
Posts: 2,252
Hummel Offline OP
Expert
Hummel  Offline OP
Expert

Joined: Mar 2006
Posts: 2,252
I get it^^ replace this: mtl.skill1=floatv(x);
with this: mtl.skill1=(x/1000);

Re: How to send a single value to the shader [Re: Hummel] #182350
02/12/08 16:21
02/12/08 16:21
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
if you ahve to pass a lot of values you can also choose the predefined material matrix...

Re: How to send a single value to the shader [Re: Scorpion] #182351
02/12/08 16:32
02/12/08 16:32
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
and if that still isn´t enough, use lite-c and/or my plugin: http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/811731/an/0/page/1#Post811731

Re: How to send a single value to the shader [Re: Slin] #182352
02/13/08 15:15
02/13/08 15:15
Joined: Mar 2006
Posts: 2,252
Hummel Offline OP
Expert
Hummel  Offline OP
Expert

Joined: Mar 2006
Posts: 2,252
OK^^


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