Changeset 2140 for trunk/tools


Ignore:
Timestamp:
Dec 10, 2012, 3:18:05 PM (7 years ago)
Author:
sam
Message:

neercs: slightly optimise postfx shader.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/video/postfx.lolfx

    r2092 r2140  
    8787    float k=z.y+1.0;
    8888
    89     if(k<=r_p-r_h2) r=mix(c1,c2,k*(1/(r_p-r_h2)));
    90     if(k>r_p-r_h2&&k<=r_p) r=mix(c2,c3,(k-(r_p-r_h2))*(1/r_h2));
    91     if(k>r_p&&k<r_p+r_h) r=mix(c3,c4,(k-r_p)*(1/r_h));
    92     if(k>=r_p+r_h) r=mix(c4,c5,k*((k-(r_p+r_h))/(r_p-r_h)));
     89    if (k <= r_p - r_h2)
     90        r = mix(c1,c2,k*(1/(r_p-r_h2)));
     91    else if (k <= r_p)
     92        r = mix(c2,c3,(k-(r_p-r_h2))*(1/r_h2));
     93    else if (k < r_p + r_h)
     94        r = mix(c3,c4,(k-r_p)*(1/r_h));
     95    else
     96        r = mix(c4,c5,k*((k-(r_p+r_h))/(r_p-r_h)));
    9397
    9498    //c*=moire_h.x+moire_h.y*sin(z.y*float(screen_size.y*moire_h.z)/ratio_2d.y)*sin(0.5+z.x*float(screen_size.x*moire_h.w)/ratio_2d.x); // moire h
Note: See TracChangeset for help on using the changeset viewer.