demo reel

portfolio

resume

links

contact

 

Ambient Occlusion with Gradient Transparency

 

 

Basic Ambient Occlusion using occlusion()

Code

surface occlude2(float  samples = 32, 
                        maxdist = 100000,
                        Kd = 1)
{
normal  i = normalize(I),
        n = normalize(N),
        nf = faceforward(n, i);
float   occ = occlusion(P, nf, samples, 
                "maxdist", maxdist);
 
Oi = Cs;
Ci = (1 - occ) * Cs * Oi + (Kd * diffuse(nf));
}

Basic Ambient Occlusion using gather()

Code

surface cutrOcclude(float  samples = 32)
{
normal  i = normalize(I),
		n = normalize(N),
		nf = faceforward(n, i);
float	hits = 0;
 
gather("illuminance", P, nf, PI/2, samples,
	"distribution","cosine")
    {
    hits += 1;
    }
    
/* find the average occlusion factor */
float average = hits / samples;

Ci = (1 - average) * Cs;
Oi = 1;
}

Transparency with Occlusion

Code
/* Basic Occlusion surface shader with simple 
transparency */
surface cjOcclude(float samples = 32) { normal i = normalize(I), n = normalize(N), nf = faceforward(n, i); float hits = 0; color hitopacity = 1; /* Gathers the transparency at the 'h
it' location */
gather("illuminance", P, nf, PI/2, samples,
"distribution","cosine", "surface:Oi", hitopacity) { /* Assigns the inverse average of eac
h opacity component to 'hit' */
hits += 1-(comp(hitopacity,0) + comp(hitopacity,1)
+ comp(hitopacity,2))/3; /* printf(" %f %f %f ", comp(hitopacity,0), co
mp(hitopacity,1), comp(hitopacity,2));*/
} /* find the average occlusion factor */ float average = hits / samples; Oi = Os; Ci =(1 - average) * Cs * Oi; }

 

 





 

 

 

Portfolio


rendering
& shading


projects     

programming     

fine art    

model concepts     

studies     


                             

 

                                   © 2004-2008 by Carrie Jones. All Rights Reserved.