Jump to content

shader toy shader to pixi filter


ourvice
 Share

Recommended Posts

2 hours ago, Exca said:

I updated the fiddle to use another method for calculation of the implosion/explosion https://jsfiddle.net/6f5Lydot/1/ to make it a bit clearer for me as the one in shadertoy does things a lot differently how I usually do.

That should produce uniform changes to center no matter what resolution the renderer is. Changing the formulas used in bulge & implosion can be used to change the look of the effect.

[Edit] Also updated the pixi to latest.

you are awesome :)

 

yeah i can get it centering pretty well when i remove :

vec2 m = vec2(0.5, 0.5 /prop); //center coords /prop

the / prop bit

the original code in shader then multiplied it in the last to lines to the uv.

 vec3 col = texture2D(uSampler, vec2(uv.x, -uv.y * prop)).xyz;//Second part of cheat
                                                    //for round effect, not elliptical
  fragColor = vec4(col, 1.0);

 

My feeling is this is what gives it the edge flying past effect present in the shadertoy code ( when the fish eye is in )

and would, also ensure the roundness of the fisheye...

 

https://www.shadertoy.com/view/4s2GRR

Your thoughts?

Thanks for the help btw, I starting to get the shader language a little better :)

 

Awesome!
 

 

 

Link to comment
Share on other sites

float bind;//radius of 1:1 effect
  if (power > 0.0) bind = sqrt(dot(m, m));//stick to corners
  else {if (prop < 1.0) bind = m.x-0.3; else bind = m.y-0.3;}//stick to borders

if you offset m vec2 slightly I get the effect i was after which is nice :)

it in sense forces a spherical and push the peripheral pixels past the viewer.

 

thank you all for the help, this was fun :)

 

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...