Skip to content

Floating point texture

Steven Johnson edited this page Jan 9, 2019 · 12 revisions

This is probably the sort of thing that needs to hide behind a "can I even do this?" query, with much likelier success on desktop and console. These are basically just textures that don't map to [0, 1]. They're not really ideal for graphics, at least what you finally see, but rather for intermediate computations or as a poor man's compute.

As far as I can tell the shaders themselves wouldn't be noticeably different. Just from brainstorming I think this would most often be a canvas, probably providing one of the various floating-point formats as another argument. (Maybe even the exclusive option? Not sure.) I don't know if it would be common to pre-populate it, but some of the bytes stuff I mention elsewhere might help.

I've run into a few cases in the wild, say when trying to generate textures in tools, an example being thin-plate splines which in some configurations--not predictable, or at least I had no luck--would work beautifully, but would just as often end up with samples accumulating well outside that [0, 1] range no matter how many contortions I put on the numbers... I think there just wasn't adequate information content in the 16-bit encodings per coordinate. These early results obviously have a chilling effect! (On the bright side, they did motivate some significant progress toward an Eigen plugin.) That said, I don't think I'd have trouble coming up with more ideas, if they could suddenly be attempted.

Having written that last part, it occurs to me that attempt was a quite large multi-pass shader, so I assume some way to accommodate the idea to them would be nice. 😃