Fast Filtered cubemap for a given specular lobe
Sébastien Lagarde <[email protected]> Mon, 4 Apr 2011 10:41:13 +0000
| Newsgroups | gmane.games.devel.algorithms |
|---|---|
| Message-ID | <[email protected]> |
Hello all,
I actually try to reimplement the algorithm given in the following paper about filtering cubemap.
http://developer.amd.com/media/gpu_assets/Isidoro-CubeMapFiltering.pdf
But adapted to cosine power function.
My goal is to get the right blurred cubemap for a given specular lobe for the phong lighting model.
This is actually what allow HDRShop for the latlong environment format. But here I want a fast version directly from cubemap
(HDRShop is slow - I suppose it used only brute force).
I already implement the algorithm for cubemap, taking count of solid angle and get the same result as HDRShop but faster with
the tricks provided (Precompute solid angle and direction vector in a lookup cubemap).
The algorithm looks like as follow
foreach(face)
{
for(INT Y = 0; Y < Size; Y++)
for(INT X = 0; X < Size; X++)
{
Wp = GetCubeDirection()
IrradianceAtThisTexel = Integral(Wp)
}
}
Integral(Wp)
{
foreach(face)
for(INT Y = 0; Y < Size; Y++)
for(INT X = 0; X < Size; X++)
{
Wi = GetCubeDirection()
DotWiWp = dot(Wi,Wp);
LobeShape = pow(DotWiWp, SpecularPower);
WeightSum += LobeShape * SolidAngleForThisTexel;
Irradiance = RadianceFromCubemap * DotWiWp * SolidAngleForThisTexel;
Sum += Irradiance * LobeShape;
}
return Sum /= WeightSum;
}
Now I try to implement the second optimization:
"Determine bounding box regions for angular extent in each face on input cubemap."
But I a am little lost in math.
I understand that I need to take the solid angle sustented by the specular lobe then convert it to "cubemap region" and return
the bounding box of this region for each face but I don't know how to do that.
I googling for this topic but still not get good reference.
If someone can give me pointer or can explain me how to get the solid angle of specular lobe, and how to projected it on face,
I would much appreciate.
Thank you
Lagarde Sébastien
------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself;
WebMatrix provides all the features you need to develop and
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list