I found a couple of cool hdr environmental map here: http://www.pauldebevec.com/Probes/
It's all angular map though. Any idea how to sample them with ray tracing? Sample code would be helpful too
How to sample angular environmental map?

 Posts: 83
 Joined: Thu Apr 24, 2014 2:27 am
Re: How to sample angular environmental map?
I think you are looking for this https://github.com/mmp/pbrtv2/blob/mas ... finite.cpp

 Posts: 138
 Joined: Sun May 27, 2012 4:42 pm
Re: How to sample angular environmental map?
I don't think that's what I need. pbrt uses rectangular env map, not the kind in the link I posted.MohamedSakr wrote:I think you are looking for this https://github.com/mmp/pbrtv2/blob/mas ... finite.cpp
Thanks for the hint though.
Re: How to sample angular environmental map?
as I guess you need something like this:
color envMap::GetColor( vec3 dir );
So, there is really simple math.
assumption is that those images is taken from infinite distance and viewing rays are parallel, for example (0.0, 0.0, 1.0)
color envMap::GetColor( vec3 R ) {
const vec3 E( 0.0, 0.0, 1.0 );
vec3 N = (E+R).normalize();
//calculate (u,v) in [0,1) range
float u = 0.5*(1 + N.x);
float v = 0.5*(1 + N.y);
return envMapImage.GetColor( u, v );
}
color envMap::GetColor( vec3 dir );
So, there is really simple math.
assumption is that those images is taken from infinite distance and viewing rays are parallel, for example (0.0, 0.0, 1.0)
color envMap::GetColor( vec3 R ) {
const vec3 E( 0.0, 0.0, 1.0 );
vec3 N = (E+R).normalize();
//calculate (u,v) in [0,1) range
float u = 0.5*(1 + N.x);
float v = 0.5*(1 + N.y);
return envMapImage.GetColor( u, v );
}
Colibri Renderer