"wireframe" effect

Posted By: JKL

"wireframe" effect - 06/12/04 17:37

Has someone an idee of makin a shader wich renders the pixels ad the edges of a model to a light (looks maybe like a simple wireframe), how its done in the screenshot?
I’m a very shader noob – so PLEASE PLEASE help you FX Kings!

THX


Posted By: Captain_Kiyaku

Re: "wireframe" effect - 06/12/04 17:39

use this code for wireframe, works for models and levelgeometrie

material wireframe //change the name in the Texture name, if you want to use it for levelgeometrie
{
effect="
DWORD wfcolor = 0xFFFFFFFF; // Change this to the wireframe color of your choice
technique wireframe
{
pass p0
{
TextureFactor = <wfcolor>;
// CullMode = None; // Uncomment if you want backface too.
FillMode = Wireframe;
ColorOp[0] = SelectArg1;
ColorArg1[0] = TFactor;
}
}
";
}


and write in your action of the model:

action blabla
{
my.material = wireframe;
...
}

if you want it for models.

hope that helps
Posted By: JKL

Re: "wireframe" effect - 06/12/04 18:27

THX a lot DS_Kihaku, works fine!
But how can I keep the model textured?
Posted By: Captain_Kiyaku

Re: "wireframe" effect - 06/12/04 18:48

Hmm that's another problem. maybe duplicate the model at the same position. then you have two models, and one of them will get the material flag.
Posted By: mk_1

Re: "wireframe" effect - 06/12/04 21:50

I think you can do this using two passes.
Posted By: alienheretic

Re: "wireframe" effect - 06/13/04 06:30

Would Be Cool If Someone Could Post The Code Using Both Passes
Posted By: Captain_Kiyaku

Re: "wireframe" effect - 06/13/04 06:38

Hope that works:

material wireframe
{
effect="
texture entSkin1;
DWORD wfcolor = 0xFFFFFFFF; // Change this to the wireframe color of your choice
technique wireframe
{
pass p0
{
TextureFactor = <wfcolor>;
// CullMode = None; // Uncomment if you want backface too.
FillMode = Wireframe;
ColorOp[0] = SelectArg1;
ColorArg1[0] = TFactor;
}
pass p1
{
FillMode = Solid;
ColorOp[0] = SelectArg1;
ColorArg1[0] = texture;
}
}
";
}
Posted By: fernlicht

Re: "wireframe" effect - 12/13/04 03:26

Hi,

i´m wondering the second shader with two passes isn´t working.
i think the bug is in "pass1"
sorry but i´m a shader noob :-) can sombody help?

Quote:

material wireframe
{
effect="
texture entSkin1;
DWORD wfcolor = 0xFFFFFFFF; // Change this to the wireframe color of your choice
technique wireframe
{
pass p0
{
TextureFactor = <wfcolor>;
// CullMode = None; // Uncomment if you want backface too.
FillMode = Wireframe;
ColorOp[0] = SelectArg1;
ColorArg1[0] = TFactor;
}
pass p1
{
FillMode = Solid;
ColorOp[0] = SelectArg1;
ColorArg1[0] = texture;
}
}
";
}




[EDIT]

how is it possible to chage the thickness of the wireframe lines?
[EDIT]

regards
Posted By: slacer

Re: "wireframe" effect - 12/14/04 02:55

Your card has to support the thickness.
Maybe you google after "d3d pointsprite".

-- slacer
Posted By: fernlicht

Re: "wireframe" effect - 12/14/04 09:47

thanks

is it possible to apply this shader to level-geometry.
how can i do this?
did i miss something, because the material name is the same as my wadtexturename. do i have to initialize the shader to the texture??

my code
Code:
 material blue{
effect="
technique wire{
pass p0{
fillmode=2;//or 1
}
}
";
}



any help welcome
regards
Posted By: LogantheHogan

Re: "wireframe" effect - 12/14/04 10:59

Have you set d3d_automaterial to ON?
Posted By: fernlicht

Re: "wireframe" effect - 12/14/04 19:49

thank you, i forgot that. now its brilliant
© 2024 lite-C Forums