[HN Gopher] Ray tracing Voxels made out of Glass
       ___________________________________________________________________
        
       Ray tracing Voxels made out of Glass
        
       Author : beefman
       Score  : 57 points
       Date   : 2022-10-23 16:44 UTC (6 hours ago)
        
 (HTM) web link (voxelchain.app)
 (TXT) w3m dump (voxelchain.app)
        
       | yoyopa wrote:
       | it's nice but the plot is kind of lacking and i didn't care much
       | for the protagonist.
        
       | mcbuilder wrote:
       | Works great in Chrome on a Titan XP under Linux, decent FPS.
        
       | beefman wrote:
       | Video: https://twitter.com/VoxelChain/status/1584184198834769920
        
         | lastdong wrote:
         | Thank you
        
       | Twirrim wrote:
       | Doesn't seem to work correctly for me on Firefox (on Windows,
       | with an Nvidia 1060 ti), fine on Chrome. On firefox I get an
       | orange triangle in the lower right corner, and that's about it.
       | Moving around causes the texture to build up in that triangle.
        
         | LordHeini wrote:
         | Can confirm.
         | 
         | Got an RTX 2070.
        
         | massinstall wrote:
         | Same here.
        
       | jeroenhd wrote:
       | Only works in Chrome. Meh.
       | 
       | Seems like it uses a WebGL feature that Firefox doesn't support?
       | Whatever the boolean "isManualMipMappingSupported" refers to
       | probably doesn't work in my browser (because
       | EXT_color_buffer_float is supported by Firefox and so is normal
       | WebGL and those are the three checks that make "WebGL is not
       | available" appear). At least the detection is done based on
       | feature detection rather than simple user agent filtering, so
       | this demo should work when Firefox eventually adds whatever
       | feature this site is relying on.
       | 
       | There's a line in the console that says
       | "https://stackoverflow.com/questions/71247789/how-do-you-
       | rend...". This leads me to
       | https://stackoverflow.com/questions/71247789/how-do-you-rend...
       | which appears to be a Firefox bug?
       | 
       | GNOME Web gives me a completely blank page so whatever version of
       | WebKit that's running is utterly unsupported as well...
       | 
       | Looks like WebGL isn't as broadly supported as I thought!
        
       | coldcode wrote:
       | My browser is not supported. Maybe they should tell me why.
        
         | peaslock wrote:
         | My Firefox is now stuck with a note at the top of the screen
         | saying something like "voxelchain.app is controlling your mouse
         | cursor. Please press ESC to take over."
        
         | csdreamer7 wrote:
         | On Linux Firefox with Intel Alder Lake Mobile graphics I get a
         | "Your browser is not supported" error.
        
         | felipellrocha wrote:
         | Seems like they're using some features that are not available
         | in all browsers, and failing with a single error message
         | instead of explaining which feature is missing.
        
         | warning26 wrote:
         | Same result on Firefox on Mac.
        
         | red_trumpet wrote:
         | Yeah, they tell me "WebGL is not available", but
         | https://get.webgl.org/ seems to differ in that opinion...
        
           | crispyalmond wrote:
           | Same here, I've tried a couple different browsers but none of
           | them worked. I'm on Linux with a fairly recent AMD GPU.
        
           | jb1991 wrote:
           | Same here, WebGL compliance passes for me, but this site says
           | I do not have WebGL.
        
           | JoyrexJ9 wrote:
           | Same. I've been doing a bunch of WebGL side project stuff and
           | yet this site claims I can't run it. There's some broken
           | detection code I think
        
           | martyvis wrote:
           | Ditto for Chrome on Android 13 on Pixel 6
        
       | offByJuan wrote:
       | Warning. This link brought my aging laptop to lock up. I'm on
       | Firefox.
        
       | b34r wrote:
       | Doesn't work in Safari on an iPhone.
        
         | dezmou wrote:
         | Just make a list of things that actualy work on Safari IOS, it
         | will be faster
        
       | bugfix-66 wrote:
       | If you're ray-tracing voxels on a GPU, one technique is to use a
       | single bit per voxel (so 32 voxels per uint32_t: a 0 bit means
       | empty, a 1-bit means filled) and then put the whole voxel space
       | into a Morton space-filling curve like this:
       | 
       | https://bugfix-66.com/e2d9aaf5b7f285b4d35c46e87fcf6f7e25d338...
       | 
       | You can then cast rays through 3D space mapped onto 1D space,
       | with one ray per GPU thread.
       | 
       | The space-filling curve gives you locality of reference (just
       | like an octree), and the simple linear nature of the data means
       | you can use a sparse bit vector to represent it. Huge regions
       | without voxels are represented implicitly:
       | 
       | https://bugfix-66.com/7256e0772dc3b02d72abf15b171731c933fd44...
       | 
       | Of course, you want a much larger branching factor (to get a
       | shallower tree) for rendering.
       | 
       | You can step your ray through the space without deinterleaving
       | the bits, like this:
       | 
       | https://bugfix-66.com/d6907b4d3eb6330241128ffbaeef6194ddeecc...
       | 
       | This technique allows extremely detailed (and real-time
       | editable!) voxel worlds with tiny code.
        
         | gfodor wrote:
         | Damn, thanks for this info
        
         | lwansbrough wrote:
         | Do you have a demonstration of this or can you point to anyone
         | using this method?
        
           | bugfix-66 wrote:
           | I used this technique commercially (about 5 years ago) to
           | build voxel representations of the world in real-time from
           | lidar data (Velodyne VLP-32C).
           | 
           | Each lidar return (a 3D point) provides a line of empty
           | voxels from the lidar origin to the location where the laser
           | hit a surface. Because you know the light followed that line
           | uninterrupted, you know all the voxels on the line are empty.
           | 
           | The lidar is giving you thousands of points per second and
           | the lines (derived from the points) carve the voxel space.
           | The voxel space is rendered continuously. It's very
           | satisfying to watch the space being carved out.
           | 
           | I don't know of anyone else using this technique before me,
           | and I don't know of anyone doing it now.
        
             | lizen_one wrote:
             | I read or saw a similar paper. I guess that they used
             | (multiple) 3D cameras instead of a LiDAR to get the point
             | cloud. But otherwise it was similar. They used a octree or
             | similar data structure for speed up. What did you use?
        
               | bugfix-66 wrote:
               | I take it you didn't "read or see" anything I wrote
               | above.
               | 
               | But thanks for taking the time to post a comment!
        
       | juunpp wrote:
       | I mostly see a red-glowing triangle on the bottom-right of the
       | screen.
       | 
       | Is this broken?
        
       | s9w wrote:
        
       ___________________________________________________________________
       (page generated 2022-10-23 23:01 UTC)