Archived

This topic is now archived and is closed to further replies.

Michalson

Cell shaded terrain: General discussion

Recommended Posts

So, assuming we''re building something with cell shaded graphics, how would we go about making an outdoor (grass and hill) environment that the user can actually interact with. The primary concern I have is that cell shaded graphics rely on relatively flat colors and dark lines which are only applied to edges where one polygon is visible and the other is not. With terrain this doesn''t seem to work, since you couldn''t see the edge of hills, and thus you could really only see the tops of everything. Any ideas on how to make the terrain distinct enough the the user can meanfully navigate it?

Share this post


Link to post
Share on other sites
Just putting my two cents in, instead of calculating if one polygon is visible and the other is not, what if you calculated the normals against vertical, and if one is basically vertical, then apply the edge/line if the closer polygon is considerably less vertical? It''s been a while since I''ve worked with cel-shading, but if you changed the shader or however you use the effect, would this work? I could definitely be wrong, but it seems to me if you did this, the plateaus and also the crests of hills would be visible. I hope that helps, at least to have some input anyway .

It is coming...8 years in the making and It is finally coming

-Beavt8r...

Share this post


Link to post
Share on other sites
watch a lot of DBZ to see how the terrain looks... (i believe cell shading is suppose to mimick cartoons ) though i''m an idiot...so i don''t know for sure


i figured i try to help a bit

Share this post


Link to post
Share on other sites
There are many ways I think.

In some japanese movies, the background art is just awesome. But I guess doing that quality in realtime is out of the question.

Mostly, when you see landscapes in cartoons, you see the far-away mountains, some green, big hills just below, then the woods. And after that you don't see much more terrain.

The shading is pretty special. I don't know how to animate it, but the shadows are sketched with crossed lines or are furiously dotted. So, on the terrain, you could add some controlled noise on the darker sides of the hills or add a fading overlayed criss-cross texture. Also, depending on the lighting strength, you can use different shading-techniques.

It depends a lot on the type of game you're doing. An adventure game would look great with cel-shaded objects in very detailed environments, but in an FPS, it'd look better if pretty much everything was cel-shaded.
I had a go at the XIII-demo yesterday, and the detailed environments killed the whole idea behind cel-shading. Just looked like they had put some lazy effect on the characters and that's it. Pretty sluggish too, but lots better than Uneal 2 :D I like the potential stealth-games, so now I got another game to wait for...

EDIT: Some syntax errors

[edited by - coelurus on August 14, 2003 4:25:59 AM]

Share this post


Link to post
Share on other sites
What kind of viewpoint for the game? Something battlezone style and close to the ground? Or more Warcraft 3 style and a decent distance above the ground?

I''d start looking at existing cartoons for ideas - the roadrunner cartoons spring to mind I seem to remember there being lots of small details - rocks, tufts of grass, cracks etc. that gave a sense of depth and form to the otherwise minimal shading.

I think having lots of variation in surface types would help as well, different surfaces would only be simple textures, but having sharp(-ish) boundaries between them would provide plenty of information on the gradients of the hills.

Share this post


Link to post
Share on other sites
[Off-topic]
Isn't it 'Cel' insteading 'Cell'?
[/Off-topic]

You could do a diffuse color, and add light or drker color shortlines together, randomly on a few spots.

0 = nothing
1 = grass

000000000000
000100000010
101000111000
001011001000
010001011100

Also add some ovals of lighter green.
You can study some cartoons and see what they did.


.lick


[edited by - Pipo DeClown on August 14, 2003 5:16:05 AM]

Share this post


Link to post
Share on other sites
It''s definitely "cel". The term comes from traditional hand drawn animation were the characters were drawn on transparent cels to keep them separate from the static background image. Anyway, depending on the style of your game you could either go with simple textures and some sort of NPR lighting or with something more complex. It''s fairly easy to either create lighting with distinct lighting levels (just a couple maybe three or so) or transform the lighting into some form of hatching in real time.The light levels approach is dead easy just look up N.L in a 1d texture with the levels (you might want to us enearest filtering). Real time hatching is more complex but still not terribly so.

