瀏覽代碼

neercs: better reflection gradient (to finetune again)

master
父節點
當前提交
fb92ec6d46
共有 1 個檔案被更改,包括 13 行新增4 行删除
  1. +13
    -4
      neercs/video/postfx.lolfx

+ 13
- 4
neercs/video/postfx.lolfx 查看文件

@@ -65,11 +65,20 @@ void main(void)
vec3 ca2=get_color(texture,vec2(z.x+v,z.y));
c+=vec3(ca1.x,c.y,ca2.z); // chromatic aberration

vec3 c1=vec3(0.3,0.2,0.2);
vec3 c2=vec3(1.0,1.0,1.0);
vec3 c3=vec3(0.0,0.4,0.7);
vec3 c1=vec3(0.2,0.1,0.0);
vec3 c2=vec3(0.7,0.5,0.5);
vec3 c3=vec3(1.0,1.0,1.0);
vec3 c4=vec3(0.0,0.5,0.7);
vec3 c5=vec3(0.0,0.1,0.2);
vec3 r;
float k=z.y+1.0;//(p.y+1.0)/2.0;

c+=((p.y<0.0)?mix(c1,c2,1.0+p.y):mix(c2,c3,p.y))*0.25; // reflection
if(k<=0.1) r=mix(c1,c2,k*(1/0.1));
if(k>0.1&&k<0.2) r=mix(c2,c3,(k-0.1)*(1.0/0.1));
if(k>0.2&&k<0.3) r=mix(c3,c4,(k-0.2)*(1/0.1));
if(k>=0.3) r=mix(c4,c5,k*((k-0.3)/0.7));

c+=r*0.5; // reflection

c*=moire_h.x+moire_h.y*sin(z.y*float(screen_size.y*moire_h.z))*sin(0.5+z.x*float(screen_size.x*moire_h.w)); // moire h
c*=moire_v.x+moire_v.y*sin(z.x*float(screen_size.x*moire_v.z))*sin(0.5+z.y*float(screen_size.y*moire_v.w)); // moire v


Loading…
取消
儲存