Sign in to follow this  

shader toy shader to pixi filter

Recommended Posts

2 hours ago, Exca said:

I updated the fiddle to use another method for calculation of the implosion/explosion 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...

Your thoughts?

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





Share this post

Link to post
Share on other sites

still trying to figure out how to get more of a circular indent in the lens instead of an elliptical buldge / indent...


but running smooth as butter in the context of the app performance wise :)



Share this post

Link to post
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 :)





Share this post

Link to post
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.

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.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.