pouët.net

Ideas for putting together a tunnel effect?

category: general [glöplog]
 
Hey all!

I am working on my first demo, and I've decided that I want to put together an "infinite tunnel" effect in open GL, on the P.C with no further restrictions at the moment.

Can you suggest some approaches for the basics of these kinds of tunnel effects? It seems like a classic demoscene trope, so I'd be curious what the different ideas are for constructing such a tunnel.

My limited open-GL / graphics experience makes me think I need to start by making some kind of hollow cylinder type primitive, then deforming it somehow and running the camera through it, but somehow I think there's a much more elegant way.

Any prime examples to learn from? Common approaches?
Maybe you can check out www.shadertoy.com. I believe there are many tunnel approaches there made from just using a fragment shader on a rectangle.

Your geomtry approach will also work of course.
added on the 2017-04-22 07:06:12 by rloaderro rloaderro
There are literally dozens of ways how to do a tunnel, based on what you want to achieve and what platform you're on, but here are some proven ideas:

- spiral of cubes into z direction; race a camera through, modulo at opportune times to make it infinite
- particle effects (you can pre-blur them oldskool Kewler's style :D)
- abuse radial blur (I did some shaders like that)
- trace/raymarch tunnel-like geometry (many flat hollow cylinders in z-direction, with different offsets and such)
- texture look-up & "table-effect" (popular in the old days; works in shaders too)
- other solutions based on atan and not much else
- pre-rendered modulo animation / palette animation (again, old days' stuff :P)

I'm sure there's more. Just experiment a little and you'll find something that looks nice enough to get you started. :)
added on the 2017-04-22 07:44:34 by tomaes tomaes
(forgot one really obvious one: z-seamless mesh tunnel, pre-made in C4D/Maya/Blender; then fly through that; manhandle vertices as needed)
added on the 2017-04-22 08:41:55 by tomaes tomaes
@rloaderro:
Nice! I wouldn't of thought to do a particle tunnel but it makes sense. I love the "rules of engagement" shader from your examples - I'll have to pull that apart and see how it works.
Quote:
My limited open-GL / graphics experience makes me think I need to start by making some kind of hollow cylinder type primitive, then deforming it somehow and running the camera through it, but somehow I think there's a much more elegant way.

Honestly, don't overthink it. Just do it the cylinder way first, and then iterate over it, "maybe I can add a texture", "maybe I can add some distortion" and so on.
added on the 2017-04-22 11:10:31 by Gargaj Gargaj
baordog: You replied to the wrong person. ;) But yeah, start nice & easy and go up from there.
added on the 2017-04-22 11:33:07 by tomaes tomaes
Yeah, the important thing is to become comfortable with the coding in general, not with specific effects. I had a ton of effects that I had no idea how they worked back when I started, and then over the years I forgot about them, and then now I can just go back to them and do them in 15 minutes cos of the experience and understanding I picked up over time, mostly through other stuff that I wanted to do.

The point is, once you have something up and running, even if it's basic as shit, but you get to the point where you look at it and start to have fun with the parameters or it starts to give you ideas on what to do, that's the best place to be in. When you're starting out, your coding should be driven by your inspiration.
added on the 2017-04-22 11:47:28 by Gargaj Gargaj
Oldschool way of tunneling:
Fixed framebuffer & colorcycling.

Not-so oldschool way:
Fixed camera inside a torus & scroll the texture.
added on the 2017-04-22 12:09:32 by T$ T$

login