Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  

Quake style warping liquids in GIMP

Recommended Posts

I thought this might be useful for people who want to recreate the Quake effect of warping liquids.

First step is to extract the original texture from a resource such as QUAKE101.WAD, and rename it to something suitable.

We'll be using GIMP's Ripple effect to create the warp, which in theory has a wrap-around option to retain tiling, but in practice it can screw up. So we'll double up the 64x64 texture to 128x128 to create a tiled version of the original to bypass any potentional glitches.

I'm doing this in Paint.Net for speed, but I could have performed this in GIMP in much the same way. We copy the original texture, increase the canvas size to 128x128, and then paste 3 copies and align them, using the arrow keys if necessary to adjust by single pixels.

Okay now we have a tiled version of the orignal we'll save it out 8 times in 24bit or 32bit RGB colour.

Now we open GIMP and drag our 8 images into it, creating 8 GIMP windows, and arrange them in an organised way so we can easily step through each frame.

Now we select Filters - Distort - Ripple

So we're going to create an 8 frame animation that repeats using a horizontal sine wave. We will eventually combine this with a vertical wave that repeats over 12 frames to create a final animation of 24 frames in which the horizontal component repeats 3 times while the vertical component repeats twice. This should hopefully create something that looks aperiodic.

A few notes here:

Antiliasing will smooth out the motion of the animation and blur the image slightly, which is fine for the Quake Lava texture, but we might not want to use it with a sharper noisy texture.

Retain Tilability doesn't work reliably, so we'll ignore it since we're using a pre-tiled version of our texture.

Period is set to the same dimensions of our original texture, that is 64. If went larger than 64 the wave we're going to create wouldn't tile. We could use a value than subdivides into 64 such as 32 or 16, but really we want this wave to be as big and smooth as possible.

Amplitude is set to 4 pixels which may not seem much, but it will create a lot of motion when combined with the vertical wave later. (Infact, in the MAYHEM16 version I did I only used a 2 pixel amplitude here.)

Phase is the most important part, and it's how we'll create the actual motion of the animation by altering the Phase for each frame. The total Phase of the animation will be 360 degrees. So since we're using 8 frames for the horizontal we will be using values of 45, 90, 135, 180, 225, 270, 315 and 360 for each respective frame.

Once the effect is applied, we can 'Overwrite' the original image, and then 'Close Without Saving' the GIMP window for this particular frame.

Now we move onto the second frame. GIMP should remember what we just did, so we can either select 'Re-show Ripple' from the menu or use Ctrl-Shift-F to bring up the Ripple Dialog for the next frame.

And now we can apply the Ripple to each frame, just changing the Phase value, and then Overwrite each image, Close-Without-Saving each GIMP window until we're done.

So now we have our first 8 frames, we can dump them into SLADE3 and use the arrow keys to step through the animation and get a feel for how it looks, and make sure we didn't screw up anywhere.

Ok those 8 frames are fine, so we'll copy and rename them to create the full 24 frames.

And then we'll backup those 24 frames into a temporary directory, incase we screw up the next part.

So now we will apply the vertical wave component to the first 12 frames, doing much the same as before, except we'll tick vertical instead of horizontal, and divide 360 degrees by 12 instead of 8 to create Phase values of 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330 and 360. Additionally, we will use an Amplitude of 6 pixels instead of 4. This is because the vertical wave is over 12 frames instead of 8, so it needs to move further to have the same velocity as the horizontal wave.

So we'll dump the first 12 frames into SLADE to have a quick look and check for any errors. You'll notice that GIMP screwed up the top edge of the image, but that's fine since we'll be cutting out the central 64x64 pixels later.

Now we repeat the whole process for frames 13 to 24, completing the animation.

Now's not a bad time to backup the 24 128x128 frames to another temporary direction, and then we'll proceed with cutting out the central 64x64 pixels of each frame to create the final animated texture. I'll do this in Paint.Net again for speed, using the canvas size option from the Image menu.

And finally, we can dump the results into SLADE3, switch on the tile option and see how the whole thing looks. (Additionally I setup a PLAYPAL to check how the images look converted from RGB to the target palette.)

This next part is optional.

We're going to use a displacement map to alter the motion of the animation in a subtle way which will hopefully make it look a little less regular.

So we'll create an image called DISTORT, that's just a black background with random grey blobs, that tiles in the same way as our animated texture. And we'll apply that image as a displacement map to each 128x128 frame that we backup'ed earlier.

So at the default values we end up with something similar to the BTSX liquids, which we don't want. So we'll knock that down to about 2 pixels, and this will create a bit more distortion and bluring. But importantly, the parts of the animation that move across the bumps in the map will accelerate and deaccelerate slightly creating a more organic motion.

A quick note on Displacement Mode. The Polar option can create nice twists and whirls but it will screw up the tiling, so Cartesian has to be used unless you're willing to hand-correct the seams in every frame.

Since we're applying exactly the same effect to every frame, we can use Ctrl-F to quickly step through the whole process, and once again Overwrite and Close-Without-Saving each of the 24 frames.

And finally, we can back-up and check the results, then cut out the central 64x64 part of the images, and see how it looks in SLADE, and then incorporate it into our final WAD, and check it out in game.

Job's a good'un. Now drink beer.

Share this post

Link to post

I thought there was a WARP quality you could apply to textures that does this for you in-game?

Share this post

Link to post

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now
Sign in to follow this