Jump to content

Toon Ink Shader Possible?


Recommended Posts

There are many attributes not mentioned anywhere apart from occasionaly.

There are lot's of well hidden gotchas in this software.

Thanks

23982[/snapback]

Don't forget of course you didn't need to do it this way, you could always just do seperate passes rather than using deep raster. Bit slower but it doesn't require any deep knowledge.

One other thing, looking around at Vray toon examples I think that they use something very similiar to this method, probably they don't use the normal pass, just the id part. Or something like Jasons method which seems to work very nicely. Good one Jens.

Link to comment
Share on other sites

Thanks for your great help.

Surely after joining these methods one could achieve any result in composition.

I don't think any of these methods are similar to vray or xsi toon ink shaders.

SESI really should pump up wren.

XSI's is probably the best by far, but it is raytraced and draws lines depending on conditions set.

It will be the best in my case to use xsi for ink rendering (as Mario wrote) since I know it and it is a ready made.

I have to learn vex more to try make something like that by myself.

If you are interested and have a few spare moments you can download xsi foundation and check it out, its great, flexible, easy and gives good results in every situation.

Link to comment
Share on other sites

Here is that other way of geometry edges - that game trick. I neglected to mention that you have to turn on Remove Backfaces not in the Object's Shading tab, but in the Display Options > Optimization tab.

Anyhow,  try this out.  You can also render this with Mantra and get a similar effect.

23989[/snapback]

That is one cool toon shader jason!

post-847-1137877175_thumb.jpg

Link to comment
Share on other sites

Thanks for your great help.

Surely after joining these methods one could achieve any result in composition.

I don't think any of these methods are similar to vray or xsi toon ink shaders.

SESI really should pump up wren.

XSI's is probably the best by far, but it is raytraced and draws lines depending on conditions set.

It will be the best in my case to use xsi for ink rendering (as Mario wrote) since I know it and it is a ready made.

I have to learn vex more to try make something like that by myself.

If you are interested and have a few spare moments you can download xsi foundation and check it out, its great, flexible, easy and gives good results in every situation.

23996[/snapback]

I'll definetely give it a look, I'm very interested in these types of render. And I'm interested as to why you think Vray is different. I've looked at the output of a great many cartoon and illustration renderers and all of them look like one or other of the techniques discussed here. What makes you think they are done differently? The only one I've seen that looks different was one I saw done in Maya which actually generated wireframes a bit like the one I show in the geo_outline, the difference being it worked on curved surfaces just as well as flat geometric ones.

XSi don't have a learning edition - guess this will have to wait.

Edited by sibarrick
Link to comment
Share on other sites

That is one cool toon shader jason!

23998[/snapback]

Enjoy:)

In the VOP network I do a basic thing but multiplying up the illumination by 3 (arb number of bands of lighting), rounding it to an integer and then dividing it back down by the same amount, thereby "quantizing" the illumination to get the distinct bands of lighting. Simple but maybe not the "wisest" thing to do shaderwise because it causes unfiltered discontinuities, which something to what out for in professional shader work because you can get bad aliasing on surfaces. You should use filterstep and so on, but this was a fun and easy way to do it.

Link to comment
Share on other sites

Just in case you guys want to know about toon, 3dsmax, vray...

The basic toon shader that comes in max is suposed to be an early version of Brazil r/s that was called ghost, and ray fx before that (today, Brazil has a more developed toon shader). From what I know, this process seems diferent from the renderman's classic style because it is suposed to use raytracing. That is probably why it is really slow, specially in the "high quality" mode to avoid antialiasing.

VRay's toon is done else where, not in a material level. It is on a toolbar called atmospherics where all the fog and other volumetric stuff is done. I have no ideia what/how/why is done over there. But it does only the outline stuff, if you want the constant shading, that has to be done in the material editor. The down side of that is, all the objects in view has the same toon outline i think. But it is faster than the ray tracing. And just for curiosity, most hair/fur plugins for 3dsmax work from this atmospherics toolbar.

and just to show off a little... vray's volumetric toon works with GI. (thanks Fernando for sending the pic)

post-847-1137981570_thumb.jpg

  • Like 1
Link to comment
Share on other sites

and just to show off a little... vray's volumetric toon works with GI. (thanks Fernando for sending the pic)

24041[/snapback]

Just FYI, these mantra toon solutions will work with GI too. Try a Light with a VEX Global Illumination shader on it. The VOPnets which use Lighting Model VOPs as opposed to dot(N,L) operations will run light shaders as expected.

Link to comment
Share on other sites

I wonder if it is done in atmospherics because it is edge detecting the depth pass. I don't have the renderman book in front of me at the moment but I think that is another technique you can use, I forgot to put it in my version I posted. I'll try it out. I still have to say that even that render looks like it is using edge detection, I just can't see how you can generate an even width line straight out of a render, never even seen a paper on it. It's much simpler to do edge detection.

