Cipheroid

Fake 3D shader

Mar 9th, 2020
459
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const vec2 center=vec2(0.5,0.5);
  2. vec4 fake3Dpixel(sampler2D tex,vec2 pos,vec4 coord,int samp){
  3.     vec4 cur;
  4.     vec4 col;
  5.     for (int i=samp;i>0;i--){
  6.         cur=texture(tex,
  7.             -((pos-center)*(-1+((i-(samp+coord.b))*(coord.a/scale))))+(center+coord.rg)
  8.         );
  9.         col=col.a<cur.a ? cur : col;
  10.     }
  11.     return col;
  12. }
RAW Paste Data