Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
0 registered members (), 1,498 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Offsetting u/v without moving the alpha channel? #46372
05/21/05 16:36
05/21/05 16:36
Joined: Jun 2001
Posts: 385
Eastern Washington State
Z
Zio Offline OP
Senior Member
Zio  Offline OP
Senior Member
Z

Joined: Jun 2001
Posts: 385
Eastern Washington State
There are lots of times I'd like to scroll an objects texture, but need its alpha transparency to stay in place. How hard would this be?

Re: Offsetting u/v without moving the alpha channe [Re: Zio] #46373
05/21/05 18:27
05/21/05 18:27
Joined: May 2003
Posts: 609
Rattenfängerstadt
Rigoletto Offline
Developer
Rigoletto  Offline
Developer

Joined: May 2003
Posts: 609
Rattenfängerstadt
Hi,

i think you have to split the texture and the alpha-channel into two texture-stages so you can define the scrolling seperatly.

Re: Offsetting u/v without moving the alpha channe [Re: Rigoletto] #46374
05/21/05 20:05
05/21/05 20:05
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
put this into a pixelshader:

Code:

...
{
...
float3 rgb=tex2D(skin,texCoord+float2(offset.x,offset.y));//u can use vecSkill41 for passing values
float4 foralpha=tex2D(skin,texCoord);

return float4(rgb,foralpha.a);
}




www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: Offsetting u/v without moving the alpha channe [Re: ello] #46375
05/21/05 22:52
05/21/05 22:52
Joined: Jun 2001
Posts: 385
Eastern Washington State
Z
Zio Offline OP
Senior Member
Zio  Offline OP
Senior Member
Z

Joined: Jun 2001
Posts: 385
Eastern Washington State
Thanks!

Now that I'm on a video card that actually supports shaders (yay!) I plan to start learning them.

But right now I'm still new to all this, I don't suppose you could post a full working snippet of this to get me started? That'd be awesome.

You say to put that in a pixel shader, and since that's the whole effect I'm looking for, I'm guessing that's basically all there is to it, however I don't know what the minimum code required for the rest of the shader would be.

Re: Offsetting u/v without moving the alpha channe [Re: Zio] #46376
05/21/05 22:57
05/21/05 22:57
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
thats easy, i have a written a small tutorial that shows you how to setup an shader in HLSL... just look at the top of the shader forum for this:
Introduction to HLSL shaders.. once you have the sample shader working, you can put in ello's code (it wont have an lighting, but do this first, then i can show you how to add vertex lighting).


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