Page 1 of 3 123 LastLast
Results 1 to 15 of 32

Thread: unreal2 extreme toon shader and varying line thickness

  1. #1
    Newbie Member mattratcliffe's Avatar
    Join Date
    Aug 2010
    Location
    London
    Posts
    9

    unreal2 extreme toon shader and varying line thickness

    Hi all

    I've been wrestling with the unreal toon shader and have hit a brick wall. Basically I want to control the edgetracer line width using the incidence angle of the light. However I've tweaked the nodes in the pixel filter toontracer and it just doesn't work.

    http://screencast.com/t/SSKJ4D2Km

    And a screenshot of what I have at the moment:

    http://screencast.com/t/9wlROkOGuC

    I'm a nodes noob and this combined with very little documentation out there is making it a difficult challenge.

    Any help would be much appreciated as I'm pulling my hair out!

    thanks

    Matt

  2. #2
    Super Member nickdigital's Avatar
    Join Date
    Nov 2006
    Location
    Burbank, California USA
    Posts
    4,576
    I think you need to plug the light info into a gradiant node, not an incidence node...I think. I'm a noob with nodes too.

    The only time I've had to change line thickness I've done it with a procedural to give a brush look to it.
    My opinions and comments do not represent those of my employer.
    Profile piece
    2010 Reel
    'The X's' Reel

  3. #3
    Dreamer MooseDog's Avatar
    Join Date
    Jul 2003
    Location
    Mount Whoville, VT
    Posts
    1,438
    Quote Originally Posted by nickdigital View Post
    I think you need to plug the light info into a gradiant node, not an incidence node...I think. I'm a noob with nodes too.
    good first step
    We are pirates, we are artists...

    Blog

  4. #4
    Newbie Member mattratcliffe's Avatar
    Join Date
    Aug 2010
    Location
    London
    Posts
    9
    Thanks for the replies guys. I've had a go with the gradient but still nothing.

    When I add a texture straight into the size section of the toonshader (when I press the T )I can control the line thickness because the gradient gives me values I can put in. I can't add in incidence or light incidence, only normal angle (which is stupid)

    http://screencast.com/t/41fvjdkjSTlO

    The problem I think is how gradients work in nodes. When I add a gradient node it doesn't have these values any more, just colour and alpha. I think the edgetracer brush is looking for values and not colours to control it's line thickness. Does anyone know how to add values into a gradient in the node editor.

    http://screencast.com/t/xPmsMKRRmI01

    Are there any other techniques to getting varying edge size. I have tried the reverse light incidence gradient trick but doesn't work due to the low poly nature of the model.

    Any help much appreciated


    cheers

    Matt

  5. #5
    Super Member nickdigital's Avatar
    Join Date
    Nov 2006
    Location
    Burbank, California USA
    Posts
    4,576
    Some with more nodes experience will hopefully chime in cuz anything I do with the gradient doesn't change the thickness.

    Do you have to use Unreal? Maybe a different technique is the way to go?

    http://www.newtek.com/forums/showthread.php?t=113243
    My opinions and comments do not represent those of my employer.
    Profile piece
    2010 Reel
    'The X's' Reel

  6. #6
    Newbie Member mattratcliffe's Avatar
    Join Date
    Aug 2010
    Location
    London
    Posts
    9
    Thanks again nickdigital for the response. I've taken a look at that guys work and tutorials. Very useful with superb results but not all the techniques work with lowpoly objects. I'll keep plugging away at this till I get something half decent.

    I'm also going to take a look at blender too, as the freestyle render looks incredible. If only Newtek would seriously look at NPR in Core.

    http://www.youtube.com/watch?v=79v-GXg3LqU


    cheers

    Matt

  7. #7
    Super Member nickdigital's Avatar
    Join Date
    Nov 2006
    Location
    Burbank, California USA
    Posts
    4,576
    I assume you've tried the flip poly technique too? Dupe your object, make it a little larger and flip the polys. We use that when we need to make instances as instances don't render Unreal or LW lines. That technique probably won't give you the look you're after but it's an option.
    My opinions and comments do not represent those of my employer.
    Profile piece
    2010 Reel
    'The X's' Reel

  8. #8
    Animated Fool paulhart's Avatar
    Join Date
    Mar 2003
    Location
    San Diego, CA
    Posts
    757
    Take a look on the Freestyle Blender thread (HERE) towards the bottom, where Blendman has posted his most recent renders with this branch. Thick and thin line, beautiful quality. I have been "beating" the drum for NPR for awhile, and have been making "builds" of the Freestyle branch over on Graphicall.org, for Win32 and Linux64.
    I too have used UnrealExtreme2, and I went so far as to send a PM to customer service to try to get Rob Powers to visit the developers in Japan for UnrealExtreme to foster development and integration. Lightwave has lagged in this area, and given how big arch/viz, illustration, and animation can be with good line drawings, this needs to be more of a priority. "Other" programs have devoted modules and integrated solutions. Take a look at the Blender for an idea of what is needed.....
    Paul
    An eye for an eye, and the whole world goes blind... Gandhi/MLKing
    Greater consciousness is worth the effort. Be aware.... so sayest the Animated Fool ~ HARTWORKS www.hartworks.net

  9. #9
    Newbie Member mattratcliffe's Avatar
    Join Date
    Aug 2010
    Location
    London
    Posts
    9
    @nickdigital I haven't tried that technique yet but it's on my list! My worry with that is animating and deforming a mesh, but I'll do a quick test to see how that works, thanks for reminding me !

    @paulhart Cheers for the link. Absolutely awesome stuff happening with blender at the moment. I think it's about time I dive in and have a go!

    It's a real shame Newtek don't take advantage of the unreal shader, but I guess it's not on their priority list. Although I think NPR is slowly gaining momentum in the industry, it's still very niche at the moment but blender certainly looks like it's leading the pack.

    Anyway, thanks guys. Will post something up if it's any good.

    cheers

    Matt

  10. #10
    Animated Fool paulhart's Avatar
    Join Date
    Mar 2003
    Location
    San Diego, CA
    Posts
    757
    I had gotten the incidence angle to work before, so I will look around at some of my "node" efforts. The current Blender builds (2.54) don't have the incidence angle node activated, so we may have to wait for 2.6 to get it to work properly without a lot of work arounds, but those trials by Blendman as just delicious, glad you enjoyed the taste as much as I do.
    An eye for an eye, and the whole world goes blind... Gandhi/MLKing
    Greater consciousness is worth the effort. Be aware.... so sayest the Animated Fool ~ HARTWORKS www.hartworks.net

  11. #11
    Newbie Member mattratcliffe's Avatar
    Join Date
    Aug 2010
    Location
    London
    Posts
    9
    If you have any node examples that would be awesome. I may just hold fire then with Blender if there are a lot of work arounds, my poor brain is struggling with Lightwave as it is!

    cheers

    Matt

  12. #12
    Worms no more! Free fun! Dodgy's Avatar
    Join Date
    Feb 2003
    Location
    Sydney
    Posts
    8,275
    Have a look at this setup. This is where having a maths degree helps.
    The dot tells you how in line a surface normal is to the light direction, and then the add shifts it from -1 to 1 range into positive numbers, then this value is scaled using the multiply.

    You can do the adding and scaling in the shader node setup or the pixel filter node panel, depending on how much control you want of your object's lines.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Temp.jpg 
