Wednesday, April 21, 2010

Ptex and the Open Source Community




Figure 1: T. Rex with 2694 faces rendered with Ptex. (©Walt Disney Animation Studios)

I decided today to write an article on Ptex, the texture map library that Disney developed and recently released as open source. While this is not fresh news by any means, since it's official release early this year there have been some development in both the commercial and open source worlds.

One of the first applications that support Ptex is naturally Pixar's RenderMan 15.0. After the announcement by Disney in Jan. 3D-Coat was one of the first smaller 3D applications that implimented it within a week, which of course brings to mind that infamous set of images found in the forums.




One of the more interesting images was the texture map itself which looks unlike any map I have ever seen.


















The original forum thread can be found here : http://www.3d-coat.com/forum/index.php?showtopic=4834&st=0

However in the open source world it has not caught on quite as fast as expected, in fact to date none of the software in the Blender to Renderman pipeline support Ptex. This is not because of the lack of interest, it is more or less due to development targets. Simply put both Blender and Aqsis are in the process of major rewrites so to implement Ptex into these at this time would divert attention from the important targets in these applications.

Aqsis 1.8.0

Blender 2.5

Does this mean that Ptex will never see the light of day in the open source world? No. In fact if you recall it took some time before OpenEXR was added to Blender, Aqsis and Pixie so while the technology is there currently, it may be some time before it is added across the board. This is not due to developer laziness or as mentioned before, lack of interest (because there is an interest in it from the Aqsis team), it is simply there are more important things to worry about in each application such as functionality, stability and speed.

But all is not lost and it seems that some people have been using workarounds to accomplish usage of Ptex with applications that do not support Ptex, such as Blender.

CG Society Article

Recently there have been some usefull code that has popped up that not only will benefit Aqsis but Blender as well. For instance OpenImageIO (OIIO), which if combined with Ptex and supported in Blender and Aqsis would be something that can be very usefull. OpenImageIO was developed by none other than Larry Gritz, possibly one of the most important figures in the CG industry, from BMRT and Entropy, to the work he did at Nvidia with Gelato. So not only is OpenImageIO a powerfull imaging library but it's also one of Larry's greatest contributions to the open source community.

The /*Jupiter Jazz*/ group has also provided a usefull file cache library called "JupiterFileCache", of which at render time could improve file access speeds, the files can be texture maps, point clouds or other large files to reduce network traffic and disk use. Combined with the OpenImageI/O and Ptex libraries could be a useful benefit for everyone.

The Blender to Renderman project is aware that these recent contributions could have a massive impact on the open source CG industry, so I have a proposal to ALL the developers in these areas : Let's get together and at least come to a common goal to impliment Ptex into these applications as soon as possible. Even if I have to personally spearhead the development and communication between all parties involved, this could very well be one of the most pivotal moments in development after the core rewrites to the applications themselves, in reference to Blender, Aqsis and Pixie of course.

In conclusion it is nice to see more and more large scale studios contributing to the open source community, while the tools or libraries they provide may be small and few, they are greatly welcomed by the community and we are encouraging more of it. One of the goals we are trying to promote is to "play nice", which means that open source software should be able to work well with commercial or proprietary software in terms of file formats, libraries and standards. One of those steps was the addition of OpenEXR (except the minor issue of Blender reading and writing EXR images upside down), hopefully more of the same follows and one of those steps can be the subject of this post : Ptex.

The actual details of Ptex can be found here : http://www.disneyanimation.com/library/ptex/

(© Pixar Animation Studios)
(© Walt Disney Animation Studios)

3 comments:

  1. Great article Ted.
    I agree that Ptex could be a very important tool for the OS CG community. I think to some degree the slow response has been a lack of understanding of how helpful this library could be. Since Blender's experimental render branch now has a basic form or micropolies (they don't call it that though) I imagine they may begin to see the benefits of Ptex with displacement mapping. UV mapping can be very difficult to work with when doing complex displacements :-s
    BTW there's a GSOC proposal to integrate Ptex into Blender but not sure if anything will come of it http://wiki.blender.org/index.php/User:Kwk/Gsoc2010/Proposal

    Eric Back (WHiTeRaBBiT)

    ReplyDelete
  2. Hi Ted, after reading this I finally got around to reading the ptex paper properly. It's definitely interesting stuff, and (hopefully) should be reasonably easy to implement in aqsis. The main issue which might arise is whether aqsis generates intrinsic u,v parameters which are compatible with the ptex library. Also there's the issue of smoothing derivatives between faces. Anyway, definitely interesting, if only I had, say 10 more hours each day :-)

    ReplyDelete
  3. As mentioned before I am not expecting Ptex to be added any time soon, since both Blender and Aqsis are going through major changes at this time, functionality is priority here. I mainly wrote the article because I was reading up on Ptex, OIIO and JupiterFileCache and realized that these three things could have some great potential in the future.

    My shock came when I read up on OpenImageIO and found that Larry Gritz was the developer on this, I remember you had mentioned a lot of OIIO in the Aqsis IRC logs, so I wanted to research this - awesome stuff since it is derived off of the Nvidia ImageIO library and thankfully under the BSD license (unlike the later version which was property of Nvidia).

    Moritz's file cache code is also something I found interesting, I feel bad now for arguing with him over the validity of the Adv. Renderman book. I think I should go and invite him, he is a very smart user of Renderman and his input could have a big impact for our tools.

    Thanks for the comments guys!!

    ReplyDelete