News for hackers. Stuff that matters.
Re:The Secret Life of Photons: Simulating 2D Light Transport by stared on Sunday November 15, 2015 @06:52AM (#10569359)
Beautiful! the only thing I am missing is the ability to construct own setup online (e.g. adding a few lenses, with specified curvatures).
Re:The Secret Life of Photons: Simulating 2D Light Transport by Tunabrain on Sunday November 15, 2015 @08:41AM (#10569573)
Unfortunately, that's not possible in the current version - originally I had a demo with larger scope in mind, but WebGL turned out to be a lot more limited than I expected.

I wasn't able to implement an acceleration structure in WebGL, so the amount of primitives it can trace in real-time are quite limited, and all scenes had to be hardcoded in GLSL. This makes modifying scenes a real pain, since adding a new primitive amounts to generating and compiling new shader code.

The original C++ version just constructs the scene from very small (~1px long) line segments and then builds a BVH acceleration structure over them, so you have practically unlimited freedom in the type and number of primitives. Unfortunately traversing a BVH inside a shader in WebGL is almost not doable, so I had to improvise.

Re:The Secret Life of Photons: Simulating 2D Light Transport by nealabq on Sunday November 15, 2015 @01:26PM (#10570477)
(I assume you're Benedikt.)

This is beautiful work. Especially the write-up. I think we all understand the urge to code, but your desire to take the next step and describe what you've done is fantastic. Thanks for the gift.

This reminds me of those optics tables you see in museums, in the hands-on section for kids. Where they'll have a table with a rectangular inset, and in it will be light sources and prismatic pieces of Plexiglas that you can move around. You see the light tracing paths and scattering.

I've played with these setups and find them disappointing. If these museums instead had tables with touch displays, they could run software like yours. Of course they could also run other apps and anything that runs on a phone, so maybe that ruins the whole "this is special because it's in a museum" feel.

Re:The Secret Life of Photons: Simulating 2D Light Transport by justifier on Sunday November 15, 2015 @03:41PM (#10571084)
for a similar interactive demo here is an old hn post: https://news.ycombinator.com/item?id=8335581