LWJGL
May 23, 2013, 08:31:06 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.0 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: cel-shading (or cartoon-edges)  (Read 2101 times)
dangerdoc
Regular nerd
**
Posts: 71


Thats right... Nikola Tesla


« on: February 11, 2012, 11:31:25 »

I am trying to make a game, and have searched several hours about cel-shading, and cartoon edges, no results. Does anyone have any idea how to make cel-shading like this:


Please help! Huh
dangerdoc
Logged

“We build but to tear down. Most of our work and resource is squandered. Our onward march is marked by devastation. Everywhere there is an appalling loss of time, effort and life. A cheerless view, but true.” - Nikola Tesla
Simon Felix
Talks Too Much
***
Posts: 103



WWW
« Reply #1 on: February 11, 2012, 11:36:41 »

...and have searched several hours about cel-shading, and cartoon edges, no results. Does anyone have any idea how to make cel-shading

How on earth do you search?

The first link that comes up in Google for "cel-shading opengl" is a NeHe tutorial, which shows one way to do it:
http://nehe.gamedev.net/tutorial/cel_shading/25001/

Some other article:
http://www.cse.unr.edu/~mahsman/courses/cs791a/

Did you try that?
Logged

Download Cultris II, the fastest Tetris clone from http://gewaltig.net/
dangerdoc
Regular nerd
**
Posts: 71


Thats right... Nikola Tesla


« Reply #2 on: February 11, 2012, 12:39:03 »

Sorry, I guess I wasn't searching with the correct keywords. I have read one of those pages before, and I didn't understand how to port the second tutorial to java. I just need a simple outline for cubes, and models. I do not understand whether or not you use a shader, java file, or something else. I am stumped with this. I just need an example in lwjgl. Maybe I am missing something obvious, but I have given an honest effort to learn this.

Thanks,
dangerdoc
Logged

“We build but to tear down. Most of our work and resource is squandered. Our onward march is marked by devastation. Everywhere there is an appalling loss of time, effort and life. A cheerless view, but true.” - Nikola Tesla
matheus23
Regular nerd
**
Posts: 62


« Reply #3 on: March 20, 2012, 11:30:58 »

Uhmm... I think this topic is acctually too old. But for anyone, who is visiting this page, because he wonders how it is done (!I'm not sure!, but I think) its done like that:

At first, without GL_DEPTH_TEST being enabled, the whole "World" is rendered as a "Wireframe". That means:
Code:
glDisable(GL_DEPTH_TEST);
glLineWidth([about] 4f);
drawModel([mode:] GL_LINES);
glEnable(GL_DEPTH_TEST);

Now, as you have rendered the "World" as a Wireframe, you just "overwrite" it with the "real" World (omg: sooo much "'s Cheesy).

Again, I'm not really sure if it is done like that, but I'm pretty sure it is. Just look at examples like blender. In blender you see an orange line around your objects in the "3D View". If you texture your object, and view it from the "back-side" (Where the Texture is getting "invisible" because it is the wrong face to show the Texture on (Culling)), you will see an orange Wireframe Smiley.
And the second point why it may be made like that, is, that i'm pretty sure it would work like that Smiley
Logged

My github account and currently active project: https://github.com/matheus23/UniverseEngine
dangerdoc
Regular nerd
**
Posts: 71


Thats right... Nikola Tesla


« Reply #4 on: April 01, 2012, 16:40:30 »

Thanks for the help, (I am new, so I don't exactly know what to change, or where to put your code) but where do you put that? If you put it in a .shader, where do you put the shader? I understand some of the parts of LWJGL, but not shaders. I am struggling with cel-shading, and have spent a good amount of time searching for an understandable (by me) tutorial. I found some code, and other things, but I don't know where to put the code, how to change my source, or even the concept.

Thanks,
dangerdoc
Logged

“We build but to tear down. Most of our work and resource is squandered. Our onward march is marked by devastation. Everywhere there is an appalling loss of time, effort and life. A cheerless view, but true.” - Nikola Tesla
dangerdoc
Regular nerd
**
Posts: 71


Thats right... Nikola Tesla


« Reply #5 on: August 05, 2012, 14:00:09 »

Okay, I have been working at lWJGL, and now I have one final question...
Does this go in the init code or the loop?
Logged

“We build but to tear down. Most of our work and resource is squandered. Our onward march is marked by devastation. Everywhere there is an appalling loss of time, effort and life. A cheerless view, but true.” - Nikola Tesla
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!