Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,767 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
error : Pixel shader expected ??? #45686
05/14/05 12:56
05/14/05 12:56
Joined: Apr 2005
Posts: 64
Italy - Rome
_
_Tommo_ Offline OP
Junior Member
_Tommo_  Offline OP
Junior Member
_

Joined: Apr 2005
Posts: 64
Italy - Rome
I'm trying to learn basic shader languages, because i'm totally a newbie at this, but when i try to put a vertex shader in my code, i always get the error:
"error w1550 at effect line( line where it's written "pixelshader=asm" ). pixelshader expected".
But in my code there IS a pixel shader! And i can't get this to work also if i copy/paste pixel shader code or both vertex and pixel shaders from other working shaders! Anyone knows why this happens?

Re: error : Pixel shader expected ??? [Re: _Tommo_] #45687
05/14/05 18:21
05/14/05 18:21
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
would be better if you show your code. then helping would be easier


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: error : Pixel shader expected ??? [Re: _Tommo_] #45688
05/15/05 17:44
05/15/05 17:44
Joined: Apr 2005
Posts: 64
Italy - Rome
_
_Tommo_ Offline OP
Junior Member
_Tommo_  Offline OP
Junior Member
_

Joined: Apr 2005
Posts: 64
Italy - Rome
the code i tried is that:
bmap texture = <test.tga>;
bmap dot3 = <testdot3.tga>;

material mat_bump
{
skin1 = texture;
skin2 = dot3;

scale1 = 0.2;

effect = "

matrix matWorldViewProj;
matrix matWorld;
vector vecSunDir;
Matrix matMtl;

// declare the used textures and variables
texture mtlSkin1; // the entity skin
texture mtlSkin2; // the bump map
dword mtlSkill1; // the light vector

// default technique
technique bump_dot3
{
pass P0
{

// set texture stage states
Texture[0] = <mtlSkin2>; //bump
Texture[1] = <mtlSkin1>; //text
TextureFactor = <mtlSkill1>;

ColorArg1[0] = Texture; // stage 0 = bumpmap
ColorOp[0] = DotProduct3;
ColorArg2[0] = TFactor;

ColorArg1[1] = Texture; // stage 1 - skin texture
ColorOp[1] = AddSigned;
ColorArg2[1] = Current;

ColorArg1[2] = Diffuse; // stage 2 - lighting
ColorOp[2] = Modulate2x;
ColorArg2[2] = Current;

pixelshader = asm
{
ps.1.0

tex t0
tex t1
tex t2

mul r0, t0, t1

};


vertexShader = asm
{
vs.1.1

m4x4 oPos, v0,c0

mov oD0,c4
};
}
}
// fallback technique for devices that do not support bumpmapping

technique fallback
{
pass P0
{
// set texture stage states
Texture[0] = <mtlSkin1>;
ColorArg1[0] = Texture; // stage 0 = skin texture
ColorOp[0] = Modulate2x;
ColorArg2[0] = Diffuse; // modulate by lighting
}

}"; // end of the effect string
}



starter mat_bump_init
{
// initialize the material properties
vec_set(mat_bump.ambient_blue, mat_model.ambient_blue);
vec_set(mat_bump.diffuse_blue, mat_model.diffuse_blue);
vec_set(mat_bump.specular_blue, mat_model.specular_blue);
mat_bump.albedo = 100;
mat_bump.power = mat_model.power;
mat_bump.skill1 = pixel_for_vec(vector(100,100,100),50,8888);
}


As you see it's just the bumpmapping example in 3dgs' tutorial with some changes. I also tried:
to change the order of pixel and vertex shader;
to made a blank one;
to cancel the bumpmapping part;
to put the shaders in another pass....

But nothing! at every try, (if there aren't other errors) i get always "pixel shader expected", pointing to the line where the pixel shader starts... but only if i use also a vertex shader. Why??? It works if i comment the vertex shader!

Re: error : Pixel shader expected ??? [Re: _Tommo_] #45689
05/15/05 17:57
05/15/05 17:57
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
Well of course this wont work becasue you are putting in a pxel shader before a vertex shader..and your 2 passes have to have differnt names! and you are also mixing fixed functions with shaders, which while not impossible, doest work this way. Having looked at you pixel shader and vertex shader anyway.. they seem to serve no purpose at all.. why would you calculate the dot product and such in fixed functions and then just mul the base textures in a pixel shader? it would wipe out everything you did in the fixed functions. and that vertex shader is completely pointless...my advice is take a look at some shaders on this board and see how they are set up.

Re: error : Pixel shader expected ??? [Re: Matt_Aufderheide] #45690
05/15/05 18:21
05/15/05 18:21
Joined: Apr 2005
Posts: 64
Italy - Rome
_
_Tommo_ Offline OP
Junior Member
_Tommo_  Offline OP
Junior Member
_

Joined: Apr 2005
Posts: 64
Italy - Rome
I know this is a useless shader...for now i need only to don't get errors (if i'm right, those pixel and vertex shader are the simplest working code).
Now i deleted the fixed function part, and i put the vertex shader before the pixel shader... but it continues to give the same error!!!


Moderated by  Blink, Hummel, Superku 

Gamestudio download | 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