tilt-shift.how
krumza

Hi all. My question - in title. I have scrolable and zooming world, but need tilt-shift effect (ui layer hide from this)

I need to make tilt-shift effect but dont know how it make with very low cost.

I know 2 variants -

1. create iframe with this page from bottom and top, than blur it  - but it be good for promopage or single player game - not for multipayer game

2. on update function save canvas as image, then insert it as sprite on top layer and blur  - but it very expensive i think

I know that Gio work in webgl - may be exist a shader for me?)

 

Comments 16 to 17 (17 total)
Gio

Hi again

I have attached an updated version of my example above, this time using 2 layers and combining them into a single effect layer with tilt shift.

To make a long story short, you cannot just add up colors like that. If you have color15 from layer 15 and color16 from layer 16, then the overall combined color is:

vec4 color;
color.xyz = mix(color16.xyz, color15.xyz, color15.w);
color.w = color15.w + color16.w;

This is the "standard" way of combining layers, but it could also be different depending on the type of alpha blending that you want.

krumza

Gio, I'm sorry I tortured you with this question already.

But I really focus not seen why I have in console was written about the inability to upload images.

Until the hundredth time I read your post and saw that between my layer with shader and layer with the image 2D layer is,

and this key is

sorry for my blind 

Post a reply
Add Attachment
Submit Reply
Login to Reply