Jump to content

Toon Shading


Mcronin

Recommended Posts

I wrote a toon shader and an edge dectector COP. Here's a test. It's some enemy from a game called Dragon Quest. It's very simple; I'm working on a much more complicated model. I just needed to make something quick to test with. I'll post something better down the road.

The shader started out being based on the one in the Advanced Renderman book, but I quickly figured out I didn't like the way it worked, so I wrote one that doesn't do edge detection, supports textures, uses a constant base layer and adds ink layers on top of that (up to 3), and outputs some AOVs for the edge detector. The edge dectector does detect interior edges pretty well using normals and surface IDs, I can control the line width so I can get thin pencil lines or variable width marker style lines. I can use brushes on the lines though they don't really seem to make much difference unless the lines are really fat. I can also control the line color. The one drawback is I have to render gigantic control images, so it's pretty much useless in Apprentice.

Here's the pic. More coming eventually.

post-257-1142414398_thumb.jpg

Link to comment
Share on other sites

I'm interested in achieving this:katsu

25669[/snapback]

That's not a surface shader, and therefore not a "toon" shader in the usual sense. It's an imager shader. Imager shaders are not supported directly in Mantra, but they can be implemented as VEX COPs. But more importantly, the *reason* why he wrote it as an imager shader is that the entire scene is defined inside the shader itself -- meaning that you could port the whole thing into COPs, but then you could ever only "render" a box and a dresser... :rolleyes:

This is also how he can extend the lines and so on -- because the geometry being rendered is inside the shader itself.

P.S: Looking good, Mike! :)

Link to comment
Share on other sites

You should be able to pull this off. I haven't done much with COPs besides this edge detector but I don't see how it wouldn't be possible to do something like that in COPs. You can find and color any pixel in COPs. When you get down to it, that's all you really need to do anything; find a pixel and color it. So, it's just a matter of figuring out how to find the "right" pixels and how to color them with the "right" colors.

Link to comment
Share on other sites

You should be able to pull this off. I haven't done much with COPs besides this edge detector but I don't see how it wouldn't be possible to do something like that in COPs. You can find and color any pixel in COPs. When you get down to it, that's all you really need to do anything; find a pixel and color it. So, it's just a matter of figuring out how to find the "right" pixels and how to color them with the "right" colors.

25692[/snapback]

Hey that's nice,

you just nailed down the solution to every problem of image synthesis ;)

Link to comment
Share on other sites

Why do I feel like you are having a go at me?  :P

No way, to be honest I really thought about visuals this way. It's a bit awkward but interesting, all we see are just right colours put into right places.

15 years ago I had a friend who copied enlarged figures from amiga action mag. covers pixel by pixel using deluxe paint software.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...