Jump to content

Drawing the Vortex - How the Chronal Vortex effect is generated.


Blade

Recommended Posts

Ever wondered how they did that Chronal vortex effect in RA? Thanks to research done for RA++, you can wonder no more, I'm here to describe how it is accomplished.

 

The effect is actually created using a series of lookup tables, since doing the math for the distortion on the CPU in the days RA was released would probably have been a bit much. The lookups are actually a series of files located in REDALERT.MIX > LOCAL.MIX. They are unknown file names if you are using the standard XCC database but are actually named hole####.lut. There are also the *_VTX.PAL files which contain "fading tables" lookup tables for drawing shading effects like the .mrf files found in C&C.

 

To draw a "frame" of the vortex, the game decides what state the vortex is in and what frame it is on and then loads the .lut file for that frame. It then draws a 96 x 96 pixel buffer containing the terrain, tile and overlay graphics for the area that is going to be distorted to a special buffer used specifically for this effect and passes it to the distortion function. Game objects are not drawn in this buffer and thus are not present in the distortion if it overlaps them.

 

The distortion function applies the lut transformation which is stored as 3bytes per pixel to be transformed. The first two bytes are the X and Y coord in the source buffer, that the destination buffer pixel will be drawn from. The last byte is which table in the "fading table" will be used to shade that pixel as there are several remap tables, each getting progressively darker which are either loaded from the *_VTX.PAL file on theatre change or generated if the file isn't present. The destination is written left to right, top to bottom. The distorted copy of the buffer is then blitted to the actual rendered display.

Link to comment
Share on other sites

The distortion function applies the lut transformation which is stored as 3bytes per pixel to be transformed. The first two bytes are the X and Y coord in the source buffer, that the destination buffer pixel will be drawn from. The last byte is which table in the "fading table" will be used to shade that pixel

Hah, wow. That's surprisingly simple :D

Link to comment
Share on other sites

I much prefer the effect as its done in the PC versions personally, the PSX version is just a big smudge.

 

Regarding the DOS version, as far as I know the effect is the same, certainly the same lut files are used. Could be that an earlier build was bugged and the effect didn't transition to the funnel state, the vortex has a few states it can be in and one of them is dissapearing which based on videos of it I've watched doesn't have the darkened funnel effect (different luts are used for different states).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...