Thursday, August 05, 2010

Ptex support added to Blender!

This is a brand new commit to the Blender 2.5x code actually, something that has not been formally announced nor has it been fully worked out in functionality and there is probably bugs and needed optimizations ....
This is ptex, of course. The implementation isn't complete, but here's what working for now:

  • Per-face ptex resolution. Each face gets a U resolution and a V resolution based on its area (relative to other faces) and how stretched it is (i.e. a thin tall face should have a lower U resolution and a higher V resolution.)
  • Automatic generation of ptexes. This step is somewhat analogous to unwrapping your mesh, except instead of choosing UV coordinates, it's setting the default ptex resolution for each face. There's a UI control for texel density.
  • "Vertex" painting. That's a bit of a misnomer now, of course, but you can paint more or less normally. (Naturally I've broken some vpaint features like Blur in the process, but it'll all be restored.)

Note: ptex is designed mainly to work on quads. Triangles and other faces are split up into quads in the same manor as Catmull-Clark. I've coded it so that both quads and tris work (although there are some mapping issues with vpaint still), however quads are the "fast case"; for this reason I've applied one level of subsurf to Suzanne in this example.

A partial TODO list:

  • Add UI for setting individual faces' resolutions
  • Integrate the open source ptex library for loading and saving ptex files
  • Add upsampling/downsampling so that changes aren't lost when changing ptex resolution
  • Change default ptex to a flat color. The random noise is just for testing, of course :)
Very very cool to hear! Congrats to the Blender devs for adding this, now all that is needed is more render engines to support Ptex as well, I would imagine within the year this will be a sweeping motion to impelment this across the spectrum of graphics programming.

1 comment:

  1. This is very exciting news indeed!!
    I can't wait till Ptex can be implemented in Aqsis and Pixie. No doubt it will make heavy displacement maps in RenderMan a snap in the future (it can be an extreme challenge today).

    Seems to be a lot of exciting news in Open Source CG lately :)

    ReplyDelete