NEW YORK - Broadway is going green - and not with the lights producers are changing for newer environmental bulbs, but green for real, as in

Shrek

. You'd have to be the world's crankiest ogre to resist the witty, charming new musical that opened last night and gives Ugly the ultimate workover.

Taken from the late cartoonist William Steig's book and adapted from the first of the

Shrek

animated films by DreamWorks, which is making its Broadway production debut, the musical is endearing from the start, when the 7-year-old ogre is tossed from his home by Mom and Dad because, well, that's what ogre parents do.

He finds himself a swamp and grows (within seconds) to full ogre-hood. The rest is a classic plot woven into a delightfully reinvented fairy-tale world: Ogre is universally hated. Ogre reluctantly befriends donkey, another outcast. Ogre learns about feelings. Ogre meets girl.

We all know the drill, but so what? The story of a creature despised for his differences, who learns to let his freak flag fly and saves a community of fairy-tale characters from banishment offers chunks of identification for all. Especially when cleverly built by a team that includes Broadway veterans and newcomers with bright ideas.

The swift-moving book and smart lyrics are by David Lindsay-Abaire, whose devastatingly realistic

Rabbit Hole

, about the aftermath of a child's death, was a deserved Broadway success. The catchy music is by Jeanine Tesori, who has scored shows as different as

Thoroughly Modern Millie

and

Caroline, or Change

.

Jason Moore, who directed

Avenue Q

, stages

Shrek

to offer the same glimmers of possibility that better things are coming for its characters. Tim Hatley's ever-changing sets -

Shrek

is a road story set in a place with few roads - are towering and merry; he doubles as designer of the wonderfully otherworldly costumes. And Josh Prince, a choreographer with a lengthy resume but never on Broadway, debuts with spirited dances.

The script and some of the songs infuse

Shrek

with a coocoo quality much like

Spamalot

; its Pythonesque touches probably go over the heads of kids and straight into those of adults. One of the stage version's attractions is the contrasting tone of its musical numbers; minutes after a major production piece furthers the plot, a sweet, heartfelt number does the same.

Brian d'Arcy James (

Dirty Rotten Scoundrels

,

The Lieutenant of Inishmore

) plays Shrek for maximum empathy; at the end of the first half, when he sings about "Who I'd Be," you want to hug him, even though you'd end up covered with green. Broadway veteran Sutton Foster (

The Drowsy Chaperone

,

Young Frankenstein

,

Little Women

) is a wonderfully upbeat Fiona, the princess trapped in a tower and eventually Shrek's gal-pal.

For a musical portrayal of sheer megalomania, you can't beat Christopher Sieber (

Spamalot

,

Chicago

and a sheaf of daytime soaps), who plays Shrek's diminutive nemesis, Lord Farquaad, in a great costume that seems to have him walking in a chair. Effusive Daniel Breaker is a fine donkey pal, and the cast of fairy-tale stars includes a Pinocchio by the talented John Tartaglia (

Avenue Q

), who also operates the shows impressive fire-belching dragon. There's plenty of belching in

Shrek

, but the spiritual fire is what you come away with.

Shrek the Musical

At the Broadway Theatre,

1681 Broadway

at 53d St., New York.

Tickets: $41.50-$121.50. Information: 1-800-432-7780 or

.

Contact staff writer Howard Shapiro at 215-854-5727 or hshapiro@phillynews.com.