I have an infinite hexagonal floor, generated by tessellating a point grid in a tessellation shader pair:
Note that this is a flat wireframe - the "shadows" are a lighting trick:
Now, I'd like to make this appear to be thick, refractive glass, but am unsure how to proceed.
The first thing that came to mind is to
- set a uniform containing the requested "thickness" of the blocks
- When calculating lighting, use Snell's law to calculate the optical path length a ray would take through the hex block, if it were actually as thick as the "thickness" uniform says, and sum the alpha over that length. That would give the transparency, but doesn't handle things like internal reflection / TIR, etc.
I haven't tried that yet, so I'm not sure what the visual result would be.
Ultimately, for this particular level, I'm trying to get that glass, hexagonal floor look used in Tron: Legacy during the disc battle. (See this image for an example.)