Darkly comic, vastly entertaining and utterly original, Paul Thomas Anderson’s “Boogie Nights” is one of the most ambitious films to have come out of Hollywood in some time. Spanning the height of the disco era, 1977-84, pic offers a visually stunning exploration of the adult entertainment industry, centering on a hard-core movie outfit whose members form a close-knit extended family. New Line release will need strong critical support to score commercially with mainstream viewers and become the event movie it deserves to be, though risque subject matter and epic running time might divide audiences and tarnish box office results. But no matter how prosperous “Boogie Nights” is at the B.O., it will no doubt establish Anderson as one of the hottest directors of the 1990s.

Helmer Anderson makes a quantum leap forward in his second, exquisitely produced feature, following the Sundance-premiering “Hard Eight,” which didn’t find its audience. His striking command of technique, bravura filmmaking and passionate exploration of the possibilities of a new kind of storytelling recall the young Scorsese of “Mean Streets.”

The link to Scorsese has other foundations. In its approach to the porn industry as a unique social milieu, with its own heroes, players and norms, “Boogie Nights” resembles “GoodFellas,” Scorsese’s chronicle of organized crime, and, to a certain extent, Altman’s cynical take on studio politics in “The Player.” All three movies document subcultures considered exotic by the mainstream, highlighting their complex duality of values: the seamy, sordid elements in combination with more humanistic and familial ones.

Relying on the rags-to-riches format, story follows the rise and fall of Eddie Adams (Mark Wahlberg), a handsome, uneducated teenager who works in the kitchen of a popular San Fernando Valley nightclub. Back at home, Eddie has to face the oppressive company of a passive father and a domineering mother who keeps reminding him he’s stupid and a failure. But when he’s spotted at the club by Jack Horner (Burt Reynolds), a successful porn producer, Eddie is instantly lured to a promising career in the adult entertainment industry. Naive and gullible, he immerses himself wholeheartedly in the new world, which offers a substitute family and the seductive lifestyle of sex-music-drugs.

Adopting a new name, Dirk Diggler, and a new look, he soon becomes a hot property and rises to the top of his field. From his p.o.v., it’s the American Dream come true, with all its symbols of success: a luxurious house, a fancy wardrobe, a red sports car. Hard-working Dirk soon comes up with a novel concept, a film series that flaunts his skills as an action hero — a porn James Bond.

There’s a heavy price to be paid, however. As the yarn moves into the 1980s, Diggler’s excessive drug use, endless partying and enormous ego begin to interfere with his work. Not understanding the industry’s competitive nature and that he’s easily replaceable by the next young stud, Dirk confronts Jack with outlandish demands and is humiliatingly removed from the set. In a powerful scene, Dirk is diminished to a hustler selling his services to a male customer in a parking lot for 10 bucks, and is then brutally assaulted in a vicious gay-bashing.

Scripter-director Anderson clearly is aiming for something broader and more ambitious than a simple account of the inner workings of the porn industry. He captures the business at a time of change (precipitated by the video revolution). And like Scorsese’s “GoodFellas” and “Casino,” “Boogie Nights” is a parable of the greedy and decadent 1980s. Yet considering the potentially explosive nature of the material, Anderson’s strategy is remarkably nonjudgmental and non-sensationalistic. The erotic scenes — the films within the film — flaunt nudity, but they are handled discreetly and with a healthy dose of sardonic humor.

A well-crafted, if also overextended, canvas, picture comes across as a piercing, seriocomic inquiry into the personal lives of the players involved. Though the treatment is sometimes schematic, each individual is given a distinctive profile — and a bag of problems to handle: a cuckolded husband (a touching William H. Macy) who’s tormented; a blond Rollergirl (a terrific Heather Graham) who demands respect from her sex partners; a decent man whose dream is to open a stereo store (a dignified Don Cheadle); a rich druggie who’s smarter than he appears (an eccentric Alfred Molina, in the film’s most brilliantly staged scene).

Superbly cast, each thesp in the large ensemble rises to the occasion — there’s not a single flawed performance in the film. Bound to become a star after this movie, Wahlberg renders a splendid performance as the gullible lad who truly believes that he should not be “selfish” about his natural gift but instead generously share it with others. In what is easily his best character role, Reynolds shines as the film’s moral center, a surrogate father and filmmaker who takes pride in his metier, attempting to elevate the crassly commercial into the genuinely artistic. The enormously versatile Julianne Moore excels as Amber, the company’s female star and surrogate mother, who loses custody of her son due to her “irresponsible” lifestyle.

Pic’s first hour, which is devoted to one year (1977), is nothing short of brilliant, both narratively and technically. But subsequent chapters, which become increasingly shorter, and numerous subplots and secondary characters make the saga too sprawling and a bit too messy for its own good.

Physically, “Boogie Nights” is impeccable, with Bob Ziembicki’s detailed production design, Robert Elswit’ astutely flamboyant lensing and fine L.A. locations resulting in an excitingly vibrant look that captures a bygone era in American pop culture.