Skip to main content
GameDev.net gamedev.net
🔒 Locked

Comic style clouds

Started by stephanh May 31, 2003 at 3:56 AM 7 replies 1.8k views
Original Post
stephanh
stephanh
Hi, i've implemented a procedural cloud generator which works quite well. To suit our general style i'd like to give them a "cel-shaded"/comic-style touch. My first try was to get sharper cloud edges by just mapping alpha values with an exposure ramp and the same for color values (use the exp-ramp for a simple alpha-blending function). Obviously the approach doesn't lead to the desired result. So, do you know any simple algorithms for contour tracing and "cel-shading" on 2d data like perlin-clouds? I'd like to archieve something like that: From an Flipcode IOTD Thank you very much. regards, Stephan
eisscholle.de [edited by - stephanh on May 31, 2003 2:19:39 PM]
oliii
oliii
what they usually do to produce outlines on models, is to render the back faces as black, with a polygon offset that pushed the back face slightly in front of the front face. Or the vertices on the back face would be extruded slightly (pushed along their normal), to make the back faces slightly bigger than the fron faces, thus making them sticking out on the silhouette edges. If you don''t want that extra complication, have a duplicate model of your object, that is slightly extruded. Render the original model with lighting and culling back faces, and the extruded model with no lighting, black (for black outline), and culling the front faces. The slightly larger silhoutte edges of the black model will show on the outline.

To do it cheaply, you could also render the back faces as wireframe, and set the line thickness to 3 or 4 pixels. if does the trick for me, but the far objects would have a thick outline. The line thinckness in opengl in on a per pixel basis, no matter if the line is far away or close to the camera.
Everything is better with Metal.
stephanh
stephanh
Thanks for your response oliii, for polygonal data polygon offset and rerending works fine. However, the problem is that i am dealing with bitmap/pixel data here, so i don''t have any edges to redraw.



eisscholle.de
jdi
jdi
I think for those clouds they didn''t use perlin noise. Instead, they formed them out of groups of spheres, and then cel shaded that. Perlin noise and other "fuzzy" things don''t transfer too well to a cartoon like environment.

j
oliii
oliii
Ha, I misunderstood the problem, looking at the picture you referred to.

right, no idea....
Everything is better with Metal.
MENTAL
MENTAL
can''t scale the cloud image by some amount in both directions and render it 100% black, then draw the original cloud image over it at full size?



as you can see the outlines will mess up a little with concave objects, but i''m sure there are some artices on the net that can sort this out.

google "silloette bitmap" or something similar. and check the spelling of silloette too

hope it helps
ApochPiQ
ApochPiQ
I once wrote an image filter that would add a black outline around a bitmap as it scan converted it onto the screen... I don''t have the code anymore but the basic idea was simple. As you draw the bitmap, keep a boolean flag. When the color of the bitmap is (in this case) mostly blue, set the flag to false. When the color is white, set it to true. When the flag changes values, draw a black pixel instead of the bitmap''s color. This causes minor artifacts and can look nasty when the polygon is far away, but for clouds it should work great.
coelurus
coelurus
The clouds look vaguely shaded on the borders, not black.
If you make a cloud-layer, add a simple cel-shading-filter to it; low values get blue (x <= lo), high values get white (x >= hi), and inbetween (x > lo && x < hi), you add either totally black or a slight grey scale.
Precompute all possible values (0..255 I guess) into a LUT to skip the pesky if's for every texel.

EDIT: Perlin noise wouldn't look very bad for this, but try not to have to much details. Also, don't copy their look, do something you are comfortable with

[edited by - coelurus on June 1, 2003 4:28:56 PM]
eldee
eldee
the easiest way to do an outline is with the stencil buffer.. nuff said.

-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.