Your next home mortgage could come out of your high-school teacher's retirement fund.

Or out of a state highway patrolman's pension dollars. Or for that matter, it could come out of the retirement nest egg set aside for the fellow who collects the garbage on your street.

So be nice to your local public employes. You may need their money. In fact, hundreds of thousands of Americans' ability to buy a home with a modest-rate loan in the next several years is likely to depend on them.

The rapid, recent growth in city and state pension-fund activity in home mortgages is probably the best-kept multibillion-dollar secret in real estate.

It's also the most important long-term financing development under way in the housing field, according to national mortgage market experts.

In at least 20 states, public pension funds have either stepped up investments in mortgages during the past year or have helped create specialized new vehicles to assist housing construction and sales within state borders. In half a dozen others, efforts are on the launch pad to pump public retirement money into home loans.

Colorado's state employe retirement fund, for example, is planning to invest $25 million later this month in below-market-rate mortgages, split equally between homes in Denver and the rest of the state.

Connecticut's retirement fund, which put $25 million into home loans at 13 1/2 percent last spring, plans to invest another $375 million in periodic dollops during the coming several years. Connecticut's phased program, dubbed "Yankee Mac," also restricts its financing to residential properties located within the state.

North Carolina's $5 billion retirement trust fund has helped start "NicMic" -- the North Carolina Mortgage Investment Corp. -- with a $53 million initial capital infusion. The corporation pools and packages local home loans into securities for purchase by pensions and other large investors.

Public pension plans in Massachusetts, Michigan, Alabama, Texas, Hawaii, California, Philadelphia, New York State and City, and Wisconsin also have been actively involved in their local mortgage markets -- often without major publicity hooplas.

California's huge ($21.5 billion) combined teachers and public employes fund may get even more involved this year through a mortgage purchase corporation on the drawing boards, tentatively dubbed "Cali Mae." It would operate on the state level much as the Federal National Mortgage Association (Fannie Mae) does at the national level, purchasing new home loans from local, conventional lenders and thus freeing up local capital for additional mortgages.

The long-range significance of this national movement toward targeted pension-fund mortgage investments "cannot be overestimated," in the words of Barry Rosengarten, head of the National Association of Home Builders' special task force on pension funds.

"I think it's fair to say that an important part of our future -- and by that I mean the housing construction industry and its consumers -- rests with pension funds. There is simply no other non-governmental source of capital that is so big, growing so fast and is socially conscious about the critical needs of local home buyers other than pension funds."

Rosengarten, a central New Jersey homebuilder, estimates public and private pension fund assets will top $1.3 trillion in 1985, up from $800 million at present.

He also foresees a stready, year-by year erosion in the capacity of traditional home mortgage lenders -- banks and savings and loan associations -- to meet home buyers' credit requirements during the rest of this decade.

Deregulation of the thrift institutions, plus continued high public reliance on the money-market mutual funds for savings deposits, "are going to make the capital 'well' shallower and shallower" at S&Ls and banks during the next few years, he said.

The pension fund "well" for housing, by contrast, is an ever-deepening one, according to Rosengarten, "if only we can put together the investment vehicles and political clout necessary" to encourage the interest already there.

Political clout?

Rosengarten won't elaborate. But other home-building executives at the national level confirm that they're seriously considering mounting a congressional campaign in 1982 to force private pension plans -- which have shown only token interest in housing -- to invest in mortgages as the price for their favorable federal tax status.