Skip navigation

So, this post talks about cosine weighted hemisphere sampling.

Really its simple.

There are 2 ways to do this, both are outlined in Philip Dutre’s “Total Compedium”

Way #1
– generate points on the disk
– project points upward

Way #2
– Use these explicit formulae.

//generate 2 random floats, each between 0 and 1
RANDOM_NUMBER_1 = randFloat() ; 
RANDOM_NUMBER_2 = randFloat() ; 

PHI(aziumthal angle) = 2*PI*RANDOM_NUMBER_1 ;
THETA (elevation angle) = acos( sqrt( RANDOM_NUMBER_2 ) ) ;

That’s it! This is what you get:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: