Countershading, the widespread tendency of animals to be darker on the side that receives strongest illumination, has classically been explained as an adaptation for camouflage: obliterating cues to 3D shape and enhancing background matching. However, there have only been two quantitative tests of whether the patterns observed in different species match the optimal shading to obliterate 3D cues, and no tests of whether optimal countershading actually improves concealment or survival. We use a mathematical model of the light field to predict the optimal countershading for concealment that is specific to the light environment and then test this prediction with correspondingly patterned model "caterpillars" exposed to avian predation in the field. We show that the optimal countershading is strongly illumination-dependent. A relatively sharp transition in surface patterning from dark to light is only optimal under direct solar illumination; if there is diffuse illumination from cloudy skies or shade, the pattern provides no advantage over homogeneous background-matching coloration. Conversely, a smoother gradation between dark and light is optimal under cloudy skies or shade. The demonstration of these illumination-dependent effects of different countershading patterns on predation risk strongly supports the comparative evidence showing that the type of countershading varies with light environment.camouflage | defensive coloration | animal coloration | shape-from-shading | shape perception M any animals, across diverse taxa and habitats, are darker on their dorsal than ventral side (1-8). One of the oldest theories of animal camouflage (9-13) suggests that this "countershading" has evolved to cancel the dorsoventral gradient of illumination across the body, thus obliterating cues to 3D form and enhancing background matching. Indeed, so common are dorsoventral gradients of pigmentation that Abbott Thayer branded his explanation as "The law which underlies protective coloration" (12). Countershading also became one of the most popular early tactics in military camouflage (14, 15). However, somewhat ironically, given that the theory was inspired by observations of nature, a role in biological camouflage remains equivocal. The present paper uses predation rate to test directly whether countershading affects detectability and the degree to which the pattern has to be tightly matched to the illumination conditions to be effective.Assessments of coat pattern in relation to positional behavior and body size in primates are consistent with the pattern functioning as camouflage (5, 16). Primate species that spend more time oriented vertically, and thus do not experience strong differential illumination between belly and back, are less intensely countershaded. The most powerful quantitative test to date used empirically derived predictions from the pattern of illumination on a model deer under different illumination conditions (1). This study found a broad correspondence between correlates of illumination and the observed coun...