ofxInkSim: ink deposition simulator


#1

Hi all

I have tried to mimic “Tarashikomi”(Japanese painting technique) for my next project. And I found it is more general ink/fluid deposition simulator.
Highly parameter sensitive, but works.

Here is the addon: https://github.com/Akira-Hayasaka/ofxInkSim

Thanks!


#2

Loving this


#3

Hello all.
@theborg thank you!

I refactored every shader and added ofxInkSimFillBufferExample .

Best!

A


#4

Hi Akira,

This is such a wonderful addon! I would like to use your addon for my project and can I ask if there is any suggestion if I want to draw a background image (to add some texture to the drawing) please?

Cheers,
Karen


#5

Hi Karen,

actually I use this addon with my ofxPSBlend to blend ink texture with background.

pseudocode:

psBlend.begin();
background.draw();
psBlend.end();

fbo.begin();
ofClear(0);
inkSim.draw();
fbo.end();

int blendMode = 0;
psBlend.draw(fbo.getTextureReference(), blendMode);

ofxPSBlend takes major photoshop blend mode like Overlay or Phoenix etc. Usually I bind blendMode var to keypress event, then try to find the best result.

A


#6

Wowww Akira, this addon is wonderful :)))
May I ask if it would applies to video as well?

Cheers,
Karen


#7

Yes of course, draw video every frame then it will be animated background

psBlend.begin();
videoBG.draw();
psBlend.end();


#8

THANKS A LOT :))) x


#9

Hi Akira!
Wonderful addon you created!! Thanks for sharing it here!!

I’m trying to apply this aesthetic in some vectors I created. Would you have any hint/suggestion in how should I proceed?

I’m supper beginner with addons so I’m trying to apply them to the code I have already! So any advice will be great!

Thank you!
Vicky


#10

Hi Vicky,
What would you like to do with your vectors?


#11

Hi Akira,
I made these plants in oF using vectors, and I wanted to apply a painting aesthetic to it.
You can take a look here: Plant example


#12

I think the easiest way to fill your flower with ink is to use mask shader.

So

  • draw your flower into fbo. <= this is mask
  • send ink texture and flower fbo to the shader
  • discard mask pixel in fragment shader
  • then the ink texture will be masked flower shape!

You can find the mask shader example in oF example folder.

Please note that this example using transparency for the mask.


#13

@Akira_At_Asia

I use ofxInkSimFillBufferExample, and if I set EvaporToDisapper to true, some shape edge appear when I press ‘f’ to keep adding random spot to fbo before background ink disappear, is this right? If EvaporToDisapper not open, everything looks good.

inkSim.update(true);


inkSim.update(false);


#14

Hi @GeistYp,

EvaporToDisapper = true bend the simulation pipeline in order to force the ink disappear. That the reason it looks strange but it is right behavior.


#15

But I still saw some strange behaviour, maybe that is value leak or something else.

right now, I change InkXToShader to simple multi 0.99 to fake ink.

//fragColor = vec4(ix_new.rgb * (a.z*990.0), ix_new.a);
fragColor = vec4(ix_new.rgb * 0.99, ix_new.a);