You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found this shader online and I was wondering how to implement it using gl-transitions.
uniformfloatmixer;uniformsampler2DtDiffuse;uniformsampler2DtSphere;varyingvec2vUv;//idea//https://www.decarpentier.nl/lens-distortion//distort method from // https://www.imaginationtech.com/blog/speeding-up-gpu-barrel-distortion-correction-in-mobile-vr/vec2distort(vec2st,floatalpha,floatexpo){vec2p1=vec2(2.0*st-1.0);vec2p2=p1/(1.0-alpha*length(p1)*expo);return(p2+1.0)*0.5;}voidmain(){
float t=mixer;floattr=smoothstep(0.75,1.,t);floate=t*4.;//stretch out city scenevec2uv=distort(vUv,-10.*pow(.5+t*.5,32.),e);vec4city=texture2D(tDiffuse,uv);//pinch in sphere sceneuv=distort(vUv,-10.*(1.-tr),e);vec4sphere=texture2D(tSphere,uv);//blend gl_FragColor=mix(city,sphere,tr);}
I've tried replacing the function content on the gl-transition editor for the noise function's content but it keeps on saying return type is not correct:
The text was updated successfully, but these errors were encountered:
I found this shader online and I was wondering how to implement it using gl-transitions.
I've tried replacing the function content on the gl-transition editor for the
noise
function's content but it keeps on saying return type is not correct:The text was updated successfully, but these errors were encountered: