Swift / SpriteKit: How to create a water drop effect? - ios

i wonder how the following effect could be made in Swift (SpriteKit).
I think about adding some ShapeNodes and fill them with the background image with -yscale 1.
But i think this effect was made somehow different, because the background image isn't just mirrored horizontally - it also has some graphics effects on it (it is mirrored in the shape the water pearl has and so on).
Was it done with a ShaderNode?
Does someone has an idea how i could create a same effect in SpriteKit - like water pearls which looks like they are on the "camera" and they mirror the background "waterpearl like"?
Thank you.

Hmm well you could create a bunch of water images and have them displayed randomly on the screen at some z position, however I think this effect was made in another program like unity or something of the sort, Your best bet is to create transparent water droplets as images and have them displayed randomly on your screen.

Related

Create Super Mario Mozaic Blendig Effect

I am interested in creating a blending effect for a screen transition that takes the current view and pixelates the view and fades out.
The blueprint would be from Super Mario World on the Super Nintendo / Super Famicom.
I attached a YouTube video of this effekt. You can see it at 0:50 before "Mario Start" is shown.
https://www.youtube.com/watch?v=naD6mNeHIsE
I wanted to implement this blending effect in an iOS game in Objective-C or Swift. That does not matter at the moment. I am interested in how this effect can be achieved.
Anyone got a hint or an idea?
I think this can be done with next steps:
1) Take image that you want to mosaic
2) Read it pixel data colors
3) Calculate average colors based on tile size
4) Draw tiles with average color on new image
5) Display new image
6) Change tile size and repeat from step 2)
I think this scenario with using CoreGraphics will have performance problems.
Another choice - use awesome GPUImage and GPUImageMosaicFilter. Check sample code - it have GPUImageMosaicFilter implemented.

ios frosted glass logic

Frosted Glass Effect
I'm thinking of how to approach this logically..
So we take the background image ( for example )
Then, we want to add our frosted glass button to this image. Here's how it should look..
Now I know I cannot programatically blur the background image of the button, so I'll to try and do it with two images.. Background.png and Backgorund_Blurred.png.
Now, the frosted glass effect will happen on animated objects. So, as they move across the screen, it should appear that it is blurring the background image behind it, however, to achieve this I can only think of one way. But doing so is beyond my current capability.
It would have to be a background_blurred image for the UIButton for example. No scaled in any way, and the exact same size as the normal background. Then, I would have to take the buttons relative position on the normal background and append the background_blurred of the button to suit.
My first question; is this possible?
Second question; is there an easier approach?
Lastly, I've added an image to make sense of the relative position theory.
Check out the FXBlur library, it'll let you blur images/views.. I've used it successfully and sounds like it'll do what you want.
I think having two images for these assets maybe easier, but having the views blur may be better in the long run as you wouldn't have to worry about updating the images for different resolutions in the future or care about how big the button is/will be.. Also if you want to do this with more images it'll turn into a mess with all the different images to manage.. The library is simple to use, with one call you'll have a blurred image/view..

How to add rain effect to a picture?

Given a picture, I would like to modify it to create the effect of rain on glass. What steps should I take to achieve this goal?
Suppose we want to add the effect of a single drop of water on a given point in an image, some pixels around that point should be modified in some way: how these pixels should be modified?
Simple way is to just make transparent image that is actually image overlay. That looks like common approach of water drop effects in gimp.
example:
http://natural-drops.deviantart.com/art/drop-of-rain-373710307
I think that in order to make optically correct image one need to have full 3D info of environment, because most optics equations that one needs to simulate correct image includes each object distance.

Creature animation

I am looking into making an iOS app that has little creatures. I plan on having these creatures grow and change shapes based on user interaction. So the creatures could end up looking very different based off what the user does.
My problem is animating these creatures. I have dealt with simple animations in the past with cocos2d, but nothing like this.
How can I animate these creatures being different sizes and shapes without having my graphic designer draw every possible image that could be used. In the game spore a user can create an animal of whatever shape or size they want and these animals animate. My question is how can I do something similar in 2d? I know this can't be a simple answer, but a point in the right direction is all I am looking for.
You could use some CGAffineTransforms to scale your drawing and custom filters with Core Image maybe to change the color.

Xna game development - Game background issue

Im starting with XNA and i need an advice about the following.
I have a .jpg file with my space ship game background with the following size:
width: 5000px
height: 4800px
When i try to load the texture i get the following error:
Texture width or height is larger than the device supports
What is the most used technique to move the background at the same time that your ship is moving?
Thanks a lot.
Kind Regards.
Josema.
One way would be to separate your image into smaller tiles and draw the visible ones.
However this technique suffers from a problem when bilinear sampling is used, because the colors bleeds from the one side of the texture to the other. You can probably compensate by disabling texture WRAP sampling or by grabbing a single of pixels from the tiles next to.
For example if you want 256x256 textures, you would only display 255x255 tiles, because one line (right and bottom) is a copy from the tiles next to it.
Hope it makes sense, otherwise I'll have to paint a picture :-)
The texture limit is determined by graphics card, I believe.
You want to break the texture down to smaller images.
Try something like this. He's tiling a simple 40x40, but you might use it a a guideline on how to tile yours.
http://forums.xna.com/forums/p/19835/103704.aspx
To move the background at the same time that your ship is moving you can implement a camera.
The following links might help-
http://adambruenderman.wordpress.com/2011/04/05/create-a-2d-camera-in-xna-gs-4-0/
http://www.dreamincode.net/forums/topic/237979-2d-camera-in-xna/

Resources