"This scene with Luke, the X-wing, R2-D2, and the swamp monster was shot in three different locations and edited together.
Two you would probably expect. The third, not so much.
The first is the main scene shot on the Dagobah swamp set at Elstree Studios with the full-scale X-wing, Mark Hamill, R2-D2 and the full camera crew and divers. Divers were in position under the water to animate and control R2’s dome and periscope, as well as the swamp creature.
The second, is for the physical launching of the R2 unit shell out from beneath the water line and into a net in order to film the swamp creature spitting R2 out through the fog into the forest underbrush. This was filmed on a stage.
The third was a second unit pick-up shot of the swamp creature’s back rising up and breaking the foggy surface of the swamp water, and then disappearing back beneath it. This was filmed in George Lucas’ unfinished swimming pool."
https://www.facebook.com/groups/crewstories/permalink/2780741658660369/