INTERNAL to CYCLES: How to convert this ink/pen material?

Hello everyone!
While searching for some fancy ink/pen material i’ve found this one on the wiki:


After downloading it (it is a CC 0 .blend by Charblaze) I’ve tried to convert this material node FROM internal TO Cycles…without any result.
(I’ve to admit that my knowledge on how Internal works is basically…none. And it seems like toon works really different within the 2 render engines)

I just need to come up with a material on Cycles that :

  • Has this sketchy shadows (ink texture -> color ramp) instead of the normal ones,
  • React properly to a light (a sun lamp, possibly),

Here it is a screen of the node and a link to the .blend file is anyone with “great powers” would be such an amazing human being to help me out before i’m giving up :frowning:

Blend File - Sawshark Ink Shader


  • Peace -

Davide

In the internal engine, the rendering of light over surfaces is done in a way that you can decide inside the rendering routine, wich color based on the angle of the surface and the incoming light…

In Cycles the light is only knowned in the end of the rendering, and that scketch effect can be done in composition.
It’s possible, however, to give the light source information to the shader (position and direction)… and let the shader calculate the color based on that.
the dot product of the normal and the light direction can give you a simple lamberniant shading of your surface receivence.
It won’t account for indirect illumination, thought…
:slight_smile:

That’s the way i was workin on too, but do you have any suggestion on HOW to use (as input node) the light direction? :slight_smile:

light location : add>input>texture coordinates>object and pick the light as your object.
direction, can be done with drivers, can post an ‘how to’ later, i’ve a setup somewhere but i’m not finding it.

Thanks so much Secrop!
Finding a setup would be amazing! Meanwhile i’ll google about it to see if i can find some info about it!

Davide

I totally forgot to post this earlier…

here’s a rude setup…


The ‘CombineXYZ’ nodes have the following variables for the drivers (Top to Bottom):

CombineXYZ_1:

  • TransformChannel, Lamp, X Location, World Space
  • TransformChannel, Lamp, X Location, World Space
  • TransformChannel, Lamp, X Location, World Space

CombineXYZ_2:

  • SingleProperty, Lamp, matrix_world[2][0]
  • SingleProperty, Lamp, matrix_world[2][1]
  • SingleProperty, Lamp, matrix_world[2][2]

Some notes about this type of hacking:
-Sun lights have meaningless position, so only the bottom dot product is usefull.
-Point lights have meaningless orientation, so a dot product between the normalized(Lpos-Pos) and the Normal is better.
-Spotlights are quite this setup, but they still have attenuation, size, etc.
-Area lights are more difficult to use in this situation.

is this applied to the lamps or the material ?

thanks
happy cl

As for the OPs topic, this is just for the material… from the lamp we only uses its position and orientation.

The ouput value can be used as an alternative* for the color output, of the material node in BI.

*It doesn’t receive shadows, and right now is just in a very rudimentar form, as each type of lamp would require a different node setup. But the main variables and process for doing whatever we want with lights is basically here.

this is for BL not cycles !

I thought he wanted to get it in cycles too !

if this was done in old grease pencil
it has changed so much don’t if it is possible !

thanks
happy bl

@RickyBlender this is for cycles!.. for BI we already have the LampData node, no need to build one.

This will fake the shading of one light, in cycles, by hardwiring the light info in the shader. Its like having graphics from the 80’s in cycles.

:wink:

The link is empty, can someone update it? It’s seams really cool :stuck_out_tongue: