noneeeed 5 years ago

A 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.

Y_Y 5 years ago

If you want actual doom as a magic eye thingy, someone else made it already:

https://blogum.itch.io/omdo

  • ammon 5 years ago

    Super cool, and more impressive than what I did! :)

    • Y_Y 5 years ago

      I 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 5 years ago

        Getting 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 5 years ago

    Sadly, it’s basically impossible for me to play. Still awesome.

strenholme 5 years ago

OK, 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.

  • jeffwass 5 years ago

    What always annoyed me is why they devised these to diverge your eyes and not cross them.

    Crossing your eyes is much more natural, and you can easily do it by looking at something close to your face.

    Diverging is much harder, at least for me and most other people I’ve talked to.

    So I can see these by crossing my eyes but everything is inverted. It comes out as a front layer with stuff cut out of it and behind.

    • nemetroid 5 years ago

      Your eyes shouldn't be diverging, just not converging (it's often called "parallel" viewing). It is more difficult to learn, and the offset between the images is more sensitive (since, as you say, actually diverging your eyes is near impossible).

      However, when you've mastered it, and when the offset (i.e. size) is correct, it's much easier to snap into than the cross-eyed viewing, and much easier to stay in focus while looking at different parts of the image.

    • ambrop7 5 years ago

      I agree, and diverging gets practically impossible if the image is farther away, like on a TV screen. There is no natural scenario when one's eyes would diverge, which is what would usually be necessary in such cases.

      • loco5niner 5 years ago

        >There is no natural scenario when one's eyes would diverge

        I like to look out a window at something distant, like a tree or car outside, then adjust my focus on the window pane itself (perhaps the little flecks of dust on it, or better yet one dot of paint on it).

        That is a very natural scenario, and at least for me. super easy. I've done it for decades though, so maybe it's just natural for me, lol.

        I can FEEL my eyes slightly squeezing to change shape (and thus change focus), and at this point it's simple muscle control, and it's fun.

      • WhiteSage 5 years ago

        Looking at something behind the screen (if transparent) or reflected on the screen (if slightly reflective) should do the trick.

        • ambrop7 5 years ago

          This only gets you there if the physical distance between the stereo images on the display is <= the distance between the eyes. If it is greater, you would need to look at something more than infinitely away / behind you (your eyes would have to diverge). In particular if the screen is already quite far away (e.g. a few meters), there's not much more far away you can focus anyway, since there's not much difference in angle between a few meters and infinity.

          • loco5niner 5 years ago

            I have to admit I don't understand your argument, but in my experience:

            Stereograms are NOT meant to be enjoyed from across a room.

            It's REALLY hard to 'catch' a stereogram from far away, so why are you even trying?

            However, the "focusing on-or-through a transparent thing" that WhiteSage mentions works well at slightly further distances and can be used to help you figure this stuff out.

    • anyfoo 5 years ago

      They look much better if they are made to “diverge”, instead of cross, the eyes. Much “larger”, “deeper”... I think one way to describe it is that it’s like you are looking out of a window, instead of looking at an object in your hand, if that makes sense.

      As for which one is easier: For some reason, I have always been able to do the “uncrossing” on command, and it feels more natural and more relaxed to me. I sometimes do it to compare almost identical things that are next to each other. Crossing my eyes feels straining.

    • jimmaswell 5 years ago

      Everything is blurry if I cross my eyes, but focusing far doesn't do that.

  • sigspec 5 years ago

    If 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 5 years ago

    That just means you're crossing your eyes the wrong way.

  • devrod 5 years ago

    It's your head. There are two ways to view the stereogram, if you are seeing a negative, try again.

    • SamBam 5 years ago

      It'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.

phkahler 5 years ago

Always 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.

parksy 5 years ago

This is pretty cool. I remember when Magic Carpet came out back in '94 (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 5 years ago

    Hah, 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 5 years ago

      Thanks 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 5 years ago

        Yeah, 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.

sagebird 5 years ago

This 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.

throwaway1500 5 years ago

First 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 5 years ago

    Thanks! 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)

montecarl 5 years ago

I 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.

  • egypturnash 5 years ago

    That'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 will tell you more about this.

  • sonofgod 5 years ago

    That's correct -- if you cross your eyes correctly, you should see some 3D depth in the static.

    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 5 years ago

      I'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 5 years ago

        No 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 5 years ago

      Now 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.

  • cwkoss 5 years ago

    Could be used for stereogram steganography!

  • akeck 5 years ago

    Yes. 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.

  • ammon 5 years ago

    Press 1 or 2, and it will render in normal 3D

JeremyHerrman 5 years ago

Super 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 5 years ago

    You 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.

devrod 5 years ago

It would be nice if the dots didn't change between renders of otherwise identical frames.

  • jordanwallwork 5 years ago

    That 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

umanwizard 5 years ago

