Ah, there we go. Matrix rain with depth.

It's a significant tradeoff. Until this experiment, I'd kept everything 2D so I could shape everything in the fragment shader, like so:

That flexibility has to be sacrificed to do perspective projection in the vertex shader. But I see no other way. I wouldn't want to learn raymarching for this application.

· · Web · 2 · 0 · 2

@rezmason why would perspective projection of a 2d image need ray marching?

@zens Ah, I should have been more specific! 😅 The raymarching would be for "raindrops" at different distances to the camera, rather than a 2D image.

It would be similar to raymarching a forest, actually. 🤔

@rezmason is it that it needs to be geometry so that it can integrate with other 3d objects? otherwise i don’t quite see how this is different from just scaling and layering

@rezmason and you don’t need raymarching for just perspective projections either, i would havr thought a simple non linear matrix would suffice if you’re just positioning some sprites

@zens Ultimately what I'm attempting is to modify my 2D effect to leverage the depth effect in a holographic display.

I've been operating under the assumption that, to give any object the appearance of depth consistent at every supported angle, I'll need to render my scene from 32 vantage points, and to give each "raindrop" its own z-value. My current work aims to accomplish this with quads and mat4s in a vertex shader.

@rezmason ah! i got it. i do think it is possible to make the shader view dependant, which would mean you’d effectively gave something like a virtual holographic display inside the renderer. but i can see that may be more complicated than it is worth.

i guess i see ray marching as a technique mainly needed for rendering density fiields like inigo quintillez’s work does. i still think it would be possible to do your thing inside fragment

@rezmason that is, i think you could do it without ray marching; but it nay be more trouble than it is worrh

@zens To your point, raymarching may be overkill but in its place I'd need a hypothetical fragment shader to determine, for each pixel:

- which vantage point to use (nice!)
- how many raindrops contain that pixel, and at what distance (no clue)

I suppose I could instead render multiple 2D layers of glyphs, and render those to a stack of quads that have different depths. I think that's what you were suggesting? But then the grid the 2D glyphs conform to becomes a more apparent characteristic.

@rezmason do not try to bend the pixel. instead, realise there is no pixel.

@rezmason the layers of quads thing is simulating how looking glass works. i mean more akin to parallax mapping or the trick of sticking an environment map on a quad to simulate a buiding interior through a window that shows like, a tardis console or whatever that is camera angle dependant

@zens "The matrix... is the world that has been pulled over your eyes to blind you to the truth."

"...Nnnno, no I'm pretty sure it's sixteen floats arranged in a grid, buddy"

@rezmason you get used to it. all i see now is scale, rotation, translation


I think someone proved in '07 that the whole universe can be computed by two people in a booth, who are either hungry, thirsty or full, deciding what to eat from an infinitely long sushi menu.

Of course there's no general algorithm to find the time it takes them to make up their minds.

@rezmason they're taking their sweet time, apparently

Sign in to participate in the conversation

Revel in the marvels of the universe. We are a collective of forward-thinking individuals who strive to better ourselves and our surroundings through constant creation. We express ourselves through music, art, games, and writing. We also put great value in play. A warm welcome to any like-minded people who feel these ideals resonate with them.