Fake Rim Light

Fake rim-lighting with a surface shader in VEX.

A .vfl file that fakes rim-lighting.

Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Wednesday July 30th, 2008 04:17 PM

#pragma include<prman.h>
#pragma opname dan_material
#pragma oplabel "VEX DPL ParaPerp"
#pragma label dnfreq "Frequency"

//smooths edges and anti-aliasing
float pulse(float a,b,fuzz,x)

rim(float   rim_width 0.2,
            dnfreq 1,          
            multdan 1;

    vector  nfn;
    vector  diffusecolor;
    vector  restpos;
float  dan_noise//vector dan_noise;

restpos wo_space(P)*dnfreq;
dan_noise snoise(restpos);

nf faceforward(nI);
vector i normalize(-I);
//float  dt = 1-dot(i,nf);
float dt dot(i,nf);
Oi smoothstep(1-rim_width1.0dt)*dan_noise*multdan;

diffusecolor 1;
Cf Oi Cs diffusecolor;


Download: fakerim.vfl 793 B

Please login or Click Here to register for downloads
Creative Commons License
Fake Rim Light by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at www.3daet.com
Permissions beyond the scope of this license may be available at http://www.3daet.com