Tangent: 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?

  • deathanatos 5 years ago

    I 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...

    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.

    • alok99 5 years ago

      This is the best instruction I've read so far on seeing them. I'm fine with cross-eye stereograms, so lining up to 3 dots was easy. What you described as "stabilizing" your vision once you've focused is what I normally do with cross-eye images to look around.

      In this case, I can stabilize, but I feel like I'm still seeing the inverse of what I should be seeing. The hemisphere looks like it's carved into the image (with various bands that I assume are shading). The very center looks like a hole was cut out and I can see "behind" the hemisphere. I assume this is supposed to be a highlight and the nearest point to me, but I see it as the furthest.

      • deathanatos 5 years ago

        Yeah, it's inverted for me too (hemisphere looks carved into the screen). chubasco's comment seems to indicate there's a way of looking at it that goes the other way (and that my technique results in a backwards image), but IDK — the above is the limits of what I know.

        • zeta0134 5 years ago

          Firstly: play around with the zoom. I have a much easier time with these at smaller sizes. Second, lean in close to your monitor, so that your eyes are straining a bit to keep the image in focus. Let your eyes "relax" out of focus. At first this might seem the same, but you're getting your eyes to effectively un-cross. Line up the three dots and you should now see the hemisphere in front of the plane, rather than as a cutout.

  • chubasco 5 years ago

    You 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.

  • gnode 5 years ago

    I'd come across this before, but only just now experienced it. It seems much easier to lock on to the hidden image when it's animated. Also panning your head up/down/left/right with your eyes seems to help too.

    Even when your eyes are pointing in the right direction, you eyes' lenses can be incorrectly focused. In order to see the image, you have to hit the correct combination of focus and parallax (which will disagree with what your brain is used to seeing).

    > Is there something physically different about my eyes or brain compared to people who can see them?

    This is possible, but probably unlikely. If you can't perceive depth, e.g. neurologically incapable, or you have less than two eyes, this won't work for you.

  • rux 5 years ago

    It is possible to have two fully working eyes but for your brain to lack the wiring to combine the two images into a single three dimensional construct in your brain. Your eyes can be fine yet you can have no binocular depth perception. If this is the case you'll not be able to see any Magic Eye pictures or SIRDSs, or get the benefit from going to a 3D showing of a film instead of a 2D showing.

  • noir_lord 5 years ago

    It's a schooner.

    • cdelsolar 5 years ago

      you dumb bastard, it's not a schooner, it's a sailboat.

  • newnewpdro 5 years ago

    For most of my life it seemed impossible.

    But a couple years ago I happened upon a magic eye image while laying with my laptop on my chest putting the display quite close and things just clicked. Now I'll spend hours flipping through magic eye images, it's only gotten easier with practice and the effect is incredible considering there's no drugs involved.

  • abecedarius 5 years ago

    I can't either. My eyes have dramatically different failings (one is nearsighted, one far) and have since I was a child, and it seems like even with glasses on it's just not gonna happen. I'm guessing it's the "since a child" part making my brain bad at stereopsis in general, though I really don't know.

  • cgriswald 5 years ago

    I can cross my eyes, “rattle” them, diverge them, move then semi-independently... and I’ve never seen a Magic Eye picture. I even tried to see the inverted view other people in this thread are describing by intentionally crossing my eyes and bupkis. I could almost believe it’s an Emperor’s New Clothes type of situation.

  • tillinghast 5 years ago

    Give it another try! I wasn't able to see these at all, and I haven't attempted in well over a decade. I was able to see this in under a minute. I wonder if something with the constantly changing image helped me jump the final hurdle…

  • soneca 5 years ago

    I don't know the scientific reason, but I was able to see the 3D image roughly around 5% of the times I tried. And after having success in seeing one, I was not able to learn how to do it always. The 5% success rate remained

  • davidgrenier 5 years ago

    You could probably get something by crossing your eyes instead... you will get the opposite image of what you would get by doing it properly, meaning that every 3d object will appear as carved out.

  • _bxg1 5 years ago

    It helps if you make a conscious effort to cross your eyes; if you're unable to do that it's probably harder, if not impossible

  • quickthrower2 5 years ago

    I couldn’t as a kid but I can now. Not sure why. And unrelated: I still can’t whistle properly.

    • nneonneo 5 years ago

      As a kid, I spent one summer learning to see Magic Eye, one summer learning to whistle (drove the other kids in my summer camp mad, I'm sure), and several months learning to snap my fingers.

      I always wondered why other kids could do things that I couldn't, so I guess I spent an excessive amount of time trying to catch up :)

classichasclass 5 years ago

Although autostereogram is fun, an additional anaglyph mode (red-cyan) might be nice for people who have trouble with such images.

jonny_eh 5 years ago

The readme is perhaps the best explanation for ray casting that I've ever read. So succinct!

moefh 5 years ago

That's really nice. I did something very similar a few years ago:

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).

pablo1 5 years ago

Don'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 5 years ago

    It'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 5 years ago

      In 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 [2] https://en.wikipedia.org/wiki/Autostereogram#/media/File:Che...

      • nneonneo 5 years ago

        That 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.

      • ammon 5 years ago

        Interesting! I think this is possible here because the 3D geometry is also horizontally repetitive.

gwbas1c 5 years ago

FYI: 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.

tbabb 5 years ago

Looks 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.

jstanley 5 years ago

I 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.

creative-coder 5 years ago

Amazing! 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 !

nneonneo 5 years ago

A 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).

olliej 5 years ago

I 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 :(

cpach 5 years ago

I 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 :)

arduinomancer 5 years ago

Thats so cool! Reminds me of the 3DS sort of 3D feeling.

tunnuz 5 years ago

Maybe it's just me, but after using this, the text on hacker news comments feels like it's placed at various different z-indices.

gmiller123456 5 years ago

My trick for seeing these is to shine a flashlight on my face from the side, then focus on my reflection in the screen.

loco5niner 5 years ago

LOVE 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.

derekdahmer 5 years ago

It's weird but if I zoom, I can't make the magic eye work. Even at 50% or 200%. I wonder why that is?

dusted 5 years ago

this 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 :)

krueger71 5 years ago

Found it easier to get the correct effect if I removed my computer glasses

ozzyman700 5 years ago

This has a wonderful bunnyhop :)

now I have to find the easter egg

parf02 5 years ago

very cool, I find it's a bit easier to see these with a bit of alcohol

keyle 5 years ago

damnit I looked everywhere for that easter egg and didn't find it.

nydel 5 years ago

oh this is so much fun! love it.