Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Characters cel-shading  (Read 5121 times)

0 Members and 1 Guest are viewing this topic.

alenaksu

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 5
    • View Profile
Characters cel-shading
« on: December 19, 2011, 02:05:17 PM »

Hi!
I'd like to have a cartoon style effect with edge detection for my characters, but I can't find a working shader and I am not so skilled in HLSL to write one :(
Can someone help me?

Thanks in advance!


UPDATE:
this is the shader and the result rendered in the wme_effects project
http://www.alessandrovaleri.it/ToonWithSilhouetteRendering.txt

« Last Edit: December 20, 2011, 06:31:39 PM by alenaksu »
Logged

alenaksu

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 5
    • View Profile
Re: Characters cel-shading
« Reply #1 on: December 21, 2011, 06:31:01 PM »

I made some progress :) .. This is the result, but I have to improve the shader

Logged

alenaksu

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 5
    • View Profile
Re: Characters cel-shading
« Reply #2 on: December 23, 2011, 05:35:17 PM »

I finally got something like a cel-shader :)
I added a posterization effect to make the character much more toon-style (8-colors for this example)

The only thing remains, is the outline effect, I can't get it work yet  :(

Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Characters cel-shading
« Reply #3 on: December 23, 2011, 06:32:30 PM »

Hey that's cool!
Can't you use the old glow shader for the outline?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

alenaksu

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 5
    • View Profile
Re: Characters cel-shading
« Reply #4 on: December 24, 2011, 08:12:47 PM »

Hi Mnemonic!
Yes, I tried with glow effect but the result was not so good.. So I decided to try with a Sobel edge detection algorithm. Here is the result, I hope you like it :)

There is a way to obtain the game resolution with scripting?
And if you want I can send you the shader source for publish it on your site



Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Characters cel-shading
« Reply #5 on: December 24, 2011, 08:29:10 PM »

There is a way to obtain the game resolution with scripting?

No. I can't imagine a use for such a feature in-game. The engine runs on a fixed resolution that the developer sets ;)
Logged
fl*p

alenaksu

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 5
    • View Profile
Re: Characters cel-shading
« Reply #6 on: December 24, 2011, 08:40:45 PM »

I would like to pass it to the shader as parameter, just for elegance xD. Anyway i can set it directly in the effect file

Thank you :)
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Characters cel-shading
« Reply #7 on: December 25, 2011, 01:30:37 AM »

I just checked and I found Game.ScreenWidth and Game.ScreenHeight attributes that return screen width & height. I can't check it right now to see if they return game's resolution or layer's size. You can try it.
« Last Edit: December 26, 2011, 06:31:58 PM by Mnemonic »
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Characters cel-shading
« Reply #8 on: December 26, 2011, 06:31:41 PM »

Yes, I tried with glow effect but the result was not so good.. So I decided to try with a Sobel edge detection algorithm. Here is the result, I hope you like it :)
I sure do :)

There is a way to obtain the game resolution with scripting?
As odnorf said, there are the Game.ScreenWidth and Game.ScreenHeight properties.

And if you want I can send you the shader source for publish it on your site
That would be awesome.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.039 seconds with 24 queries.