Views:	150 
Size:	43.6 KB 
ID:	89126  
    Push the software, don't let it push YOU!
    My own plugins and work:www.mikegreen.name
    LaptopSetup:corei7 2.4GHz nvidia GT 650M 8Gig win8 64
    WorkSetup:core i7 3.4Ghz nvidia Quadro 2000 12Gig Ram Win7

  13. #13
    Super Member nickdigital's Avatar
    Join Date
    Nov 2006
    Location
    Burbank, California USA
    Posts
    4,576
    Oh wow, nice one Dodgy!
    Last edited by nickdigital; 10-17-2010 at 10:37 PM.
    My opinions and comments do not represent those of my employer.
    Profile piece
    2010 Reel
    'The X's' Reel

  14. #14
    Animated Fool paulhart's Avatar
    Join Date
    Mar 2003
    Location
    San Diego, CA
    Posts
    757
    Oh Dodgy, Hello.. to all.
    I spent the better part of the afternoon, trying once again to generate the thick/thin line of my dreams, one which Blender Freestyle (see prior thread) generates with greater ease, but doesn't yet have the direction/incidence node implemented in 2.54. I put many combination of nodes together to no effect. You appear to have cracked it with you math smarts... however, the incompleteness of the diagram image made it impossible for me to duplicate your fine results. I found in odd that the Add Node only has one input, as does the Multiply (are they Scalar or Vector Add/Multiply Nodes?). I am still struggling, thinking that this should be easier. I have been using UnrealExtreme2 for several development generations, yet a quality, thick/thin, hand drawn line has eluded me. So, math guru, please expand your description and images to help me and others. Thank you in advance, your help is always appreciated.
    Paul
    An eye for an eye, and the whole world goes blind... Gandhi/MLKing
    Greater consciousness is worth the effort. Be aware.... so sayest the Animated Fool ~ HARTWORKS www.hartworks.net

  15. #15
    Worms no more! Free fun! Dodgy's Avatar
    Join Date
    Feb 2003
    Location
    Sydney
    Posts
    8,275
    Okay, some things to note with nodes

    Connections are colour coded. Green links are scalar (just normal one dimensional numbers, like 1, 1.4, 7 etc). Blue are 3d vectors. Red are colours (which are basically also vectors, as the have 3 dimensions so you can use them in a lot of the same situations as vectors). Magenta are integers. Cyan are materials. Also, the add node (as with other nodes) if you use it with just one input, the other input is a value which can be adjusted by the user.

    From this you can tell the add and multiply nodes are scalar nodes.
    The Dot node takes two vectors and (if they are unit vectors, which I think the Surface Normal and Light Direction vectors are) it returns the Cosine of the angle between them. As we all know, if the normal's direction matches that of the light direction, this is 1, of the normal is at 90 degrees to the light direction that's 0, and the normal is facing the opposite way, this is value is -1.

    So we shift the range -1 to 1 up by say 2 (by adding 2) then this range becomes 1 to 3 (1 facing the light, 3 facing away) as a base for the width of the line. The multiply vector scales this range to get the final line width we want.
    Alternatively, you could just pipe the Dot result into a gradient, with range -1 to 1, and use the alpha of keys in the gradient to control the thickness. This is very adjustable.

    This is all done in the Unreal Edge tracer node, and piped into its custom 1 Input so the pixel filter can get at it.

    In the Unreal Pixel filter Toon Tracer node panel, you add an Unreal Buffer node to get the custom buffers and pipe that into the Size input to get the line drawn the size you want.

    Finally if you want a hand drawn line effect, you can use weight maps on your object to control the line width as well, or use a texture to randomly widen the line width, or both together.
    Last edited by Dodgy; 10-18-2010 at 12:45 AM.
    Push the software, don't let it push YOU!
    My own plugins and work:www.mikegreen.name
    LaptopSetup:corei7 2.4GHz nvidia GT 650M 8Gig win8 64
    WorkSetup:core i7 3.4Ghz nvidia Quadro 2000 12Gig Ram Win7

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •