|
|
alpha for a sprite
#151292
08/31/07 08:38
08/31/07 08:38
|
Joined: Feb 2003
Posts: 211 Unna
Freddy_dup1
OP
Member
|
OP
Member
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
Expert
|
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: Freddy_dup1]
#151295
08/31/07 17:38
08/31/07 17:38
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
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: Scorpion]
#151298
09/03/07 18:36
09/03/07 18:36
|
Joined: Mar 2006
Posts: 2,758 Antwerp,Belgium
frazzle
Expert
|
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
|
|
|
|