Gamestudio Links
Zorro Links
Newest Posts
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
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 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
alpha for a sprite #151292
08/31/07 08:38
08/31/07 08:38
Joined: Feb 2003
Posts: 211
Unna
F
Freddy_dup1 Offline OP
Member
Freddy_dup1  Offline OP
Member
F

Joined: Feb 2003
Posts: 211
Unna
Hello,

when I try this shader I always get the message:
"invalid register t1".
What do I have to change?

Code:
bmap alpha_map = <leaves.tga>;

material mat_leaves
{
skin1 = alpha_map;

effect
"
texture entSkin1; // leave-Sprite-texture
texture mtlSkin1; // alpha texture

technique test
{
pass p0
{
Texture[0] = <entSkin1>;
Texture[1] = <mtlSkin1>;

TexCoordIndex[0] = 1;
TexCoordIndex[1] = 1;

vertexShader = asm
{
vs_1_1

mul r0, t0, t1
};


}
}
";
}



Re: alpha for a sprite [Re: Freddy_dup1] #151293
08/31/07 13:49
08/31/07 13:49
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
That's why they invented HLSL shaders ^^
Well I can only ask what your mul instruction is supposed to do because what I can recall from the average asm register is that mul is defined like this:
Code:
 
mul r0,r0,r1



But that offcourse depends from which you use as a parameter. Is the first parameter a row or a column vector and visa versa with the second one. But it also seems you use an older syntax of assembly shader then I'm used too so maybe you could ask it or wait untill some user how are really familiar with this give their vision

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: alpha for a sprite [Re: frazzle] #151294
08/31/07 17:29
08/31/07 17:29
Joined: Feb 2003
Posts: 211
Unna
F
Freddy_dup1 Offline OP
Member
Freddy_dup1  Offline OP
Member
F

Joined: Feb 2003
Posts: 211
Unna
Thanks,
but now it says "uninitialized components in r1"

Re: alpha for a sprite [Re: Freddy_dup1] #151295
08/31/07 17:38
08/31/07 17:38
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
This could be caused by a bunch of reasons if we don't know what you're using the mul for Btw, were did you get this code snippet from ??

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: alpha for a sprite [Re: frazzle] #151296
09/02/07 14:23
09/02/07 14:23
Joined: Feb 2003
Posts: 211
Unna
F
Freddy_dup1 Offline OP
Member
Freddy_dup1  Offline OP
Member
F

Joined: Feb 2003
Posts: 211
Unna
I took the pixel-shader from the wiki and changed a lot of
things. So maybe everything is wrong.

Maybe you can give me a shader that does what I need:
I just want to add a alpha map to a sprite to make it
transparent. The sprite is a bmp and the alpha is a tga.

Re: alpha for a sprite [Re: Freddy_dup1] #151297
09/03/07 15:42
09/03/07 15:42
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
why do you not take a tga? O_ň

Re: alpha for a sprite [Re: Scorpion] #151298
09/03/07 18:36
09/03/07 18:36
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Well the problem is, my knowledge over assembly shaders ins't wide enough to create such a shader. Btw, do you really want to use a shader, transparency via a shader is slower qua performance then just using a simple command via c-script or even setting a flag in WED :

Code:
 
my.transparent = on;



But if the shader way is the only way for you, then I can't help you if you want it asm.

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: alpha for a sprite [Re: frazzle] #151299
09/04/07 16:21
09/04/07 16:21
Joined: Feb 2003
Posts: 211
Unna
F
Freddy_dup1 Offline OP
Member
Freddy_dup1  Offline OP
Member
F

Joined: Feb 2003
Posts: 211
Unna
Thanks.

I just wondered if I can get around this z-puffer problems.
But maybe it`s better to use overlay and transparent.


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