Home Technical Talk

[MAYA] Free NPR viewport material (image heavy)

polycounter lvl 8
Offline / Send Message
brurpo polycounter lvl 8
Hey guys! long time no see!

During the quarantine I decided to get out of my confort zone and try doing some NPR, but keeping its usage closer to PBR and metal/roughness workflow. Using oren nayar diffuse model and GGX specular model.
This is where I got to!
This is a shaderFX shader (for it to work, maya must be on opengl (its the default) and the outlines work better with 16X AA)
The outlines were done using partial derivatives, thats why you need a large AA number, it still does not work between objects nor on 100% hard edges, but it solves some problems, as there is no need for additional geometry, its easier to compose, and there is no sorting problems.

I am porting it to OSL, but there are several limitations to OSL on Arnold, no proper derivatives nor custom closures to name a few, the solution is messy and inefficient so this shader I am not releasing, but if autodesk hears me (doubtful) and removes some of the limitations, I will release it too.

There are 3 vertex painting options, I will use the default color set names in the description bellow, but you can change it in the shader:
CEL: Use a default value of 1, then values bellow 1 pushes the cel shading away from the light, and above 1 towards. This is useful to have artistic control, IE on clothes, and for shadows in specific places, like in the char example bellow, under the nose and mouth.

OUTLINE: Use the red channel to mask outlines and the green one to modulate its width.

You can choose how many levels of CEL you want in the shader (0 to infinity), and even convert your HDRI to CEL using the "USE ENV STEPPING" option.

Still, its an artistic shader, so its a bit more complex than a PBR shader and it has more controls.
If you want for it to be the default shaderFX shader, just put the file on "Documents\maya\ShaderFX\Scenes"

You are free to use it commercially if you are an individual freelancer, or doing non-profit work.

Here are some examples!
Hope you like it and thanks for your time! Cheers!








And here is a test with the arnold shader, with complex lighting and shadows and indirect lighting:



Thanks again!!

Replies

  • dlz
    Offline / Send Message
    dlz polycounter lvl 4
    Hi, it looks pretty good, but i can't open the file you shared inside the CEL_SHADER, can you check?
  • monster
    Offline / Send Message
    monster polycounter
    Nice work! It’ll be a few days before I can test it. But I really want to check it out soon.

    BTW, I think the OSL short comings are designed to be augmented by the node interfaces. You might be able to complete it that way? And it’s developed by Sony Pictures not Autodesk. 
  • brurpo
    Offline / Send Message
    brurpo polycounter lvl 8
    dlz said:
    Hi, it looks pretty good, but i can't open the file you shared inside the CEL_SHADER, can you check?
    Thanks Man! Sorry, I did not quite understand what you mean, What file are you talking about? The shader itself or the some file its referencing? If its the later, its an HDRI, free from hdri haven, you can use any HDRI.
  • brurpo
    Offline / Send Message
    brurpo polycounter lvl 8
    monster said:
    Nice work! It’ll be a few days before I can test it. But I really want to check it out soon.

    BTW, I think the OSL short comings are designed to be augmented by the node interfaces. You might be able to complete it that way? And it’s developed by Sony Pictures not Autodesk. 
    Thanks a lot man!!

    Yes, its from sony, but its implementation on Arnold is managed by autodesk and the Arnold team. When it comes to the partial derivative functions (Dx(), Dy(), Dz()), the way autodesk implemented it on Arnold, makes it unusuable on anything other then P (position). Unfortunately, there is no way to do it with nodes.
  • dlz
    Offline / Send Message
    dlz polycounter lvl 4
    @brurpo No no, it was that i didn't have the plugin for shaderFX activated, so it didn't recognize the file :#
    This would look even cooler in Arnold hope you get the chance to port there :)
  • RN
    Offline / Send Message
    RN sublime tool
    @brurpo this looks pretty cool, great work!
    In order for the mouth to have that single stroke seen in the closed-mouth smiles like in that last image, did you have to overlap one lip on top of the other (as in, to hide the other lip so you only get a single visible line instead of two)? Can you show the wireframes?
Sign In or Register to comment.