For half a century, Louis M. Eilshemius has been among the most tragic and mysterious figures of American art.

Born in 1864 to a wealthy immigrant family in New Jersey, well-traveled and educated at Cornell, the Art Students League and the Academie Julian in Paris, Eilshemius died penniless and broken by rejection and frustration in the mental facility at Bellevue Hospital in New York in 1941.

Though virtually ignored by fellow artists, dealers, critics and collectors for most of his 77 years, his funeral was attended by dozens of them - the ultimate irony in a life of irony.

In that sense, Eilshemius, life stands as metaphor for dozens of other American artists who have similarly received recognition only when it was too late.

Predictably, two generations of artists, dealers, critics and collectors turned up last night to celebrate the resurrection of his art at the Hirshhorn Museum. It is his first museum retrospective ever, and will be on view through Jan. 1.

It was fitting that such a retrospective should take place at the Hirshhorn, since Joseph Hirshhorn had amassed, since the '30s, the largest collection of the artist's work extant - 200 examples, more than 30 of which now hang in the bedroom of his Washington home.

"I remember the first time I met him in 1932," says Hirshhorn. "He was an old man sitting in a chair with a cover over his legs, and he wouldn't shake hands with me. He knew I'd bought several things from dealers, but he wouldn't shake my hand.He lived in a terribly messy place. There must have been 2,000 pieces stashed in a closet."

In fact, Eilshemius might have remained unknown even to Joe Hirshhorn but for his "discovery" by Marcel Duchamp in 1917. After seeing two of his works in an unjuried show, the influential Duchamp declared Eilshemius' strange paintings to be the most significant entry in the show, and subsequently helped arrange his first solo gallery exhibitions at the Societe Anonyme in 1920 and 1924.

After that, Eilshemius gradually became something of a cult figure among the New York avant-grade, with artists like Stieglitz and O'Keeffe paying him court. The influential Valentine Dudensing became his dealer, the Metropolitan Museum bought his work, and critics began writing enthusiastically about him. Hirshhorn, Duncan Phillips and other important collectors began to buy.

But the recognition which he had sought for so long came too late. After the critics ridiculed his first show at Societe Anonyme (it was the second show that broke the ice( he had given up painting forever and became a virtual recluse in his 57th Street and Park Avenue apartment, part of his inheritance. It is said that dealers had taken advantage of him, paying him virtually nothing for dozens of works. In any case, he had no nomey and suffered from malnutrition.

By now grand eccentric, he spent his time berating critics and trying to make the world better aware of the talent about which he had no reservations whatever. "I am the da Vinci of modern times," he declared in a not atypical outburst. He came to his own defense often - in newspaper advertisements and handbills, and also in 30 volumes of poetry and music published at his own expense. "Versatility is my middle name," he said.

If Duncan Phillips admired Eilshemius' paintings - he bought 16 of them - he did not share the artist's enthusiasm for his poetry. "I have often wished that a big bonfire could be made, and without too much delay, of his cheapest and craziest things. I for one would throw his books of Puerile verse into the blaze. These excesses of a wounded vanity were clearly symptoms of a sick man who had yearned too constantly for fame and had been driven mad by total obscurity. "

But it is the art of Eilshemius which the current Hirshhorn show aims to tell us more about, and that it does, despite major shortcomings. His traditional beginnings in typical 19th-century Barbizon-inspired landscapes, with feathery Cerot-like trees and studio nudes are clear, as is the important influence of Albert Pinkham Ryder, another Joner whom Eilshemius much admired.

But from the first, it is clear that Eilshemius vision is different, and distinctively his own, even though the work becames more eccentric and melodramatic as time goes on. In "American Tragedy: Revenge," for example, a woman stands on a sylvan bridge, her arms sreaching toward the sky. All is still, and seemingly uneventful, unless one happens to spy the sniper half hidden behind a tree. The woman has just been shot: Danger lurks silently but ubiquitously in Eilshemius' art.

This is also true among the female nudes, of which he produced more than 1,000 paintings. "Dancing in the Sunlight" seems an innocent pastorale with symbols and woodland until one learns that in another version of the same work, a voyeur shepherd looks on.

So are Eilshemius' feelings about the potential destructiveness of women, and there are several paintings here which call up memories of similar themes in the work of Edvard Munch, whose show opens tomorrow at the National Gallery of Art. The ghosts of these artists might well meet on the mall one of these dark nights.

Perhaps Eilshemius does not emerge as one of the great undiscovered masters of 20th-century American art, but he deserves more recognition than he has gotten heretofore, and in this show is revealed to be a far better painter than was previously known. The watercolors in particular are spectacular. The snow itself, a chronological mishmash, limited to Hirshhorn hoklings, (fine as they are), leaves the way open to a more thorough retrospective treatment to come.

After the exhibition closes here it will travel to Eilshemius' alma mater, Cornell University, and then to Omaha; Springfield, Mass.; Los Angeles and San Francisco, all under the auspices of the Smithsonian Traveling Exhibition Service.

Paul Karlstrom, who wrote the exhibition catalogue as well as new monograph published by Harry Agrams, will give a free lecture and slide presentation on Eilshemius, "The Grand Eccentric of American Art," today at noon in the Hirshhorn auditorium. CAPTION: Picture, "Two Women Bathing," copyright (c) 1920, by Louis M. Eilshemius