Chris Maughan 2024-04-03 13:20:41 A simple demo, trying to show how a pin-hole camera works. Not really how it works, but kind of. 😉
The 'film' in the back of the camera is a 'flatland' view of the scene, upside down, of course....
Chris Maughan 2024-04-03 13:22:39 For the curious, I'm learning Rust, I did it using the Bevy game engine.
Ivan Reese 2024-04-03 13:24:57 Nice! Is this at the limit for particles, or can you shrink them and have, say, 10x as many?
Chris Maughan 2024-04-03 13:30:28 Probably, I haven't tried, but the machine wasn't under any strain doing this and recording it. I could increase the granularity of the sensor too. The idea is to show this as 'here's roughly how it works in the real world', but then 'here's how we do it when ray-tracing, by firing the particles in reverse from the camera.
The 'sister' demo, is the 3D version, also in Rust. My plan here is to do a series where I gradually build up to something more realistic; with this as the most basic starting point....
Chris Maughan 2024-04-03 13:35:21 10x the particles, but doesn't make things any easier to see 😉 and runs about 5FPS. But there are many reasons why this could be slow; including my code.
Ivan Reese 2024-04-03 15:51:55 Hmm. Resisting the urge to go all "art director" on this. Best to let you keep exploring. I'm excited to see where this goes next!
Chris Maughan 2024-04-03 16:11:59 There's a balance here between reality and descriptive visuals. I've thought about making the white photons dim or rings before they hit anything, to make the bounces clearer. I can of course improve the shading, or the camera look and feel, within limits; I'd rather have something that was obvious, to get the point across.
Fredrik 2024-04-03 16:25:24
But there are many reasons why this could be slow
Classic Rust question: Did you turn optimization on?
Feel free to ask me for help with Rust. I'm experienced with Rust performance and Open GL among many other niches.
Chris Maughan 2024-04-03 16:28:26 Yeah, for capture, I was running cargo run --release. But this isn't really about performance; it is more about creating a nice demo/visualization. I only care about performance if it stops me capturing a smooth video of the animation.....
Oleksandr Kryvonos 2024-04-05 21:25:23 now I have better understanding of pin-hole camera principle, thanks