[Algorithms] Fast Filtered cubemap for a given specular lobe
Brought to you by:
vexxed72
From: Sébastien L. <seb...@do...> - 2011-04-04 11:06:40
|
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 |