Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Cell shading?

Author
Message
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 2nd Sep 2005 18:30
I've never really thought about this before, but how would you do cell shading?


Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 2nd Sep 2005 19:38
Well, I think first, you'd probably search the forums

There's a lot about DBPro cell shading. If you were wanting to do it in DBClassic, that's a whole new kettle of fish. I'm not sure you could (or rather, I don't think it would be feasible).

Cell shading involves taking information from every pixel on an object and doing something to it. And I believe one way they get the black line around the outside is to check the normals on the polygons - if they find one that faces away from the camera next to one that faces the camera - it must be an edge.

So, rather complex, but it's easy done in DBPro (I think it's even included).
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 2nd Sep 2005 23:25 Edited at: 2nd Sep 2005 23:32
Well, this is the DarkBASIC Classic forum

Cel-shading is very possible in DBC, as this sample shows:

(Note: The two models and the textures are in a zip file on my website - http://blanky.clearphp.com/tree.zip (160KB).)



....would be the 'Dark' setting.

Indeed, if you can handle working with two rather than one objects, the code can be simplified to this:


It's all based around the fact that if you negatively scale an object, DB's z-buffer freaks out and makes it so that anything that's inside that object can still be seen. Kinda like transparency, only ... weirder.
And then you can always play around with the ambient light settings for 'cartoon lighting'...

Why is there a tree_mirror.3ds and a tree.3ds, I hear you ask? Well, try replacing 'tree_mirror' with 'tree', and you'll see the one problem with negative scaling.

Yes, it flips the object inside out.
So far, my only solution has been to make another copy of the object and apply (in 3ds max) three Mirror modifiers, one for each axis...
Hence the tree_mirror.3ds filename.

I'm still looking into flipping the object the right way round through memblock code, and I'll get back to you on it...

[Edit: Oops, I was wondering why the keys were a bit irresponsive ^_^ Fixed.
Also, the crap tree was made by yours truly (i.e., ME), and I say you can use it royalty-free because it's so crappy. Enjoy.]

[Insert extremely witty comment here] :: Add me to MSN if you like, but don't expect any big favours [unless you like VB6]. ... IDK!!
Lzdude69
21
Years of Service
User Offline
Joined: 21st May 2004
Location: Indiana
Posted: 3rd Sep 2005 09:00
i made a little cell shading function after i saw this post this morning, and i found on symmetrical objects you dont need to mirror(obviously) and on some complex objects you can just rotate the object 180 degrees on the x-axis, then rotate it again 180 degrees on the y-axis, or something, at least i attempted to do it, and i got halfway through the function and i lost interest, or just got tired of trying. It's a very simple function, it didn't take me very long to get it working half decently.

I'm too lazy to type anything here...
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 3rd Sep 2005 12:04 Edited at: 3rd Sep 2005 12:39
Not bad - it's quite a neat little automatic cel-shading function you've got there.

(If you want to get cel-shaded and non cel-shaded objects on the same screen, you can always use 'Set Object Light' with either really, really low numbers or really, really high numbers (depending on the look you're after, obviously.))

Also, it'd probably be better if you always attempt to mirror the object - Symmetrical objects won't be effected by it, some objects would be helped by it, and 'complex' objects would look wrong anyway, so...

[Edit: I'd just like to point out that nowhere else on the forum can you find the 'Dark' cartoony look - Yes, everybody else used 'set ambient light 100'... ]

[Insert extremely witty comment here] :: Add me to MSN if you like, but don't expect any big favours [unless you like VB6]. ... IDK!!
Lzdude69
21
Years of Service
User Offline
Joined: 21st May 2004
Location: Indiana
Posted: 3rd Sep 2005 20:04 Edited at: 3rd Sep 2005 20:06
@blankly:dude, is it "cell shading" or "cel-chading"?

well, as complex i meant, is not really a primitive, and is sort of symmetrical on all axis's, if you have an object that is symmetrical on the y-axis, like a face, you can just rotate it 180 degrees, but it can only be symmetrial on one axis, i think

but your tree, there's noway that would work by just rotating it

I'm too lazy to type anything here...
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 3rd Sep 2005 23:36 Edited at: 3rd Sep 2005 23:38
Exactly, but it wouldn't work anyway without rotating, so what have you got to lose by rotating it?

Anyway, I've still got to look into mirroring that damn object memblock, as that might do the trick.. Grr...

[Edit: Btw, it's 'cel-shading'.]

[Insert extremely witty comment here] :: Add me to MSN if you like, but don't expect any big favours [unless you like VB6]. ... IDK!!
Lzdude69
21
Years of Service
User Offline
Joined: 21st May 2004
Location: Indiana
Posted: 5th Sep 2005 01:56
i was looking into another post and the 'postee' was asking how to move a vertex with memblocks, if you just did that, however how, you could just make a function like "positionvertex(-x,y,-z)" that manipulates the vertex, i dont know...

I'm too lazy to type anything here...
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 13th Sep 2005 19:14
hey all, sorry i havent replyed, ive been on holiday, but i like what im seeing, but anyway, how would you get a dark outline for the object? (it doesnt matter if its too complicated though)


blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 13th Sep 2005 20:09
Haven't you tried the code? It DOES have a dark outline.

Part of the 'Emergency Response Noob Shooting Team' :: Feel free to add me to MSN, but don't expect any big favours [unless you like VB6]. ... Do what I do, not what I say.
##GERI##
User Banned
Posted: 14th Sep 2005 23:56




http://LegendgrafiX.tk
dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 15th Sep 2005 08:00
I swear your teasing us with that picture lol!

Quote: "ive been on holiday, but i like what im seeing"

Sounds like we all work in a little factory and you come up to us (them) and say, "what od you have" the people show you their work and you say, "It's sucks, but I like what I'm seeing". No just kidding, but really, You need to finish that cel-shading function Lzdude69 .

------------------------
Visit my website of games
http://www.dabip.co.nr!
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 16th Sep 2005 22:13
@blanky

oh sorry, i didnt notice the outline on the screenie (i couldnt try the code because this pc doesnt have db)

@##GERI##

Guurrrrr, your trying to annoy me


Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 17th Sep 2005 15:07
Make the same object a little bigger then the original and make it black inverted. Make it do everything identical to the original to get the black line around the objects...

That's the way it's done with the Blockman puzzle remix.

Immunity and Annihalation makes Immunihalation...
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 17th Sep 2005 22:06
Quote: "Make the same object a little bigger then the original and make it black inverted. Make it do everything identical to the original to get the black line around the objects..."


THAT'S WHAT IT DOES.

No offence, but at least try reading the code before you post.

Part of the 'Emergency Response Noob Shooting Team' :: Feel free to add me to MSN, but don't expect any big favours.
I AM _NOT_ A MOD, I AM ONLY HUMAN (although I fly in my spare time).
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 18th Sep 2005 08:40
hey hey all, im back from my very fine holiday in florida (thought i spent most of my time in the car while my mum got us lost)

@blanky

Ive tried your thing, its really good, thanks alot


Lzdude69
21
Years of Service
User Offline
Joined: 21st May 2004
Location: Indiana
Posted: 20th Sep 2005 03:39
Hi guys, i've become pretty comfortable with cel-shading so i started working on a new cel-shaded game called "HobbitHunting" you go around and hunt for hobbits, and its coming right along. Right now it is a free roaming fps, in which you go around hobbiton searching for hobbits, with a net gun(i respectively stole from spongebob, the one where he steals sandy's rocket and thinks he goes to the moon), and right now its turning out real well.

I'm too lazy to type anything here...

Login to post a reply

Server time is: 2025-05-22 15:25:39
Your offset time is: 2025-05-22 15:25:39