Auto-illumination of 2d shapes


#21

You can get the same effect by playing with blending modes and opacity…

I like mine better though.


(http://4232.cf) #22

no. It is subtly different. It looks the cap and the tongue


#23

There’s a easy way to make plushies render now. Something that I’d like to see is contour adjustment, but that’s not necessary, but would make for a nice feature to this filter.


(http://4232.cf) #24

and drop shadown:


(Lyle Kroll) #25

OK; had to play (just got home from work an hour ago and then I needed to cook me something to eat; lol). Pretty cool stuff, David. Yes; separated the colors first before running on each layer. :slight_smile:

ref: https://openclipart.org/detail/106135/bison-leif-lodahl-01


(Hector) #26

This is great! There’s so much it can be used for!
Here’s some of my tests:


(Sergei Rybalko) #27

I am wandering if this filter can be used to re-light a photo. For example portrait. See example


Original

Mask

Light from left

Light from right top


(David Tschumperlé) #28

Awesome :slight_smile:
I’ve some various plans to improve this filter, one of them being a way to specify an input mask so that illumination of multiple different shapes can be done at the same time.
Stay tuned !


(http://4232.cf) #29

Other experiment with this script:

Repairing the parts using the previous layers as mask.


(Hector) #30

Another test, Really like how it defines the volume despite that I just ran the script in a single layer. I also tried to combine this script with a relief light to get some extra highlights.


(David Tschumperlé) #31

I’ve worked hard this week end, and finally updated this filter with some new options :

  • Input type lets you choose between “Single opaque shape over transparent background” or “Multiple colored shapes over transparent background”, which is clear enough I think :slight_smile:
  • Added parameter Output as to be able to generate z-map or normal maps.

Some screenshots:


Original image.


With ‘Input type’ -> ‘Single opaque shape’


With ‘Input type’ -> ‘Multiple colored shapes’


With ‘Output as’ -> ‘Normal map’


(http://4232.cf) #32

Also in this solution in which repair inferior layer (darker) by repair [patch-base] or [morphology]

2018-05-21-113648_238x257_scrot


(David Tschumperlé) #33

Another update of this filter, pushed today !
You can now manage ‘Bump maps’ and ‘Normal maps’ also as inputs, so basically, you can let the algorithm has a first guess for a bump/normal map from a 2d shape, then correct it or add details if necessary, and run the filter again on the corrected version to render the corresponding illumination.

A few more examples of completely automatic shading :


(David Tschumperlé) #34

Another update of our filter Illuminate 2d shape today. Now you can add guide strokes to your image to help the filter estimating a better bump map, with better illumination results only with a few clicks !
The example below shows why guide strokes are cool :slight_smile:

And here is a video on how to do this kind of things (and even better, with editing of the bump-map).


Natron for 2d animation
(Lyle Kroll) #35

Pretty cool stuff, David. Also looks like a cool way to create depth maps too. :slight_smile:


#36

Cool, thanks…


(Hector) #37

Wow this is huge!
Adding guides is super helpful, you can direct the flow of the shading and get some really cool results!
I’ve also been playing around with getting the bump map out and applying it to a mesh. It seems promising to use this technique to generate your own textures from really simple starting shapes or patterns.


(http://4232.cf) #38

Looking this tree think that it could deform the painting with the new bump


(David Tschumperlé) #39

Thanks for the tests and feedback.
I must say I’m quite happy with this filter. I think I’ve finished it (I mean, right now, I don’t have other ideas of improvements :slight_smile: , and I’ve lot of other work to do anyway).

Of course, I’m interested by any cool experiments, so do not hesitate to share your results !


(Job van der Zwan Zwan) #40

I mean, right now, I don’t have other ideas of improvements

You could see if @dubi’s bumpmap idea could be extended to create Spritelamp-like functionality, except automated.

For those who aren’t familliar with Spritelamp, it is a program that lets artists create bump-maps for sprites by also taking hand-drawn lighting angles from four directions. Images/gifs below explain it better- I copied without permission, but the intent is to save the dev of Spritelamp some bandwidth - if you’re interested in the tool and perhaps want to buy it, this is the website of the developer

04-zombie-diffuse-example

05-zombie-light-profiles-example

zombie-vertical-preview

zombie_horizontalpreview_grey2

Perhaps the tool can already be used as-is to generate these four inputs for Spritelamp!