Only Outlines...? I want no cartoon shading

Posted By: Espér

Only Outlines...? I want no cartoon shading - 11/30/08 14:30

Hi..

I´m searching for a way, to give my Models only the Outlines around the visible charakter ( like in Comics or Animes ). I don´t want the characters to be shaded like cartoons.. just the outlines in a variable thick.

Hope you understand and know a way...
Posted By: Drew

Re: Only Outlines...? I want no cartoon shading - 11/30/08 19:56

there is the inverted model trick...

basically you duplicate your mesh, epxand it just slightly and texture it black (push modifier in 3dmax).
Now flip all the normals on just the black mesh, you now have black lines only, since you only see the backfaces of the black mesh on the edges...

sorry this isn't a shader....
Posted By: Espér

Re: Only Outlines...? I want no cartoon shading - 11/30/08 21:00

i know that from an AU Tutorial..
But that won´t work on more complex models ( like models that inlcude rings or objects with holes inside ).

I don´t ask for those things for fun..
Posted By: Quad

Re: Only Outlines...? I want no cartoon shading - 11/30/08 21:12

im sure this can be achieved by editing some toon shaders, but i dont know how to write/edit shaders yet.
Posted By: JibbSmart

Re: Only Outlines...? I want no cartoon shading - 12/01/08 05:23

well that's exactly how most toon-shaders work. they just do the copying, blackening, inflating and normal flipping for you in a second pass. others will use some sort of edge detection, but that can take a lot of work to look good in your game.

also i believe Drew was simplifying the process; you wouldn't want to just scale the entire model. you'd select convex parts and scale them individually.

since the shader automatically does it along the normals, it should work fine.

it's part of the toon shaders already on the wiki.

i highly recommend the official shader workshop that you should get with a7 (or find on the downloads page). you'll then know how to use HLSL, and the following will be relatively easy for you to do: render one pass with diffuse lighting or whatever lighting you want to use, then do another pass moving the position of each vertex along its normal, flip it, and render it black.

all in all it should take you about an hour, and you'll be able to write your own shaders wink

Quote:
I don´t ask for those things for fun.
oh come on, asking questions is heaps of fun!!

julz
Posted By: lostclimate

Re: Only Outlines...? I want no cartoon shading - 12/01/08 05:54

julz beat me too it, if you are using blender you can also use alt-s to scale along the normals.
Posted By: Espér

Re: Only Outlines...? I want no cartoon shading - 12/01/08 08:38

But I don't want the models to be shaded like cartoons...
I just want the outlines...
So I can't use a cartoon shader, because then it's shaded...

And: I just use MED... And scale all parts of my greater models individually, will make a lot of work that'll go much easier and faster with a scripted method.
Posted By: ello

Re: Only Outlines...? I want no cartoon shading - 12/01/08 09:29

you can just use the outline pass of any toonshader and the next pass has

vertexshader = NULL;
pixelshader=NULL;

and thus using engines default
Posted By: JibbSmart

Re: Only Outlines...? I want no cartoon shading - 12/01/08 10:11

oh dear... i just told you to use the outline part. they're distinctly different and unrelated to each other, people just like to use them both in the same shader because people often want to use both effects together.

anyway, *what ello said*.

julz

EDIT: @lostclimate: didn't know that feature! thanks!
Posted By: lostclimate

Re: Only Outlines...? I want no cartoon shading - 12/01/08 16:39

@julz any time. It was funny because i used to use anim8r a long time ago, and its extrude scaled by normals, and for the longest time i couldnt find another modeling program that could do that, one day i accidently held alt while scaling in blender, and voila!
Posted By: Cowabanga

Re: Only Outlines...? I want no cartoon shading - 12/01/08 17:43

Use this one:
Code:
float4x4 matWorldViewProj;

struct VS_IN 
{
	float4 pos : POSITION;
	float4 nrm : NORMAL;
};

struct VS_OUT 
{
	float4 oPos : POSITION;
	float4 oC0 : COLOR0;
	float4 oC1 : COLOR1;
};

VS_OUT OutlineVS (VS_IN In, uniform float scale, uniform float3 rgb)
{
	VS_OUT Out;
	In.pos.xyz += In.nrm.xyz*scale;
	Out.oPos = mul(In.pos,matWorldViewProj);
	Out.oC0 = Out.oC1 = float4(rgb,1.0);
	return Out;
}

technique test
{
	pass p1
	{
		CullMode = CCW;
	}
	pass p0
	{
		CullMode = CW;
		VertexShader = compile vs_2_0 OutlineVS(1,float3(0.0,0,0)); // thickness , rgb
	}
}


Just an Outline! smile.
Posted By: Espér

Re: Only Outlines...? I want no cartoon shading - 02/03/09 15:50

just a problem:

Posted By: Cowabanga

Re: Only Outlines...? I want no cartoon shading - 02/03/09 16:04

Problem with my shader or with another shader?
Posted By: Espér

Re: Only Outlines...? I want no cartoon shading - 02/03/09 16:05

with your ( it´s the only i use atm.. so it must be yours ^^ )
Posted By: Cowabanga

Re: Only Outlines...? I want no cartoon shading - 02/03/09 16:07

It will works only with closed mesh models.
Posted By: Espér

Re: Only Outlines...? I want no cartoon shading - 02/03/09 16:17

all meshs are closed...
Posted By: Cowabanga

Re: Only Outlines...? I want no cartoon shading - 02/03/09 16:46

Well.... ummmmm. dunno.
Posted By: mk_1

Re: Only Outlines...? I want no cartoon shading - 02/03/09 18:16

set zwriteenable = true, swap passes
Posted By: PrenceOfDarkness

Re: Only Outlines...? I want no cartoon shading - 02/06/09 06:40

Ya this is something i've been asking for also for a while. I hope to see it.
Posted By: Espér

Re: Only Outlines...? I want no cartoon shading - 02/06/09 07:23

hey
's is working now ^^
man...
just because my photoshop saved a TVA (with alpha), automatically, as 32Bit

Code's working
Sry for reasking

Thanks ^^
© 2024 lite-C Forums