Dark Bit Factory & Gravity
PROGRAMMING => General coding questions => Topic started by: spitfire on May 20, 2009
-
Id like to know how some effects are done. In all cases I dont want to hear about how one might implement them with 3d, but rather the clever multiplication/buffer techniques that were used in older times. Unless of course they too just used 3d back then.
A twisting tunnel. I know how to look around in a tunnel but how do they make those that turn?
Twister. On the mindcandy 2 peview dvd trixter said a twisting cube was done by rendering different slices of the cube at different rotations, then playing those slices out of order. Is that how most twister bars are done? Can u tell me more about this technique.
Wormhole. So you have a buffer of range values in a certain shape, and then slide some texture over that. How exactly do you map your texture onto this shape though?
Lighttrails, sticking out from behind a shape.
I cant remember the others I had questions about right now.. I'll post later.
-
Here are 3 great posts about the twisting bar fx:
http://www.dbfinteractive.com/forum/index.php/topic,1555.0.html (http://www.dbfinteractive.com/forum/index.php/topic,1555.0.html)
http://www.dbfinteractive.com/forum/index.php/topic,675.0.html (http://www.dbfinteractive.com/forum/index.php/topic,675.0.html)
http://www.dbfinteractive.com/forum/index.php/topic,752.0.html (http://www.dbfinteractive.com/forum/index.php/topic,752.0.html)
There are some tunnel examples on here somewhere too but I can't find them!
Very often the cool fx on the Amiga were done by using clever pre-computation techniques - so pre-rendering some results and playing it back in a particular order are way up there as possible solutions to problems. Anything you end up calculating as part of an fx can be put in a table. If you can put those tables in RAM and look them up very quickly that's another great way of breaking something really tough down in to a few lookups.
I did a swirly demo thing that twisted a bmp demo, some time ago, damned if I can find that either! It started off doing everything the hard way, then worked on driving it all by tables to get it up to real time.
Jim
-
A twisting tunnel. I know how to look around in a tunnel but how do they make those that turn?
There are some nice tricks you can use to get these very fast in software rendering.
Firstly it helps to think of the tunnel as a series of rings, you can generate the plots on a circle using some simple sin and cos;
X=RADIUS*SIN(THETA)
Y=RADIUS*COS(THETA)
When making a tunnel I would typically generate 720 or even 1440 plots in a circle, then you can have offsets into the screen depending on how many segments your tunnel has.
very simply you never have to depth sort this type of tunnel ;) always draw it from back to front, move an offset for z into the screen until it has moved forward a couple of segments and then simply reset it.
Because you have lots of points, if you have 1440 points on each circle and you connect up with a gap of 90 points you will end up with 16 faces in each segment, by having a simple offset and moving this between 0 and 90 you can make the tunnel spin.
Twister. On the mindcandy 2 peview dvd trixter said a twisting cube was done by rendering different slices of the cube at different rotations, then playing those slices out of order. Is that how most twister bars are done? Can u tell me more about this technique.
Again, no serious techniques need to be used here as Jims links show.
All you do is have some simple sin / cos, 4 points per scan line at 90 degree offsets and just check if X1 is < X2 for each pair, if it is then draw a line between them.
You could even go to town on this and precalculate some texture getting darker and narrower and actually use pointers to fake a texturemapped bar, just like this;
(http://www.intro-inferno.com/pics/thumbs/1522.jpg)
Wormhole. So you have a buffer of range values in a certain shape, and then slide some texture over that. How exactly do you map your texture onto this shape though?
Not sure what you mean here, but if it is what I think then you'd basically use some formula to look up pixels in a texture map, depending on the formula you can do spheres, lenses, tunnels or any shape really.
Lighttrails, sticking out from behind a shape.
Usually these are achieved by grabbing the image in the frame buffer, dimming it and pasting it over the top, look for "radial blur" to find out more :)
-
Wormhole. So you have a buffer of range values in a certain shape, and then slide some texture over that. How exactly do you map your texture onto this shape though?
If you're refering to a classic wormhole like eg. this one...
(http://www.copro.org/malte/pcde/wormhole.gif)
...you draw the shape using a 16x16 (=0..255) "texture" and plot a unique color for each texel.
Now you can move/morph/blend your texture by simply assigning a new palette.
-
Thanks alot for the feedback IVe already learnt alot here!
I dont quite get what youre saying about the tunnel. The tunnel effect I know isnt drawn with circles, but with angle and distance buffers. When you use the word "faces" Im thinking of triangles in 3d. I really dont want to make a proper 3d tunnel.
That twisty effect is brilliant! I find the creative use of simple math much more impressive than blunt implementation of higher math, like ray tracers etc.
Yes thats the wormhole Im talking about.
Regarding light trails, how do they do the moving light trails sticking out from behind text for example. The rays stick out further in certain sections as the apparent light source behind moves around.
-
maybe it would be better to show you some code, this is a very old cracktro I made so I apologise for the code!
I have basically taken out the logo and music so that it can be run in freebasic, this is how to cheat at tunnels:
[edit - source added to zip]
-
An Error Has Occurred!
You are not allowed to access this section
when trying to download :(
-
Try again mate, I was updating it
-
Ah thanks got it. That demo is awesome!
-
Just watched unreal by future crew. How do they do the real colour plasma?
(at about 5:45 minutes in, halfway)
[youtube]http://www.youtube.com/watch?v=vxGtPAhkEQU&eurl=http%3A%2F%2Fwww.dbfinteractive.com%2Fforum%2Findex.php%2Ftopic%2C4069.0%2Ftopicseen.html&feature=player_embedded[/youtube]
-
I always wondered how the fast mapped tunnel on unreal is possible. I knew these effects usually involve a correspondence of the pixels of a bitmap to specific pixels on the screen, since the mapped object was static and you just scrolled the texture. But the Unreal wormhole had a good resolutionand ran smoothly on my 386. I later remember it when I investigated a similar technique in quickbasic on my 386. It's funny (http://gatestodelirium.blogspot.com/2009/02/funny.html) how quickbasic on a 386 can do 70fps mapped tunnels, sphere mapping and everything, if the texture is 16*16 (no files, just explaining the technique a bit).
As for the plasma in unreal I am also still wondering (among with other things)
-
Interesting blog post there Optimus K+ :)
I agree with you, it is amazing what can be squeezed out of a fairly low powered machine even using basic!
-
@spitfire:
hi.. maybe this stuff about tunnels may help you:
http://www.dbfinteractive.com/forum/index.php/topic,1942.0.html
(http://www.dbfinteractive.com/forum/index.php/topic,1942.0.html)
-
That wormhole looks awesome, how its generated and done i've no clue.
As for the real plasma, is it the one that has text saying real and then unreal?
or is it the one after that, looks like some kind of shade bob technique to spread out the colours?
-
Thanks vain but that has everything except what I wanted to know :P
clyde: yes the bit after it says "real color pasma".
-
How do they do the real colour plasma?
It's a 320x400 screen-mode showing three static plasma-clouds (a red, a green and a blue one) drawn in alternating scanlines (and alternating row-order for each pixel), each using a part of the 256-colour palette.
The motion is produced by color-cycling the palette-part of each sub-image.
They're also toggling between two different row-alternations each frame (two 320x400 images fit the 256kb of standard-vga-ram).
Just zoom into the image to get the idea:
(http://www.abload.de/img/plasma2mwa9.png)
-
Thanks for the explanation Hellfire, that's a nice trick, the interlace thing. I even used it myself in the past but it didn't look half as good.
-
Yeah. Nice explanation, Hellfire. K++
-
How would you create a plasma cloud?
a tip and not to be a party pooper - spit fire dude, i'd recommend that you start a new topic per effect question next time around matey. that way you'll be able to find answers a bit more easier too.
-
You could use perlin noise to make a similar looking pattern to the one Hellfire posted there mate.
-
Maybe this links help you how to create a plasma cloud:
http://pacific.mpi-cbg.de/wiki/index.php/JRuby_Scripting (http://pacific.mpi-cbg.de/wiki/index.php/JRuby_Scripting)
Btw, if you find and d/l the old Amiga BlitzBasic archive.. just take a look to its examples... their was an very cool and easy to understand PlasmaCloud source included.
-
Cool and thanks. Hopefully this is helping Spitfire, as Im not meaning to topic hijack ( far from it ), rather point the dude in the right direction.
If I remember correctly with the original Amiga Blitz Basic 2, it used some assembler and copper interrupts. I will see if i still have the cover disk for BB on Amiga.
-
Tunnels can be raytraced in 8x8 or 16x16 blocks with tex coords interpolated between them, or precalced, where the movement is created by just adding 1 to the v coord of each pixel per frame.
That plasma looked to me like precalced perlin noise on each channel, then adding 1 to each channel color (RGB 255) and letting it overflow...
-
It's a 320x400 screen-mode showing three static plasma-clouds (a red, a green and a blue one) drawn in alternating scanlines (and alternating row-order for each pixel), each using a part of the 256-colour palette.
The motion is produced by color-cycling the palette-part of each sub-image.
They're also toggling between two different row-alternations each frame (two 320x400 images fit the 256kb of standard-vga-ram).
Just zoom into the image to get the idea:
Hi, I was Googling around for some information about the Future Crew demos and bumped into this post. I haven't found much information as detailed as this about their effects so it was really cool to read this, and zoom into the image myself to see what you meant :)
I was just wondering, do you know how they made the plasma effect in Second Reality? As it seems a lot more dynamic than the one in Unreal (which as you say seems to be made out of static plasma clouds).
-
Also, if anyone's interested in generating a static plasma as a component to making an effect like in Unreal (not Second Reality), check out this link:
http://www.ic.sunysb.edu/Stu/jseyster/plasma/
It describes an algorithm for making a "plasma fractal".