9 ms·
Show HN: A raycaster that renders to random dot stereogram (like Magic Eye)
- montecarl 8y agoI get a grey static noise image. Like an old black and white TV that isn't tuned to a channel. Latest Chrome on Linux with NVIDIA GTX 1060 using proprietary NVIDIA drivers 410.104.
- sonofgod 8y agoThat's correct -- if you cross your eyes correctly, you should see some 3D depth in the static. http://www.magiceye.com/faq_example.htm http://www.magiceye.com/faq_example.htm has some helpful instructions (you're looking for a planet with rings) Would be useful if it had some markers for achieving the correct amount of focus.
- Aardwolf 8y agoI've never been able to see these things. In this example, I always see two squares when trying to look behind it, never 4 like the instructions require. How can I let my eyes focus behind the screen? I can focus my eyes in front of it by looking at my finger, and get 4 squares that way, but that doesn't work for focusing behind it, for me. No planet appears when making it 3 squares while looking at finger in front of it either for me. And if I remove my finger, my eyes immediately change their focus :/ Any tips?
- NeedMoreTea 8y agoNo tips - except at a guess 10 or 20% can't and won't ever see them. I spent ages trying to make these things work in the 80s or 90s whenever the posters were the craze. Never got close, and there were quite a few others they simply didn't work on.
- benj111 8y agoNow you're just bringing back memories of the mid 90s and people giving 'helpful' suggestions of how to see the images. I still can't see them.
- akeck 8y agoYes. That's expected. It's a Magic Eye style stereogram. If you make your eyes do the Magic Eye "thing", you can see the 3D shapes in the world and use the arrow keys to move around.
- egypturnash 8y agoThat's what it's supposed to be. The explanation assumes you already know what an "autostereogram" is and know how to look at them. There is a trick involved where you focus your eyes on a point somewhere in space behind the screen instead of on the screen, and it suddenly acquires depth. https://en.wikipedia.org/wiki/Autostereogram https://en.wikipedia.org/wiki/Autostereogram will tell you more about this.
- ammon 8y agoPress 1 or 2, and it will render in normal 3D
- cwkoss 8y agoCould be used for stereogram steganography!
- foobarian 8y agoI see a sailboat!
- throwaway1500 8y agoFirst of all: One of the most awesome use of autostereogram i have ever seen! I always wondered if that was possible. Thank you! Question, did you experiment how to reduce the flickering? Or use of colors?
- ammon 8y agoThanks! I did try to smooth the flickering. There's a 4th render mode. Press 4 and you'll get a smoothed version of autostereogram. It does look better in autostereogram. However, you'll notice that the smoothing causes an "information leak" into the 2D image (you can see the outlines of the walls)
- classichasclass 8y agoAlthough autostereogram is fun, an additional anaglyph mode (red-cyan) might be nice for people who have trouble with such images.
- Y_Y 8y agoIf you want actual doom as a magic eye thingy, someone else made it already: https://blogum.itch.io/omdo https://blogum.itch.io/omdo
- ammon 8y agoSuper cool, and more impressive than what I did! :)
- Y_Y 8y agoI didn't mean to dimish your achievement. It just rang a bell with me and I thought people might want to literally try doom. I haven't tried your one, but OMDO (linked in GP) is an unplayable nightmare dizziness-inducing headache.
- nneonneo 8y agoGetting shot at in OMDO really ruins the effect, especially since it's nigh-impossible to spot them quickly. I wish you could just play it without enemies.
- sbilstein 8y agoSadly, it’s basically impossible for me to play. Still awesome.
- umanwizard 8y agoTangent: I have spent probably at least a few hours total periodically trying, from when I was a child until now, to see the hidden image in Magic Eye, and have never been able to see absolutely anything at all, despite reading guides on how to do it, etc. Does anyone else have this experience? Is there something physically different about my eyes or brain compared to people who can see them?
- chubasco 8y agoYou can see an inverse of the 3D image by simply crossing your eyes until things "line up". It will appear 3D, but things that are intended to jump out at you will sink into the page instead. But that will at least give you a general idea of how it is supposed to work. Then after you get it working this way the whole "unfocus your eyes" approach will make a little more sense.
- noir_lord 8y agoIt's a schooner.
- cdelsolar 8y agoyou dumb bastard, it's not a schooner, it's a sailboat.
- deathanatos 8y agoI did, for many years. It's one of those things that's hard to explain, and hard to do until you've done it, at which point you understand yourself then how to do it. My father did magic eyes in the newspaper every week when I was a child, and I could never do it. I did start to wonder if he made it all up, but there was an answer key and he was able to figure it out, so there had to be something to it. Go to the paper: https://www.cs.waikato.ac.nz/~ihw/papers/94-HWT-SI-IHW-SIRDS-paper.pdf https://www.cs.waikato.ac.nz/~ihw/papers/94-HWT-SI-IHW-SIRDS... Go to figure 7, "Figure 7. Stereogram showing a hemisphere", on page 24. There are two black dots near the bottom. Cross your eyes: you should now see 4 black dots (2 per eye). Adjust how "crossed" your eyes are such that the "inner" two dots line up, s.t. there are only "three" dots, like `(dot) (two overlapping dots) (dot)`. Now, the hard part: your vision likely blurred when you crossed your eyes; without uncrossing your eyes, and maintaining the position/overlapping of the dots, bring your vision into focus. (This is, IMO, the hard bit.) Once I've got it into focus, I find my vision "stabilizes": I'm able to look around w/o having to concentrate on keeping my eyes crossed to a particular amount. At this point, I can look up above the dots, and there is a hemisphere in the image, as the figure caption says. This doesn't have to be done w/ magic eye images, either. Two normal 3d renderings of a landscape side-by-side, where the camera in one rendering slightly horizontally offset from the other, will also work. The idea is the same: overlay the images in your visual field, then bring it into focus. At least, that's what works for me. According to the sibling comment from chubasco, there's more to it, I guess, but the above is all I know.
- parf02 8y agovery cool, I find it's a bit easier to see these with a bit of alcohol
- cpach 8y agoI hesitated to upvote this because few things frustrate me as much as autostereograms (hello childhood memories) ...but it’s a cool project, so have an upvote :)
- JeremyHerrman 8y agoSuper cool! Does anyone know alternative non-random dot approaches to autostereogram generation? Seeing the random dot approach in video highlights the lack of temporal coherence across frames.
- ammon 8y agoYou can apply the exact same algorithm to any starting pattern (it does not have to be random dots). When a pixel is unconstrained by the algorithm, just pick a pixel from an image (rather than a random value). Of course, to work well the image needs a lot of small details. I actually tried that here. But the result "leaks information" into the 2D image (as you move around, the deformations of the 2D image reflects the 3D geometry). It seemed less interesting.
- strenholme 8y agoOK, is it just me or does the stereogram render backwards: The more distant stuff (the skyline) looks closer, while the floor and walls looks more distant? I cross my eyes to see these because I can’t do the “focus on the horizon” trick. Perhaps have a mode where the close/far stuff is swapped so it looks right to those of us who cross our eyes to see these.
- loco5niner 8y agoThere are 2 ways to see stereograms and I it depends on how exactly you are focusing. One way is the "inverted" version you see. For me, everything appears as it should. Here's one place where this is discussed: https://www.reddit.com/r/MagicEye/comments/2u0cc1/inverted_images/ https://www.reddit.com/r/MagicEye/comments/2u0cc1/inverted_i...
- deleted 8y ago[deleted]
- devrod 8y agoIt's your head. There are two ways to view the stereogram, if you are seeing a negative, try again.
- SamBam 8y agoIt's not your head, it's whether you're using your left eye to view the left side of the image or to view the right side of the image.
- sigspec 8y agoIf I cross my eyes I see it the way you describe. If I relax my eyes it goes the other way I see it correctly. It took me a while to figure out how to do this as a kid. Almost like putting my eyes into a far off daydream state.
- gwbas1c 8y agoThat just means you're crossing your eyes the wrong way.
- 8y ago
- pablo1 8y agoDon't know much about stereograms, two general questions: a) Is it possilbe to render color images this way? b) Is it possible to have the random dots not change all the time? E.g. When I don't move in this example, I dont see the need to draw new random dots. Also when moving sideways e.g. would it be possible to keep the dots where they are, relative to the world?
- ammon 8y agoIt's possible to use color in that the dots don't have to be black and white, and don't have to be totally random. The way an autostereogram works is that there's a repetitively tiled base image (or vertical column repeated horizontally). The stereographic angle information is encoded in mutations of the repeating image. That base image can be anything (including a photo). However, this color image will not correspond in any way to the 3D geometry of the scene. I don't know of any way to get color information to correspond to BOTH the 3D geometry and the stereographic information (without using two images).
- bradyd 8y agoIn the Wikipedia article on autostereogram [1] there is an example of a chess set [2] where the 2D image directly corresponds to the 3D autostereogram image. It is apparently a type of wallpaper autosterogram, instead of random dot, which requires horizontal repetition for the effect to work. [1] https://en.wikipedia.org/wiki/Autostereogram https://en.wikipedia.org/wiki/Autostereogram [2] https://en.wikipedia.org/wiki/Autostereogram#/media/File:Chess_Single_Image_Stereogram_by_3Dimka.jpg https://en.wikipedia.org/wiki/Autostereogram#/media/File:Che...
- ammon 8y agoInteresting! I think this is possible here because the 3D geometry is also horizontally repetitive.
- nneonneo 8y agoThat picture in particular has a really interesting parallax effect - view it in stereo and move your head around. For me, the back rank seems to shift a lot with head position, even though the image itself is (obviously) stationary. Regular Magic-Eye pictures do this too, but to a much less noticeable degree.
- derekdahmer 8y agoIt's weird but if I zoom, I can't make the magic eye work. Even at 50% or 200%. I wonder why that is?
- loco5niner 8y agoLOVE this! Cool little world to play in. I enjoyed editing a hole in front of me, falling in and editing a staircase to get back out.
- devrod 8y agoIt would be nice if the dots didn't change between renders of otherwise identical frames.
- jordanwallwork 8y agoThat actually seems to be quite an important property in highlighting what a cool effect it is. Someone else here posted a link to a similar project they'd done [1]. If you follow the link and press T to switch on the noise, and then A to start the box moving, you'll see how obvious it is and the effect just isn't as cool. However if you then press B to switch on the background movement the box suddenly become harder to see until you correctly focus your eyes 1 - https://moefh.github.io/stereogram/index.html https://moefh.github.io/stereogram/index.html
- tunnuz 8y agoMaybe it's just me, but after using this, the text on hacker news comments feels like it's placed at various different z-indices.
- parksy 8y agoThis is pretty cool. I remember when Magic Carpet came out back in '94 (https://ultimatehistoryvideogames.jimdo.com/magic-carpet/ https://ultimatehistoryvideogames.jimdo.com/magic-carpet/) It had a magic eye feature, which I haven't really seen before or since so it's neat to see a modern implementation in the browser.
- noneeeed 8y agoHah, came here to make that comment. Love that game. If I remember right there were a couple of of other modes, including a red/blue glasses version.
- dividuum 8y agoThanks for confirming that was actually a feature. I wanted to post as well but couldn't find any screenshot of how that looked like back then and hesitated, fearing that I remembered it wrong :)
- noneeeed 8y agoYeah, I got really into the whole auto-stereo effect when I was a kid, started drawing them when I was bored in class, so being able to play a computer game like that was pretty cool at the time.
- arduinomancer 8y agoThats so cool! Reminds me of the 3DS sort of 3D feeling.
- jonny_eh 8y agoThe readme is perhaps the best explanation for ray casting that I've ever read. So succinct!
- moefh 8y agoThat's really nice. I did something very similar a few years ago: https://github.com/moefh/stereogram/ https://github.com/moefh/stereogram/ My version shows a simpler scene (a single tumbling cube) and also works with random-dot rendering, but also supports rendering with a tiled image (I found that tiled images work better for static 3d scenes while random-dot works better for animated scenes).
- phkahler 8y agoAlways wanted to try this with my ray tracer. Some thoughts: 1) Higher frame rate will probably help - it will look even more like old TV snow wrapped around things. 2) Color per object should be possible but it will bleed. This may or may not help the effect. 3) Possibly change the dot size based on distance (some dots are seen at two different distances, so average them? This would be similar to how color might be done. Advantage would be that the snow would be more like a texture that gets smaller further away. 4) I'm not sure about the notion of "base image" I always assumed a method of rendering that may not be what others do.
- jstanley 8y agoI wonder if someone could make a terminal emulator that renders to a "magic eye" view of some hexadecimal characters. That way we could actually interact with a computer while staring at a screen of randomly changing characters, just like in the movies.
- noneeeed 8y agoA quick suggestion that would help people to "lock-on" to the effect, add two small coloured dots the distance of the stereo separation. It makes it easier to work out if you've managed to uncross your eyes the right amount.
- gwbas1c 8y agoFYI: It might be easier if I could pause the stereogram until I can get my eyes focused. With the magic eye images, I usually focus on a point until my eyes lock in. With the image constantly changing, there is no point to focus on. I kept double-crossing my eyes because there was no reference.
- gmiller123456 8y agoMy trick for seeing these is to shine a flashlight on my face from the side, then focus on my reflection in the screen.
- tbabb 8y agoLooks like the parallax is quantized into whole-pixel shifts, leading to flat planes at discrete depths. The eye can pick up very small sub-pixel shifts when doing parallax solving. Good antialiasing would be necessary for a smooth/continuous perception of depth.
- ozzyman700 8y agoThis has a wonderful bunnyhop :) now I have to find the easter egg
- nneonneo 8y agoA hint for anyone looking for the easter egg: you're unlikely to find it in the stereogram view as it depends on the colour of the tile (use e+left/right arrows to edit colour).
- nydel 8y agooh this is so much fun! love it.
- sagebird 8y agoThis is wonderful. I found it more enjoyable if you add the following css to the canvas: canvas{ image-rendering: pixelated; width: 100vw; height: 100vh; object-fit: cover; position: fixed; top: 0; left: 0; filter: contrast(.3) sepia(405%) hue-rotate(273deg); } Then view full screen (F11). It fills your screen with a red toned version, with less contrast which I prefer. These things are highly personal so I suggest you experiment to find settings you like. Setting image rendering to pixelated is really personal as well, as some will prefer the softer look of blurring, but it helps me lock on to the stereogram.
- keyle 8y agodamnit I looked everywhere for that easter egg and didn't find it.
- olliej 8y agoI wonder how feasible getting some temporal consistency in the dots would be? (Something similar to what the return of Obra dinn does?) Alas it does actually make me nauseous :(
- krueger71 8y agoFound it easier to get the correct effect if I removed my computer glasses
- dusted 8y agothis is super cool! :) for some reason I can never see gradients in these :( so it was a bit disorienting until I realized it's literally just a room with some stairs in the middle. I'd love to see more complex geometry in this :)
- deleted 8y ago[deleted]
- creative-coder 8y agoAmazing! didn't think I could get so hooked up to a stereogram renderer.... I'd suggest adding other colorful background variations, apart from random dots, as well. Thanks for sharing !