5 ms·
I've thought about it for an hour now, but I don't understand how the given algorithm works. I understand Step 1, growing and shrinking the cells such that the
by kmm 5y ago
I've thought about it for an hour now, but I don't understand how the given algorithm works.
I understand Step 1, growing and shrinking the cells such that the area of the cell on the window is proportional to the brightness of the corresponding cell on the image plane. Intuitively this feels like the cells on the window represent the total light budget, and growing a cell means taking a larger proportion of the incoming light to aim towards a given point.
But I'm stuck at Step 2. If a window cell has a single normal, i.e. if it's a flat plane, I don't see how it would increase the brightness. Like the author previously describes, the brightness is dependent on the second derivative of the height, not the first. A larger flat window cell will not make for a brighter image cell, it'll simply make the image cell larger. Brightness could be increased by having more window cells aimed at the same point, not larger cells.
The way I understand this could work is if the second step of converting the window cells into normals is done at a much higher resolution than the given map, and the target point is fixed for each cell. That way, the normal could vary over the course of a window cell, and every cell would function as a tiny lens, where now bigger lenses would in fact lead to brighter spots.
I assume I'm missing something, can anyone tell me where I go wrong?
- contravariant 5y agoYeah I think that part is a bit iffy, and if you look at the resulting image it does seem to have some fringes around the outside of the cat, indicating that it's showing something related to the curvature of the heightmap, rather than the intended image. It's probably a good enough approximation to at least generate a recognizeable image. Especially if you use a point source because then each 'window' will reflect all its light in more or less the right direction which will converge on a single point as well. Not sure if they'll all focus on the same plane but it's probably close enough.
- mferraro89 5y agoyep I think you're exactly right, as evidenced by the fringes.
- mferraro89 5y agoAuthor here. That's a fantastic question! I think you're right that a better solution would include adding curvature to the individual "pixels" in the lens mesh. Unfortunately I don't know how to manufacture anything with microstructure that small! The microlenses would need to be of order .2mm by .2mm square and have curvature that is very slight, because the image plane pixel is about 20 cm away. Perhaps this could be achieved by choosing a ball-nose machine tool of the exact right radius and sweeping it back and forth in the channels formed between the "pixels"? It would leave a grid of tiny features that might just get the job done! As is I just gloss over that completely and I don't address it. So tiny, lone, bright pixels end up more smeared than I'd like.
- contravariant 5y agoI don't think you really need to carve individual pixels. If you've got the logic worked out to ensure the light falling at (x,y) ends up at (u,v) then the part you're missing (assuming we're dealing with sunlight for now) is a function f(x,y) = (u,v) that transforms a constant density into the density corresponding to the image you desire. Using the change of variables formula this basically means that we want h(f^(-1)(x,y)) |det Df| to be constant. Which is quite easy in 1D (it's just the inverse cumulative density function), but significantly trickier in 2D. In 2D the problems seems to be underdetermined. One solution would be to first solve the horizontal problem for each row and then solve the vertical part for the total densities of each row. Or the other way around. There might be a way to make this optimal in some sense, but I'm not quite sure what to optimize for.