Jump to content
  • Advertisement
Sign in to follow this  
JoCCo

Quick question about PRT

This topic is 4845 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been looking at the Samples for PRT in the DX SDK and it seems like something I'd like to use more, but I have one question that I have not been able to find an answear to while looking for info about PRT and I figured someone here might know the answear... Have I misunderstood PRT or can it only be used to model incoming light, i.e. light that does not a a light source within the scene. I figured that I could use PRT instead of lightmaps for my static lighting, but it that impossible?

Share this post


Link to post
Share on other sites
Advertisement
I would not advise using PRT for lighting an entire scene, as the memory overhead of using PRT is much larger than you might expect. A quite simple model can easily use upto 1mb of PRT data, let alone a world with millions of traingles...

As far as I know PRT will work when the light is within the bounds of the model.
However, remember that it will also only work for static models, and computing the data takes *a long* time even for small models, so doing it for a large world would take *AGES*. You also effectivly cannot do per-pixel PRT, so unless your world mesh's are highly tesselated, it won't look very good at all.

That said, you don't have to do PRT the way the DX samples do it. I'm sure it could be done with less memory usage, just not looking as fancy.

Share this post


Link to post
Share on other sites
PRT only works if the light can be assumed to infinitely far away -- so it works best for models that move can through a scene and the light comes from somewhere beyond the model.

PRT is also only useful when you have dynamic lighting. If your lighting is static, then use lightmaps. However, the interesting thing to note is even if the lighting for your scene is static, every point in space has a different set of values for the sphere of incoming light. This means as you move an object through space, the lighting for the model is not static.

The August DXSDK has new IrrandianceVolume sample which shows this off -- you can move a model with PRT lighting through a simple scene and see how it is lit differently.

The memory usage for PRT in the DX samples is low if want it to be, because of CPCA compression. CPCA makes the memory usage be (# PCA vectors/4) DWORDs per vertex (or per texel for per pixel PRT). So if you set it to use 4 PCA vectors, that's 1 DWORD extra per vertex or 1 32bit texture. Games typically use per vertex PRT with 4 or 8 PCA vectors, and it looks good.

For an example of what PRT can do for an engine, you can check out the "Backyard Demo" at http://www.artificialstudios.com/videos.php or ATI's
"Ruby: Dangerous Curves" demo.

Jason

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!