Page 1 of 1

Cel Shading

Posted: Thu Jan 05, 2012 3:43 pm
by skinNCNmaster
sorry to bother anyone who chooses to be bothered by me...

anywho, i've googled, searched the forum and clicked through half a dozen pages of archiv'd threads at wayback, none to help...

I'm taking a day to mess around off the current project, and decided to try cel shading leafland geometry in prefab version of the old map i've been re-cleaning up the old patch work i had to work with..

The quest im on is;

1. basic directions for setting up cel shading.. ie -add one cel shaded item to "any map" OR do a whole map in cel.
2. anything script related
3. tips trick for odd cel styling effects

Re: Cel Shading

Posted: Thu Jan 05, 2012 4:26 pm
by obsidian

Re: Cel Shading

Posted: Thu Jan 05, 2012 4:38 pm
by skinNCNmaster
thanks but that does not tell me how to turn off the cel shading on edges i do not want it to affect...

im also guessing that this line in the cel.shader is for telling the ink to position itself?

Code: Select all

	q3map_offset -2.0
Offsets a surface along the vertex normals N.N units. Used in celshading.
i wonder if it works in 3 planes xyz?




also...

Code: Select all

textures/cel/ink
{
	qer_editorimage gfx/colors/black.tga
	
	q3map_notjunc
	q3map_nonplanar
	q3map_bounce 0.0
	q3map_shadeangle 120
	q3map_texturesize 1 1
	q3map_invert
	q3map_offset -2.0
	
	surfaceparm nolightmap
	surfaceparm trans
	surfaceparm nonsolid
	surfaceparm nomarks
	
	sort 16
	
	{
		map gfx/colors/black.tga
		rgbGen identity
	}
}


shouldnt aeons cel shader have back side culling?

Cel shading is the technique used to make your maps render like cartoons, with black (or other color) solid outlines tracing hard edges.
In order for celshading to work properly, you must use -meta when compiling the BSP. The funny little nonplanar/shadeangle/invert/offset nonsense in cel.shader is what makes it work properly. You'll know when it's working when it starts taking about 10-20x as long to make the BSP.

Re: Cel Shading

Posted: Thu Jan 05, 2012 5:19 pm
by obsidian
For control of cel surfaces, follow same process, but on a func_group.

Vertex normal means it takes the average of the surface normals. So yes, it offsets along all axes at the same time based on the average, but the axis of offset is not user controlled.

The shader above *does* have backside culling enabled as with any other default shader. It is correct. Perhaps you mean disabling backside culling (with cull none), which would be wrong.

Re: Cel Shading

Posted: Thu Jan 05, 2012 5:29 pm
by skinNCNmaster
the reason i ask is that my blades of grass are made from patches and this is the way it affects them....
[lvlshot]http://www.rave.ca/en/image/original/441759/[/lvlshot]

heres a question

Code: Select all

Entity 0 (worldspawn) has cel shader textures/cel/ink
Entity 1 (func_group) has cel shader textures/cel/ink
Entity 2 (func_group) has cel shader textures/cel/ink
Entity 3 (func_group) has cel shader textures/cel/ink
Entity 4 (func_group) has cel shader textures/cel/ink
Entity 5 (info_player_intermission) has cel shader textures/cel/ink
Entity 6 (info_player_deathmatch) has cel shader textures/cel/ink


why does the compile apply the cel ink to groups that havent had anything "cel related" done to them
i guess the groups are auto interpreted by cel as dealt with properly.. thats the flowers, which look marvelous cel shaded btw. :D

.. and also the entities?


also, is it possible to assign a second cel shader with a secondary shadeangle and offset for different objects? some grass blades are vertical and barely affected by the shadeangle

Re: Cel Shading

Posted: Fri Jan 06, 2012 3:40 pm
by [acid]
Should be possbile by writing a second shader cel/ink2 and assigning it to the specific group.

Re: Cel Shading

Posted: Fri Jan 06, 2012 3:46 pm
by skinNCNmaster
then also it would need another _celshader key in worldspawn, one for each of the shaders in the script?

Re: Cel Shading

Posted: Sat Jan 07, 2012 12:37 am
by GtkRadiant
[acid] wrote:Should be possbile by writing a second shader cel/ink2 and assigning it to the specific group.
I've tried this before and you can't use two cel shaders at once.
skinNCNmaster wrote:then also it would need another _celshader key in worldspawn, one for each of the shaders in the script?
the celshader key can be used to specify different cel shaders than the cel/ink. for example, you could do this:

key: _celshader
value: cel/ink_red

and if you have the image and shader in the right places it will work.

I recommend making models of the leaves and putting them in the same location as the old ones. place some playerclip platforms where the player will walk over the models, and add a _celshader key TO THE MODEL with a value that points to a non-existent shader.
for example:

key: _celshader
value: cel/ink_123

make sure you have the normal celshading key set up in the worldspawn, compile, and there should be no celshader on the model. the console will report a missing celshader but just ignore it.

Re: Cel Shading

Posted: Sat Jan 07, 2012 12:39 am
by GtkRadiant
".. and also the entities?"

ignore that, it doesn't matter.

Re: Cel Shading

Posted: Sun Jan 08, 2012 6:56 pm
by skinNCNmaster
thanks