Link to comment
Share on other sites

I wonder if it is done in atmospherics because it is edge detecting the depth pass.

24051[/snapback]

Yes, as far as I know the XSI toon rendering is a complex system, a combination of surface and atmosphere shaders. It's a mature system, developed over the years. And it is slow.

Dragos

Link to comment
Share on other sites

sibarrick, the use of atmospheric is really weird for me too. I read vlado saying that the toon wasnt even requested from vray's users, but it was so easy to implemet it this way that he just added it there... as a bonus i guess. But as I said, the way it is right now is really really fast but limited. And i think there is an option there for width using pixels or world units.

Link to comment
Share on other sites

I think they are basically ray-marching ( as you would in a fog shader ) and detecting the edge as combination of knowing the id of the hit object and the change in depth - for internal edges. This is basically the same as doing those passes first and then doing an edge detection. But with the advantage of being able to over sample when you need to.

However if you really wanted it would be possible to write a shader that exactly mimic the way they are doing it. At the end of the day its not magic its still a shader, its just a different way of setting it up. Add to that some marketing hype and voila you have "The worlds best toon shader".

I think it would be possible to get just as good results by doing combinations of what has been suggested in this thread - maybe rendering at higher res and scaling down in order to get the over sampling. And it would be a lot quicker too.

After all it was good enough to do this

Iron Giant

Here's a depth pass edge detection with some over sampling, developed over a lunch time....

post-509-1138025195_thumb.jpg

cartoon.zip

Cleaned it up a bit and added comments

cartoon1.zip

edit: you might want to put the gamma back in to strength the line darkness.

I've looked at the Xsi tut videos now and this is definetely how they do it.

Combined with the edge detect on ids. They also add depth thinning of the line weights but that is fairly trivial to add to.

Go to outputs and render the comp output.

Edited by sibarrick
Link to comment
Share on other sites

Here's a depth pass edge detection with some over sampling, developed over a lunch time....

post-509-1138025195_thumb.jpg

cartoon.zip

Go to outputs and render the comp output.

24058[/snapback]

Hehe, you rock! B) I'll check the file from home tonight. The image looks really good.

*edit - Hey look at that, Im not a Peon any more :lol:

Link to comment
Share on other sites

Anyone who downloaded cartoon1.hipnc might want to note that I took the gamma correction step out, to make the image in the post you need to put it back in. Just gamma the Pz by 10 to get stronger lines.

Still poking around with this, I think doing edge detection on normals works better. If you want to get outlines on hard edge shapes with this technique just use the facet sop and cusp polys first. I missed this simple thing originally. The problem with edge detecting depth is where two object touch you potentially don't get an edge because the depth is the same.

Anyhoo all the methods really need all wrapping up in a nice hda. Then you'd get complete control.

Link to comment
Share on other sites

  • 2 weeks later...

I put a toon COP/Shader combo together based on the Advancend Renderman Book and an old paper I found from someone at WDFA. Basicly it was a combination of a toon shader, a shader that out put extra variables like normals and sidedness, and a COP (with some VOPs) that would use the extra variables to draw lines. In a nutshell what the COP did was check all the channels of the neighboring pixels to the current pixel to decide whether or not to ink the current pixel. It actually worked pretty well, but didn't have a lot of options.

Link to comment
Share on other sites

I'm browsing "Rendering with mental ray" now and there are several contour shaders described: silhouette, edge, reflection refraction, normal based etc.

And all of them are done in post, based on contrast differences produced by prerendering!

So in xsi it would be just what you guys were talking about just all connected in one shader.

And if so, the best way to create such a shader would be an otl with some rops and cops inside to do the thing as one pass with simple controls and many output possibilities as checkboxes(silhouette, interior, ink only... etc.)

Just gotta dig further this week.

Link to comment
Share on other sites

just noticed this. There's also this, which is similar to other folks suggestions:

http://www.renderman.org/RMR/Shaders/IDShaders/index.html

get the toon shader. It's fairly short, an easy rewrite. I used it on "The Way Things Work" at the metreon mall, as well as some tests for titan AE.

Also theres a new uberlight, it could be used as a shader on a sunny day...

http://www.gossamergear.com/cgi-bin/gossam..._uberlight.html

Link to comment
Share on other sites

  • 2 months later...

Been playing with toon shaders some more.

I've taken Jasons geometry method and turned it into a shader method. The main advantage here is that you can setup all the outline objects as instances and control all the line widths with displacement shaders. This means you don't need tons of duplicate geometry in the scene.

It works very well for organic shapes. For hard edged objects like cubes you don't get internal edges, but those cases are solved nicely with the other methods.

post-509-1144513209_thumb.jpg

displace_outline.zip

post-509-1144513699_thumb.jpg

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...