Wednesday, March 7, 2012

HDR Texture Sampling (pt 2)

I had proposed a patch for HDR texture sampling a ways back, and Brecht has committed it (with a few small modifications).  I feel like there's a texture slot bug lurking in there that I may need to fix, but I'll have to verify that.

Essentially, the change allocates 5 of the 100 texture slots to be full floating point textures.  Generally the data set there will be linear (and Brecht changed the monikers for those to be "color" vs. "non-color" instead of linear vs sRGB).  Any source texture that is naturally a float format, such as EXR or 32-bit float TIFF, or HDR, will automatically get one of those slots.

A couple of things to keep in mind:
  1. You've only got 5 full-float texture slots, so be judicious in your use of them.  Any textures you don't want using the those slots need to be saved in a format that is not floating point on disk, and they will land in the regular texture slots instead.
  2. Anyone who was using the 100 slots before for non-float textures, though, is in for a surprise; they've lost 5 regular (non-float) texture slots.  Never fear, all you have to do is change some textures to a float format (such as EXR) and you'll get back to the 100 total slots that way.
The management is a little bit manual for now, but the long-term strategy for Cycles I think is that texture management will be done in a different way.  Textures will be packed into layered versions, and the sampling of them will occur using a more manual sampling (that is slower but higher quality).  This way the 100 texture limit will be eliminated, and better sampling like anisotropic kernels can be used, even on GPU.

No comments:

Post a Comment