Share this post


Link to post
Share on other sites
As you said, with terrain it''s very difficult to get flat colors and dark lines, however when you take a look at cartoons (DBZ, Pokemon, He-Man(!), whatever) there usually are no flat colors and hard black lines. The backgounds usually look more like paintbrush still images with flat colored, black outlined characters on top of it. Perhaps you can achieve a similar effect by using a very old trick (I read it somewhere in these forums, looong ago).

-Render the terrain (with regular textures)
-Render a very dark transparent quad over the screen
-Render a very bright transparent quad over the screen to undo the former operation. The colordepth has now severely been reduced, almost like cellshading but not quite... You could use some noisy texture for this to get a somewhat grainy paintbrush effect.
- render the animated characters with regular celshading and black outlines.

I''ll try to compose a screenshot like this in paintshop to see what it would look like.

Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]


GSACP: GameDev Society Against Crap Posting
To join: Put these lines in your signature and don''t post crap!

Share this post


Link to post
Share on other sites
Okay. I did some work in paint shop pro. I took a terrain engine shot from flipcode, reduced it to 8 colors, added some noise and finally pasted NeHe''s cellshade robot in it from tutorial 37 and added it''s shadow so you can have a very very basic idea of how it could look. The real thing would look much better because you can play with the original terrain textures to get some brighter cartoony colors and stuff.




Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]


GSACP: GameDev Society Against Crap Posting
To join: Put these lines in your signature and don''t post crap!

Share this post


Link to post
Share on other sites
quote:
Original post by OrangyTang
What kind of viewpoint for the game? Something battlezone style and close to the ground? Or more Warcraft 3 style and a decent distance above the ground?



Think about a buggy racing game. Your viewing position is close to the ground, and you need to be able to tell where changes in the terrain height are (both close and far). In tradition cartoons the backgrounds are normally drawn differently. While the characters are "cel shaded" the backgrounds are normally more painted with textures and detail (detail really depends on budget). I just don''t know how well either normal computer terrain would look with cel shaded objects or if it would be possible to create that "painted" look (or if there is a way to do the more simple shaded approach). For instance the lego demo has a scene (boat scene) where there are cel shaded hills. However those are far away, and don''t really convey useful information (the hills are there, but you can''t tell where they begin)

Share this post


Link to post
Share on other sites
quote:
Original post by Sander
-Render the terrain (with regular textures)
-Render a very dark transparent quad over the screen
-Render a very bright transparent quad over the screen to undo the former operation. The colordepth has now severely been reduced, almost like cellshading but not quite... You could use some noisy texture for this to get a somewhat grainy paintbrush effect.
- render the animated characters with regular celshading and black outlines.


While nice for static images, this is not great when anything starts moving (including the camera). The artificial dithering tends to be unstable and you get the horrible texture shimmering that we used to know and loathe in 320x240 software rendering days.

Share this post


Link to post
Share on other sites
The guy who used this method claimed that it worked quite well. No artifacts and pretty fast. He used it on animated quake2 md2 models. Surely there is some way to stabalize the dithering effect? Possibly by using textures with enough color contrast or with some other method?

I think the problem with my algo lies with the added noise. Although this adds the brush-effect it''s impossible to stabalize this correctly in an animation. Perhaps it''s better to use textures that will yield a brush-stroke effect after the color-reduction.

Sander Maréchal
[Lone Wolves Game Development][RoboBlast][Articles][GD Emporium][Webdesign][E-mail]


GSACP: GameDev Society Against Crap Posting
To join: Put these lines in your signature and don''t post crap!

Share this post


Link to post
Share on other sites
Getting a terrain to look like the backgrounds in cartoons/animes is far more an artist''s problem than a programmer''s one.

Cutting out the any lighting in the terrain and using properly made and mapped textures can produce awesome results. Try having textures that are mostly flat colors with some sparse details, or with little color variations. A grass field could simply be a flat green, with a few rounded areas with brigther/darker tones of green, or one or another stylish grass lying around.

Share this post


Link to post
Share on other sites