cel shading plugin

I wrote a plugin that renders models using cel-shading. In order to render them this way it uses 1D textures.

Basically how it works is that the plugin creates a 1D texture for each material it finds. Then the user can specify how many texels that material should have, and HSV values for each texel.

Here’s a screenshot:

http://personal.stevens.edu/~acorriga/celprogress.jpg

Would anyone find this useful if I cleaned it up and released it?

1 Like

Hi that looks like it would be really usefull, I think you should go ahead and produce it. :smiley:

Ken

you know what, mr.devil, it would be quite and maybe even extremely cool if you could implement:

a) possibility of unwrapped rendering of mesh in question
b) auto-assigning UV’s

so this would effectively turn out as a ‘uv-toon texture baker’

In response to tedi, what would you use that for?

[edit]

I don’t think it is any better than the existing toon shader. It’s just different… I looked at the current toon shader. With that you set a color, how much of a gradient there should be between lit and unlit areas, and how big the lit area should be. This is just different. I used the technique described in section 3.1 of this paper: http://www.markmark.net/npar/npar2000_lake_et_al.pdf I think their technique is more flexible. But with flexibility comes the price of more work specifying each texel.

This plugin allows you to.

I personally don’t have interest in edges, but it wouldn’t take much to add that into this :slight_smile:

[edit]

Pencil shaders are possible… This plugin doesn’t do that. Personally I think the pencil shaders are ugly :wink:

ooo Better cel shadeing sweets.

Can it hold more than three shades ? And can it have sharp edges shadow highlight control . Blenders are a bit to soft and round.

Yes it can. Currently there cannot be more than 16 shades… I’m going to raise that to 128.

Do you mean: are there sharp edges between different shades (in shadow vs. lit)? If so, yes, right now it there are actually only sharp edges. If not, can you rephrase?

I should have this out by the end of the week.

Yes it can. Currently there cannot be more than 16 shades… I’m going to raise that to 128.

Do you mean: are there sharp edges between different shades (in shadow vs. lit)? If so, yes, right now it there are actually only sharp edges. If not, can you rephrase?

I should have this out by the end of the week.[/quote]

Coo both of these I was hoping for.

Next question, in your screenshot it looks like it renders to the python screen instead. Can this play in real time like animations?

It runs in real time! But I don’t think it uses animations. But I may add that eventually.

sweets! please do

reply:

baked UVtexture could be used as:

  • realtime cellrender-look texture
  • texface mapped UV texture for renderer

quite useful imo, but it’s your time that gets spent into coding, so you’ll tradeoff if this is popular enough feature to be worth it :stuck_out_tongue:

I would LOVE this script. Think screen printing!!

Interesting :smiley: .
I like those kind of render effect.
I found a NPR website http://www.red3d.com/cwr/npr/, and like the Comic-Strip Rendering (http://www.mcs.vuw.ac.nz/comp/Publications/CS-TR-95-2.abs.html) , Chinese painting at http://www.cs.ust.hk/~cpegnel/ACLP/thesis.html and http://www.red3d.com/cwr/images/npr/strassmann_86.gif very much.
I always look forward to a general render engine interface in blender as I have mentioned long before:

3rd-part renderers can be made for 3ds max, maya or other 3d programs to produce vector or raster images. I think there must be some APIs for writing them.
Is there something peer in blender? I think it will be useful.
I know that only one renderer (i.e., yafray) is going to be integrated in blender? But how? Do we need to change the current source of blender greatly? And what if another renderer ( for example, a flash one) want to be integrated?

I think this mechanism can simplify the coding of render plugins then bring up many render engines hence.

Hey, have you ever heard of liquid, the 3dsmax NPR render?
is much more like a Chinese painting than http://www.red3d.com/cwr/images/npr/strassmann_86.gif.

I neatened up the code a bit.
It’s available at http://uniclipse.com/opensource

Please, post with bug reports, feedback, improvements, etc. :smiley:

?? :expressionless:
No buttons, no sliders but the gray plane shows up when I run the script.

Hi,

OK I tried the cel shader, had a slight problem until I realised I had no material on my sphere :D.

I get the buttons and a display of the object, and it all seems to work OK, but I don’t really understand how to use it, could you maybe do a short howto in very simple terms?

I am using latest CVS build of bf blender, python 2.3, on Windows XP home sp1.

Ken

Sure. I have to go to work soon, but here’s something quick, that may help:

If you haven’t read section 3.1 of the paper I have linked on http://uniclipse.com/opensource/ It’d probably be very helpful. If you look at Figure 2. The essence of this plugin is to setup the texture of each material, which is used to determine the shading, as they show in that figure. For example… try increasing the texel count to 2. That gives you enough slack to have a lit color, and a shadow color. With texel index set to 1, decrease V.

Starting with the default box that loads up in Blender It should look like:
http://guinness.cs.stevens-tech.edu/~acorriga/uniclipse/opensource/screen1.png

If the interface doesn’t even load, can you share the error you got on the console? I’m guessing that you are missing materials, a lamp, or a camera. There isn’t exactly robust error handling, so it probably just said list index out of bound or something.