Fox caused quite a stir among magicians in the late 1990s, airing specials featuring the Masked Magician breaking the “magician’s code” by giving away tricks of the trade.

Reality TV is slowly undergoing a similar process, except those pulling back the curtain on these Wizards of Ahs aren’t even bothering to cover their faces.

On Tuesday, I moderated a panel at the Westdoc conference titled “Structuring Reality,” exploring the “creative license” utilized in assembling reality shows and asking, “How are the narratives of unscripted shows really written?”

Given the topic, I was surprised to be invited and mystified anyone would participate — advertising, in essence, the ways TV’s “reality” manipulates, um, reality.

Unscripted TV appears to have moved well beyond familiar practices like Frankenbiting — grabbing snippets out of context to advance a particular story or build suspense — to more elaborate forms of staging. To understand how we got here, however, and the internal tensions at play requires a bit of history.

Remember, it’s only been a half-generation since “Who Wants to Be a Millionaire” launched in 1999, quickly followed by “Survivor” and “Big Brother,” establishing the enormous potential of alternative, unscripted programs.

As networks rushed to join the parade, shows in the first wave largely came from producers with a background in news or documentaries. Granted, many cut their teeth on tabloid fare — several graduated from KABC-TV’s “Eye on L.A.” — but if they possessed an anything-for-ratings mentality, they also had an aversion to blatantly making stuff up.

In the years since, unbridled demand has birthed a newer generation weaned on producing reality shows, with fewer compunctions about cutting corners. They see themselves as filmmakers, as storytellers, so why limit the toolbox to what you actually document with a camera?

As for networks, with budgets tight, waiting patiently isn’t always convenient or practical when you need a show to be funny or dramatic. As Spike’s exec VP of original series Sharon Levy said, manipulation is “OK in certain instances,” inasmuch as you don’t always “have the five years to sit and wait” for the required shot.

Levy suggested time was the enemy more than money, especially with networks racing to beat similar-sounding concepts onto the air.

The motivations notwithstanding, auds should take reality not with a grain of salt but with a shaker.

Consider “Gigolos,” the graphic Showtime series about male escorts. Read the fine print, and you’ll find this disclaimer: “No one depicted in this program was remunerated in exchange for engaging in sexual activity” — presumably because “Consensual Adult Sex” is a less-promotable title.

TruTV scarcely conceals the heavy staging across its lineup. Asked a few months ago about the practice, the network responded, “TruTV’s series feature real people and are based on real situations. Due to production needs, some scenes are reenacted.”

Recently the unscripted world has also witnessed instances of friendly fire, or what President Lyndon Johnson colorfully called pissing inside the tent.

“I think most of the shows are fake,” Mike Fleiss, producer of “The Bachelor,” was quoted saying in June at the Banff World Media Festival. “Outside of the talent shows and ‘The Bachelor,’ where we really kill ourselves and spend a lot of money and time and destroy our staff to make sure it’s real … 70 to 80 percent of the shows on TV are bullshit. They’re loosely scripted. Things are planted.”

Other veteran producers have echoed those sentiments, privately griping about the inherent disadvantage of striving to do shows on the up-and-up when others have no qualms about staging them.

The assumption is viewers don’t care. Yet the industry hasn’t had a genuine debate about forces shaping the genre and risks — if any — in becoming more brazen about its artifice.

Of course, magic survived the Masked Magician, which appears to be the prevailing strategy. Whenever new revelations emerge, wait awhile and — presto! — they’re forgotten. Just like magic.

Still, should programmers be concerned when all four panelists Tuesday — asked about watching other people’s shows — said beyond competitive curiosity, they didn’t and wouldn’t?