Character development for film
When Steven Spielberg purchased the book rights in 1991, he had planned for Bill Murray to play Shrek. Nicolas Cage was offered the role of Shrek at one point, but turned it down. In 1996, DreamWorks hired Chris Farley to do the voice. Farley had recorded 80 to 90% of the dialogue for the character, but died in December 1997, before completing the project. This would result in development of the film being scrapped, such as storyboards and recording sessions, which cost $34 million alone. Shrek screenwriter Terry Rossio describes Farley's vocal performance as being "extraordinary".
In August 2015, footage of Farley voicing the character, originally from 1997, was leaked across the Internet. According to Farley's longtime friend David Spade, he only had five days of voice work left to perform. Following Farley's death, the filmmaker approached his brother John if he would come in and finish the remaining lines, but he refused. In August 1998, DreamWorks then re-cast the role with Mike Myers, who insisted on a complete script rewrite, to leave no traces of Farley's version of Shrek. Myers stated that the reason he was interested in voicing the character was remembrances of his mother acting out fairy tales:My mother used to take me to the library in Toronto to check out the fairy tales. And she was an actress, so she used to act out for me the different characters in all these fairy tales. And then my mother would change stuff. Like because she's from Liverpool, Babar the elephant would be from Liverpool too. So I have all these great memories and associations with those stories. And I thought, when I have kids, that's the sort of well told, silly, and fun fairy tale that I would want to take them to. But it was an amazing experience. And I think Shrek is a real classic, a fairy tale classic.
In February 2000, after Myers had completed providing the voice for the character, and after a rough cut of the film, he requested to re-record all of his lines in a Scottish accent, similar to the one his mother had used when she told him bedtime stories, and also used in previous films he was in such as So I Married an Axe Murderer (1993) and Austin Powers: The Spy Who Shagged Me (1999).
Myers explained his decision, "There is a class struggle in Shrek between the fairytale kings and queens and the common people. I always thought that Shrek was raised working class. And since Lord Farquaad (the villain) was played English, I thought of Scottish". After hearing the alternative, Katzenberg agreed to redo scenes in the film, saying, "It was so good we took $4m worth of animation out and did it again."
Myers later reported: "I got a letter from Spielberg thanking me so much for caring about the character... And he said the Scottish accent had improved the movie." Some early sketches of Shrek's house were done in 1996 and 1997 using Photoshop, with the sketches showing Shrek first living in a garbage dump near a human village called Wart Creek. At one point, he was to live with his parents and keep rotting fish in his bedroom. Art director Douglas Rogers visited a magnolia plantation in Charleston, South Carolina, for inspiration for Shrek's swamp.