A year or so ago, I sent this question to WRI (nb- a former employer of mine) and, as happens with bug-reports-that-arent-bug-reports, it was swallowed into the black hole that is Chambanna.
So- I seek a little help here, on the off chance someone has figured this out.
In short: I need greater than 8-bit-per-pixel/component renders of Graphics3D[]
.
Basically- it appears that, whatever I try with Rasterize[]
, the ancient (but still present according to FullOptions[]
) ColorOutput
option, there is nothing that yields any more than 8-bit values at render-time.
For example, a real-valued texture map. Chock full of values on $[0,1]$.
tmap = RandomReal[{0, 1}, {32, 32}];
A cube w/ texture coördinates-
vtc = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
coords = {{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}, {{0, 0,
0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}}, {{1, 0, 0}, {1, 1, 0}, {1,
1, 1}, {1, 0, 1}}, {{1, 1, 0}, {0, 1, 0}, {0, 1, 1}, {1, 1,
1}}, {{0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}}, {{0, 0,
1}, {1, 0, 1}, {1, 1, 1}, {0, 1, 1}}};
Rendered-
Graphics3D[{Texture[Image[tmap]],
Polygon[coords, VertexTextureCoordinates -> Table[vtc, {6}]]},
Boxed -> False, Lighting -> "Neutral"]
The resulting rendered image is quantized to 8-bits per component, despite the fact that the texture map is a real-valued array. Here, I'll show you---
First- grab the image data of the Graphics3D
render... it is in RGB regardless of what you try to specify via options (here, we'll ask for the data in Real
in a desperate, pathetic attempt to get something useful, but it doesn't seem to matter)-
d = ImageData[%, "Real"];
Find all the 'unique' pixel values via DeleteDuplicates[]
DeleteDuplicates[Flatten[d]] // Length
255
So, despite the input and (theoretical) render having many more than 256 levels, the output of the render is quantized.
8 bits/channel are fine for 99% of what the world might need out of a render, most folks don't have displays capable of HDR. BUT- 1) I do (I'm a vision scientist... we like our dynamic range) and 2) more importantly, sometimes I want to calculate 'maps' that are rendered onto objects that contain more than 8-bits of information per channel.
Note that the above still applies if you use the illumination model provided in Graphics3D
-or- if you set Lighting->None
and use Glow[]
primitives. Whatever you do, Mathematica quantizes the render.
I've fooled around with various Rasterize[]
, Show[]
, and DisplayFunction
manipulations with no success. Regardless, my resulting ImageData[]
remains quantized.
Any thoughts?
edit/NB- This 8-bit constraint appears to be present in many (all?) routines that create graphics. For example, an ArrayPlot
of the texture map quantizes the values (as I'd assume this is what the FE
'needs' to render?)