Masking SKSpriteNode as a liquid

I would like to create fluid dynamics. I searched a lot, created balls moving with the movement of the device, but I don’t know how to make balls look like liquid. I assume this is a mask, but I have not found how to do it. Can someone help me with this? Thank.

+4
source share
2 answers

The idea was clear to me. I did not know what a real filter is. Having figured this out, SKSpriteNode is nodeWithImage, the image is a blurry ball. The physical body is a ball with a smaller body than the image (so that the balls can move slightly on top of each other and become "one part"). The threshold filter is set to the scene, for example:

CIFilter *filter = [CIFilter filterWithName:@"CIColorPosterize"];
[filter setValue:@(2.0) forKey:@"inputLevels"];
[scene setFilter:filter];
[scene setShouldEnableEffects:YES];

So that if anyone ever reads it and has a problem, he more than welcomes to let me know for help.

+3
source

Something like liquid in games usually follows the following pattern (there are many ways to do this, with filters, shaders, your own opengl tools):

  • Many balls next to each other

  • -. , - , . Photoshop . .

  • (). , , , 1.0 alpha, 0.0 alpha. , .

enter image description here

+5

Source: https://habr.com/ru/post/1541841/


All Articles