In an episode of Modern Family called "Aunt Mommy," Claire drunkenly agrees to be an egg donor for brother Mitchell and his partner Cameron. If Cameron provides the sperm and Claire provides the egg, they reason, the resulting baby would have DNA from both dads.

Though laced with sitcom-style goofiness, the episode sheds light on a serious problem faced by same-sex couples who want to start families. When it comes to having kids, they're not without options — many adopt, while others enlist the help of surrogates or sperm banks. Still, one question remains: Could two same-sex partners ever be biologically related to one baby?

Maybe. With a relatively new process called in vitro gametogenesis, or IVG, scientists can use stem cells to create reproductively viable gametes — in other words, eggs and sperm that are capable of creating offspring. Though it's only been tested in mice, a recent article in the Journal of Law and the Biosciences suggests that IVG, should it eventually prove successful in humans, "would allow same-sex couples to have children who are biologically related to both of them."

"By allowing each member of the couple to contribute genetic material, IVG would allow these couples to reproduce in a manner similar to fertile straight couples," the article's author, Sonia M. Suter, wrote. "In terms of equality, therefore, IVG offers significant advantages over other [assisted reproductive technologies]."

IVG could also help other types of people struggling to start families, from single people who don't want to source gametes from unknown donors, to heterosexual couples struggling with infertility, to postmenopausal women who still wish to bear children.

A little over a decade ago, scientists first converted embryonic stem cells from mice into eggs. At the time, the New Scientist reported that "most experts see no reason why the same should not work in humans." Since then, scientists have successfully used gametes derived from mice's embryonic and pluripotent stem cells to produce live offspring.

Getty Images

Here's how it would work in humans — specifically, same-sex couples.

Suppose two female-bodied people wanted to have a child through IVG. Doctors would extract cells from one female person and use them to form gametes of the opposite sex — in this case, sperm. Then, they'd combine that sperm with a "naturally" derived gamete — an egg — from the other partner, thereby forming an embryo.

"For lesbian couples, one or the other would be able to have the embryo implanted in her uterus so she could carry the pregnancy to term, avoiding entirely the need to rely on individuals outside the relationship to assist in their reproduction," Suter wrote.

In the case of two male-bodied people, they'd still need to find a surrogate to carry the baby to term, Suter wrote, "unless artificial wombs become a viable option." Given the advent of uterus transplants, that might not be as far off as we think.

IVG wouldn't just help same-sex couples. As Suter noted, it could also let single people procreate without needing sperm or eggs from another source, or even make room for "multiplex" parenting — when more than two people create one child, biologically related to them all.

Getty Images

Experts say the fertility treatment faces a number of potential obstacles.

"I think that's definitely something people have dreamed of for a long time," Piraye Yurttas Beim, founder and CEO of Celmatix, a personalized medicine company focused on treating infertility, told Mic.

Unfortunately, that dream could still be a long way off, Beim said, given various scientific obstacles associated with IVG.

"Creating a great egg is not just about the egg," Beim said. In people with functioning female reproductive systems, eggs grow inside complicated structures called follicles, she said. Follicles are comprised of "many different layers of different kinds of cells that support the growth of an egg."

"It would be remarkable, amazing, very exciting. It's just not happening tomorrow."

When it comes to artificially creating eggs from human cells, "just because it looks like a duck and it quacks like a duck, it doesn't mean it's a duck," Beim said. Even though experiments in mice were successful, it's tough to tell how an artificial egg gamete, created without the support of a follicle, would behave in terms of human reproduction.

IVG "is so interesting," she said, "but I think it's also important to stay grounded in biological reality."

Scientists also have to make sure IVG is safe.

"You'd still have a lot of safety studies to do in animals before you get to people," Arthur Caplan, a bioethics professor and founding director of the Division of Medical Ethics at NYU Langone Medical Center's Department of Population Health, told Mic. "I wouldn't be looking for this any time soon."

Getty Images

Even once it's tested in humans, scientists would still have to observe the resulting offspring for a number of years after to birth to make sure they don't encounter any problems.

That being said, should IVG for humans eventually hit the mainstream, Caplan doesn't have any ethical problems with it.

"It's certainly outside the box of thinking," he said, "but I don't find anything morally repellant about it."

Sure, some people will be unnerved to think that two men can create sperm and eggs between themselves and create biological children. "But," as Caplan said, "it bothered people to think that you could make babies in dishes 20 years ago. Now, nobody cares."

Though IVG will certainly take time, Caplan is certain "if we can do it, we will do it."

"It would be remarkable, amazing, very exciting," he said. "It's just not happening tomorrow."