Skip to main content
GameDev.net gamedev.net
🔒 Locked

Polynomial texture mapping

Started by TitLoulou Jun 27, 2004 at 7:25 AM 2 replies 750+ views
Original Post
TitLoulou
TitLoulou
I recently discovered polynomial texture mapping (http://www.hpl.hp.com/research/ptm/), but there is not much information about it on the net. I wondered if it could completly replace spherical harmonics for global lighting (which is what I first planed to use in my engine). PTMs need only 4 coefficents vs 16 for good SH, so it would be much easier to implement, but it seems PTMs can store only information (self-shadowing, reflectance, ...) local to the surface, not from the whole scene as SH can do. Does anyone have some information about PTMs and their use in an engine, compared to SH ? Thank you [Edited by - TitLoulou on June 27, 2004 12:04:29 PM]
---------------Outch... Pas toujours facile de poster sur un forum anglophone !
poly-gone
poly-gone
PTMs are not a generalized solution. Basically, a PTM is constructed by photographing the "scene" from a lot of lit positions and this PTM is used to achieve self shadows and other global-illumination-like effects. The major disadvantage is in the generation of PTM maps. You would have to light all objects in the scene from atleast 50 different directions to generate the PTM maps! Plus, you cannot achieve (AFAIK) global shadowing.

Spherical harmonics are much more generalized and have the added advantage of global soft shadowing. The only disadvantage is that the illumination is considered to be from a diffuse environment, so you only get overly-soft shadows. Thus, spherical harmonics would be far more practical.
TitLoulou
TitLoulou
Thanks for your reply, it comforts what I thought. So I think I'll keep SH for illuminating my scene, and rather use PTM as an improvement of bump mapping. But as you said, PTM maps are not easy to construct.
Has someone already implemented PTM ? Any experience ?
---------------Outch... Pas toujours facile de poster sur un forum anglophone !
hplus0603
hplus0603
A PTM is a function of one variable (in addition to the texture coordinates).

A SH is a function of three variables (in addition to the texture coordinates).

They have different uses. For example, horizon maps can often be expressed as PTMs.

Note that PTM doesn't "require" 4 coefficients per sample; it's a polynomial function. You can use as many or as few coefficients as you want per sample, for higher/lower order polynomials.

Same thing with SH; SH doesn't "require" 16 coefficients per sample; you can get away with fewer, for lower-order (less sharp) functions, or use more, for higher-order functions.
enum Bool { True, False, FileNotFound };

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.