Always full of mischief and mayhem, Roland Emmerich dreamed up the weather-gone-amok disaster epic "The Day After Tomorrow" after scarfing up the best-selling fantasy thriller "The Coming Global Superstorm."

When the 48-year-old German director gave the script to his favorite visual effects supervisor, Karen Goulekas ("Spider-Man"), she nearly fainted. "I usually try to read a script through for story," she recalls, "but I was so shocked, I thought, 'Man, he has gone mad.' The freight ship coming down Fifth Avenue sent me over the edge."

Even at a time when visual effects are a routine component of your average summer tent-pole movie, all Goulekas could think about was how difficult it was going to be to pull off "The Day After Tomorrow," which opened Friday.

"Miniatures or C-G?" she asked herself. "Oh, my God, it can't be done."

Clearly, computer graphics were the way to go. Goulekas immediately understood that this movie wasn't about blowing up bitty miniature sets, such as Emmerich's old-style effects adventure "Independence Day" from 1996. For this movie, the director not only wanted multiple twisters mowing down the Hollywood sign and the Capitol Records building in Los Angeles, he wanted a tsunami surging over the Statue of Liberty to flood downtown Manhattan, culminating in an enormous wave heading straight for the steps of the 42nd Street library, tossing aside the buses and taxis in its path like beach balls.

"When I first started writing the script, I never thought about the visual effects," admits Emmerich. "I described what I thought looked cool. If you think too much about what's doable, you'll have scissors in your head."

Emmerich wanted something more than computer graphics: He wanted photo realism. Buildings, water, fur and human skin are the toughest things to replicate in the computer. This movie had all of them, in spades, 416 effects shots in total. " 'Spider-Man' has buildings," Goulekas says. "But it's a comic book. The moviegoer sees a red and blue man flying around on a web. It's not going to matter if it doesn't look real."

But the audience had to believe that the buildings and water in "The Day After Tomorrow" are real. This takes time. And money: The storm surge sequence alone cost $200,000. Having rushed "Godzilla" to meet its 1998 release date, Emmerich insisted on more than a year of post-production to make sure the effects were done right. The filmmakers created pre-visualizations, or animated storyboards, for every effects sequence.

To handle these monumental effects, Goulekas first turned to her old FX shop, Digital Domain ("Titanic"). But although the Santa Monica effects house designed many stunning "Day After Tomorrow" sequences, including the destructive twisters, it was painfully slow. In October, six months before the movie's delivery date, Goulekas and Emmerich pulled the project from Digital Domain, terrified that the work wouldn't be finished in time. They parceled out the remaining effects to more than 500 people working at 12 different effects houses.

In fact, the crew built only one miniature set for the New York sequence -- for an underwater shot of the freighter hull nuzzling a sunken bus.

"On this one there was no way we could use miniatures," Emmerich says. "Water on miniatures is not doable; it doesn't look the same." To flood and then freeze Manhattan, Goulekas's effects team used the laser technology Lidar to scan 13 square city blocks, including 130 buildings in high detail. Starting at the end of 2002, they created an accurate high-resolution 3-D model of Manhattan in their computers, using 50,000 detailed photographs.

"It took thousands of man hours," says visual effects producer Mike Chambers.

They sent the final model to the effects houses, which then added digital water, snow and ice. Emmerich was willing to topple a frozen Empire State Building, but his post-9/11 sensitivity spared New York one dignity: "If so much water hit the Statue of Liberty, it would tumble over," he says. "In our movie it kept standing."

The effects wizards combined the digital wave plowing straight toward the film's young hero (Jake Gyllenhaal) on the library steps with live-action footage shot a year before on a stage set in Montreal. Gyllenhaal celebrated his 22nd birthday in a huge tank, sloshing hip-deep in 250,000 gallons of heated water along with 700 extras and 50 stuntmen who "didn't have a lot of opportunity to go to the bathroom," he says.

"That was a great present. My boots filled with water, and there was adrenaline."

That was because the young actor was drenched with water gusts from two diesel-powered V-8 wind machines mounted on moveable forklifts and 10 giant spinning rain towers spewing 5,000 gallons per minute.

"It got pretty bad," he says, while insisting that he had a good time. "I'm a masochist. They smacked me in the face with a wave and I couldn't see anything in the pouring rain. We had special effects guys standing at the edge in front of a blue screen making waves in the water with huge pieces of wood. Those were the only waves I saw."

At the beginning, Goulekas assumed that the buildings and water were going to be the toughest things to do. But at least "there were lots of real-life references for those," she says. "You can see footage of floods in cities." The real challenge turned out to be putting New York under the Big Freeze. What would happen to the buildings if the temperature dropped to 150 degrees below zero? "No one else had ever done a frozen city," claims Chambers.

The script called for the movie's Cassandra paleoclimatologist (Dennis Quaid), who has predicted that global warming will bring on a new Ice Age, to trek on snowshoes up the frozen, snow-buried Eastern seaboard from Washington to Manhattan to rescue his son (Gyllenhaal), who is holed up inside the library.

All the long shots of people walking through the snow were created inside the computer using digital stand-ins. Even the hungry wolves are digital creations. When Emmerich tried to use real ones, "they were docile and cute and scared," Goulekas says. With a computerized camera technique called motion-capture, George Lucas's effects house Industrial Light + Magic tracked the movements of German police dogs and added hair-raising infrared eyes and wolf fur.

ILM went punk with the frozen Statue of Liberty, giving her ice spikes on her frizzled white crown. The shot that kept Goulekas up at night was the ice crackling down the Empire State Building. "It becomes a scale issue," she explains. "How big is the ice? How quickly does it cover the city? If it's too big, it looks like a miniature city. If it's too small, it looks like it's covered with snow. It's important that the viewer understand what it is." Through trial and error, Goulekas shot different panes of glass with different kinds of spray ice, heating it with a blow-dryer to form ice flowers, and overlaid that texture on the C-G buildings.

For Gyllenhaal, too, working with snow and ice was more difficult than water. A company called Snow Business provided 20 kinds of snow.

Falling snow was made of little bits of shredded paper that "gets in your nose, eyes and eyelashes," he says. "It constantly takes going inside for a guy to wipe your face off, and outside again. They also put ice on your face, little rubber plastic crystals that you find in every crevice, like your eyes. Even weeks later you're taking them out of your ears and nose."

Fallen snow was ultra-absorbent diaper filling that expands with water. "It slips through your hands," says Gyllenhaal, "and it's impossible to walk on. You slip and fall over. It looks and feels like real snow, but when the FX guy blew it into Dennis's face in large amounts, he threw up." The actors had to wear spikes in their shoes to grip the wooden floor below the "snow."

"I knew what I was getting myself into," insists Gyllenhaal. "I didn't know I would be bombarded with baby diaper filling."

Thanks to painstakingly created computer imaging, actors in a 250,000-gallon tank in Montreal appear to be in New York City -- and in big trouble -- in "The Day After Tomorrow." From a new Ice Age to twisters, "The Day After Tomorrow" breaks new ground in special effects. Actor Jake Gyllenhaal says makeup specialists "put ice on your face, little rubber plastic crystals that you find in every crevice, like your eyes."Waves can be computer-made, but Roland Emmerich, right, still needed sets such as one depicting a flooded street.