How to do wii style cel shading?

Blitz3D Forums/Blitz3D Programming/How to do wii style cel shading?

Robert Cummings(Posted 2010) [#1]
in blitz3d? any code examples please


Yasha(Posted 2010) [#2]
Perhaps you could give an example of a specific game? The Wii demonstrates several different artistic styles that have inaccurately been called "cel-shading"...


Rob(Posted 2010) [#3]
Any is fine. If I recall there was one way to do it via cube maps and modifying uv's on the second channel or something arcane. Maybe there's a better way now?

Anything will do. I just need to grab some results as I am making a game for sick kids this xmas.


Yasha(Posted 2010) [#4]
Double answer to this and other post:

https://sites.google.com/site/nangdongseng/downloads/Shadow.zip?attredirects=0&d=1

A simple example of both cel shading and projective shadows. It won't scale well to many characters but it should provide a starting point. It's neither annotated, nor very well structured (non-strict), but I would be happy to answer questions if I can remember everything.

Note that it only demonstrates cel shading - black outlines are a separate issue, one which I have yet to solve to my own satisfaction (several "adequate" solutions exist, however).


Robert Cummings(Posted 2010) [#5]
Wow very nice! thank you....

Last edited 2010


RifRaf(Posted 2010) [#6]
Rob,

FastExt Lib lets you do cel shading even easier via a simple cubemap, you can align the cubemap to a lightsource against any entity or object you like , no need for any copyrects, or anything like that.

This same method can be used for rim lighting as well.
I use a mild contrasting cubemap texture with 4 gradients, you can vary the effect dramatically with contrast and gradient adjustments.

Some examples




Last edited 2010

Last edited 2010


Robert Cummings(Posted 2010) [#7]
is fastext compatible with older machines and what is the link for it? seems odd it would do so much... does blitz still render it?


Robert Cummings(Posted 2010) [#8]
Cool that sounds easy enough. Do you have a code snippet and a rough cube image to better explain it please? if not then no worries you have been super helpful anyway.

I think fastext it is... hope laptops run it well though!


Ross C(Posted 2010) [#9]
You could try the old spheremap trick? Fails on very sharp edges though... Compatiblity is excellent though.


Yasha(Posted 2010) [#10]
FastExt: http://www.fastlibs.com/index.php

It uses the same technology as Blitz3D - it's basically "more of the same" and is mainly more advanced DX7 functionality that was left out of Blitz3D because it was all new and difficult at the time. It has very good compatibility now though (as good as B3D itself), as DX7 has had time to age. No shaders needed.

There's an example of AlignCubemap in the main FastExt download (it has a LOT of examples - one of the things that sold me on it). You can realign cubemaps to a vector which saves re-rendering them when only the angle has changed - this will save you a lot of CPU time on the effect demonstrated above if you want more than one character to have different lighting angles.

Spheremap has arguably better compatibility, but the tech is so old now that I wouldn't bother with it... more importantly spheremaps can't be realigned dynamically; they're aligned to the camera and say that way.


Ross C(Posted 2010) [#11]
Don't know why you would want a spheremap to be aligned differently for cellshading? It's just a white circle on a black backround, that nearly touches the sides. I know it's a bit outdated, but possibly useful as a far back?


Robert Cummings(Posted 2010) [#12]
Sounds perfect if it really is DX7. I'm quite alarmed DX7 is this good...

Is fast text updated also? I could use some nice text. I mean does it slow down latest B3D and is it also DX7?

Last edited 2010


Yasha(Posted 2010) [#13]
Don't know why you would want a spheremap to be aligned differently for cellshading? It's just a white circle on a black backround, that nearly touches the sides.


Different definitions of cel shading. I've been referring solely to the actual mesh shading (the "banded" effect" that looks toonish). This obviously has to follow light sources as it's a substitute for vertex shading.

Black outlines are often used in conjunction with this, but aren't really "shading" per se. Since outlines are always with respect to the camera, arguably a spheremap could be useful here (in practice the results tend not to be great except for very high-poly meshes, I think).


Ross C(Posted 2010) [#14]
Ah, gotcha! All depends on the normals of the mesh I believe. If they are two great round the edges, it can give very wide and very thin variations.


RifRaf(Posted 2010) [#15]
You can also get more "funny pages" type of shading by tweaking fe_ blendmodes along with the cubemaps

If you want to see some example cubemaps that ive been using, just send me an email to gamemaker04@...

example


Last edited 2010