Shining a light on camouflage evolution: using genetic algorithms to determine the effects of geometry and lighting on optimal camouflage

preprint OA: closed
📄 Open PDF Full text JSON View at publisher

Abstract

Visual camouflage evolves within the bounds of light’s interaction with the surroundings and the sensory limits of its observers. Rapid temporal variation in lighting from weather and its interaction with objects within the visual scene alters the contrast of the spatio-chromatic features of both backgrounds and animals, the latter through self-shading and received shadows from their surroundings. Despite the apparent effect of lighting on object appearance, the enormity of interactions and the diversity of animal phenotypic solutions present challenges to investigating the combined effects of lighting and habitat structure on camouflage effectiveness and design. Genetic algorithms and mathematical animal pattern generation provide a potential solution to investigating this high-dimensional feature space. Here, an online artificial evolution experiment was used to examine the effect of lighting and habitat geometry on camouflage. Lighting and geometry changed which prey phenotypes evolved, and the predictive power of common camouflage metrics. Crucially, lighting condition systematically altered prey-targets’ internal contrast and interacted with habitat geometry, affecting the evolved patterning, colour, and countershading. Our work demonstrates the importance of considering the relative geometry and lighting of an environment when determining the function of animal colouration and the adaptive value of camouflage.
Full text 77,337 characters · extracted from preprint-html · click to expand
Shining a light on camouflage evolution: using genetic algorithms to determine the effects of geometry and lighting on optimal camouflage | bioRxiv /* */ /* */ <!-- <!-- /*! * yepnope1.5.4 * (c) WTFPL, GPLv2 */ (function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0];var j=d.createElement(s);var dl=l!='dataLayer'?'&l='+l:'';j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;j.type='text/javascript';j.async=true;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-M677548'); Skip to main content Home About Submit ALERTS / RSS Search for this keyword Advanced Search New Results Shining a light on camouflage evolution: using genetic algorithms to determine the effects of geometry and lighting on optimal camouflage View ORCID Profile George R.A. Hancock , Innes C. Cuthill , Jolyon Troscianko doi: https://doi.org/10.1101/2025.03.01.640995 George R.A. Hancock 1 Centre for Ecology & Conservation, University of Exeter , Penryn, TR10 9FE, UK Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for George R.A. Hancock For correspondence: ghancockzoology{at}gmail.com Innes C. Cuthill 2 School of Biological Sciences, University of Bristol, Life Sciences Building , Bristol, BS8 1TQ, UK Find this author on Google Scholar Find this author on PubMed Search for this author on this site Jolyon Troscianko 1 Centre for Ecology & Conservation, University of Exeter , Penryn, TR10 9FE, UK Find this author on Google Scholar Find this author on PubMed Search for this author on this site Abstract Full Text Info/History Metrics Supplementary material Data/Code Preview PDF Abstract Visual camouflage evolves within the bounds of light’s interaction with the surroundings and the sensory limits of its observers. Rapid temporal variation in lighting from weather and its interaction with objects within the visual scene alters the contrast of the spatio-chromatic features of both backgrounds and animals, the latter through self-shading and received shadows from their surroundings. Despite the apparent effect of lighting on object appearance, the enormity of interactions and the diversity of animal phenotypic solutions present challenges to investigating the combined effects of lighting and habitat structure on camouflage effectiveness and design. Genetic algorithms and mathematical animal pattern generation provide a potential solution to investigating this high-dimensional feature space. Here, an online artificial evolution experiment was used to examine the effect of lighting and habitat geometry on camouflage. Lighting and geometry changed which prey phenotypes evolved, and the predictive power of common camouflage metrics. Crucially, lighting condition systematically altered prey-targets’ internal contrast and interacted with habitat geometry, affecting the evolved patterning, colour, and countershading. Our work demonstrates the importance of considering the relative geometry and lighting of an environment when determining the function of animal colouration and the adaptive value of camouflage. Introduction Animal camouflage has long served as an example of evolution by natural selection, as the colours and patterns used by animals reflect the characteristics of their local environment as seen by the visual systems of their observers, be they predators or prey ( Endler 1987 ; Cuthill 2019 ). Effective camouflage, however, does not simply rely on matching the colour and pattern of the local background ( Endler 1987 ; Merilaita 2003 ; Stevens and Ruxton 2019 ) ( Stevens et al. 2015 ; Troscianko et al. 2016 ). Recognition, saliency, edge disruption and shape destruction all play a role in camouflage ( Skelhorn et al. 2010 ; Webster et al. 2013 ; Webster 2015 ; Skelhorn and Rowe 2016 ; Pike 2018 ; Kelley et al. 2022 ). Background matching itself must function within the variable appearances of an animal’s background through space and time. Most animals move and so interact with – and are observed against – different surfaces and backgrounds ( Merilaita et al. 2001 ; Briolat et al. 2021 ). Meanwhile, the range, frequency and pattern of colours in natural environments shift with the seasonality of their biotic (e.g., plant phenology) and abiotic (e.g., surface moisture) components ( Endler 1984 ; Jones et al. 2018 ). Even if animals and their surrounding surfaces were somehow locked in time, their visual appearance would still vary from changes in lighting conditions caused by weather and the sun’s position ( Cuthill et al. 2016 , 2019 ). Weather in particular poses a challenge to camouflage as passing clouds and wind-swept foliage can rapidly change the lighting of scenes ( Matchette et al., 2018 , 2019 ). This instability of lighting necessitates behavioural, morphological and life history specialisations to maintain effective camouflage and conversely signalling ( Stevens and Ruxton 2019 ). In this paper, we combine artificial animal pattern generation, genetic algorithms and mass-participation online games to explore the evolution of camouflage in environments with different lighting conditions. Firstly, what should camouflage specialised to fixed or variable lighting environments look like, and how does it function? To understand these questions, we must first summarise how lighting changes the visual scene. On a cloudless day, in open habitat, the lighting of the environment is intense and directional. Surfaces facing the source of light are illuminated more intensely, while surfaces obstructed by their own or surrounding structures are in shadow. Shadows cast onto an object’s surface by itself (self-shadows) and onto surrounding surfaces (cast shadows) can provide cues to their shape and location ( Casati 2004 ; Rensink and Cavanagh 2004 ). Obstruction of light does not simply change the luminance contrast; it also changes the ratio of longwave to shortwave light, because objects in shadow are illuminated by the sky, not the sun, and Rayleigh scattering is wavelength-dependent ( Endler 1993 ; Narasimhan and Nayar 2002 ). For human trichromat vision, this results in an increase in the blue-yellow contrast of the scene ( Troscianko et al. 2004 ), with shaded regions appearing bluer compared to regions in direct sunlight ( Endler, 1993 ). Meanwhile, atmospheric conditions (e.g., cloud/fog) or the sun’s elevation (e.g., dusk/dawn) can scatter the light illuminating the scene, resulting in a diffuse lighting environment. Scenes with diffuse lighting still possess depth cues from self-shading, although they areless contrasting ( Penacchio et al., 2015 ; Cuthill et al., 2016 ), and lack salient cast shadows ( Mavrovouna et al. 2021 ; Kelley et al. 2022 ). How these changes influence the detectability of animals is poorly understood. The increased internal contrast and the presence of cast shadows under direct lighting may allow animals to be more easily distinguished from their background while increased visual complexity of the background from shadows and disruption of the animal’s shape from received shadows may instead hamper detection. The disparities between visual scenes under different atmospheric conditions are influenced by the surrounding geometry of the scene. Flat surfaces allow 3-dimensional (3D) objects to cast unobstructed shadows, providing salient cues for their depth and location within the scene ( Hancock et al. 2025 ).Within geometrically complex environments, light reflects from objects and scatters, becoming more diffuse, before reaching the scene or target object ( Endler, 1993 ). Environments with tall vegetation – relative to the observer or target – therefore have less intense lighting, but can also feature dynamic dappled lighting and shadows from the movement of leaves and branches ( Endler 1993 ; Matchette et al. 2018 ; Cuthill et al. 2019 ). This, in turn, can affect the detectability of objects ( Matchette et al. 2018 , 2019 ). Even shorter ground cover can influence the conspicuousness of cast shadows and self-shadows. Coarse surfaces, such as vegetation, distort the shape of and interfere with shadows ( Dee and Santos 2011 ; Hancock et al. 2025 ). Tall thin branches and grasses have the added effect of creating thin directional shadows on surfaces, changing the uniformity of direction of patterns within the scene (directionality/anisotropy) under direct lighting. These sharp contrasting shadows disappear under diffuse lighting, though geometry will still affect and create soft shadows from differences in depth. Thus, how lighting influences camouflage should depend on the frequency of different atmospheric conditions and the geometry of an animal’s habitat across spatial scales relative to its size. Existing research on how changes in the directionality and intensity of light from weather and geometry influence animal camouflage has largely been observational for all but a few mechanisms. Flat habitats and surfaces are thought to select for flatter postures and body plans in marine (flat-fish), terrestrial (bearded dragons) and trunk-dwelling species (leaf-tailed geckos, moths) ( Stevens and Ruxton 2019 ). Flattening reduces the conspicuousness of cast and self-shadows and other pictorial depth cues. In the inverse setting, shadows of closed 3D complex habitats are thought to select for darker and or more complex and contrasting luminance patterns based on phylogenetic and ecological comparisons of felid coat patterns ( Ortolani 1999 ; Caro 2005 ; Allen et al. 2011 ; Cheng et al. 2018 ; Marcondes et al. 2021 ). Experimentation on pattern adaptation to light environments has predominantly focused on countershading and edge-enhancement camouflage. Comparisons of the patterns of ungulates have shown that the intensities of their countershading gradients (the downward increase in luminance from their dorsal to ventral surface) are higher in species that occupy open environments at lower latitudes, where the intensity and directionality of the lighting environment are expected to be greater and more consistent ( Allen et al. 2012 ). These observations are supported by experiments showing that counter-shaded models survived for longer if they had countershading gradients optimised to their self-shading gradient ( Cuthill et al. 2016 ). While edge enhancement patterns which pictorially mimic shadows that form at the edges of objects from direct lighting ( Osorio and Srinivasan 1991 ) are harder to find under direct rather than diffuse illumination ( Egan et al. 2016 ). How shadows should influence the orientation and colour of animal patterns is less clear. Cuttlefish can adaptively adjust the size and shape of their pattern to match the geometric and pictorial properties of their surrounding and produce shadow-mimicking patterns within directly illuminated 3D scenes ( Barbosa et al. 2008 ; El Nagar et al. 2021 ). While a number of other invertebrates, fish, amphibians and reptiles can adjust their luminance, albeit at a slower rate, most terrestrial animals cannot perform rapid adaptive colouration and must make trade-offs or specialise to their environment ( Duarte et al. 2017 ). The reduced stability of blue-yellow compared to green-red in neural opponent processing under variable lighting is thought to one factor that drives the use of red colouration in animal signalling and for the detection of camouflaged predators by primates ( Lovell et al. 2005 ; Arenas et al. 2014 ; Pessoa et al. 2014 ). But does the stability of information change selection for background matching within these channels? Do long shadows from 3D complex habitats select for more contrasting and directional patterns and how might changes in light paths from local geometry affect camouflage strategies such as countershading, edge enhancement and glossiness ( Allen et al. 2011 ; Cuthill et al. 2016 ; Egan et al. 2016 ; Penacchio et al. 2018 )? How does the directionality of light interact with features of an animal’s texture that affect camouflage, e.g. glossiness ( Thomas et al. 2023 )? Moreover, how camouflage colours and patterns should be generalised to changes in background scene statistics from the weather is unknown. To simplify this host of potential phenotypic interactions with the directionality of light and habitat geometry, we have provided a table of predictions ( Table 1 ). View this table: View inline View popup Download powerpoint Table 1. A summary of the predicted effects of lighting condition, habitat 3D variation and the interaction between direct lighting and 3D variation on the appearance of animal patterns. Upwards arrows indicate a positive effect on the phenotypic feature, e.g., increased luminance or directionality, downwards arrows indicate a negative effect, and a horizontal line indicates no effect. Larger arrows indicate that increased variation increases the effect size of direct lighting, while smaller arrows indicate a reduction in effect size. For each prediction, the justification and relevant references are provided. CIE L*, a* and b* refer to the axes widely used CIELAB perceptual colour space, namely luminance (L*), red-green (a*) and yellow-blue (b*) ( CIE, 2007 ). The vast array of interactions between lighting and geometry present fundamental challenges to examining their effects on camouflage ( Fennell et al. 2019 ). The scene’s 3D geometry must be measured at multiple spatial scales and its visual appearance imaged under different weather conditions. Simultaneously, a large gamut of both intersecting and non-overlapping camouflage strategies must be compared. Here we aimed to provide a cohesive investigation of the broad effects of lighting and geometry on optimal animal camouflage colouration and patterns. We opted for a heuristic search approach, using an online citizen science game derived from the CamoEvo toolbox to disentangle camouflage optimisation within habitats of varying 3D and spatio-chromatic variability and under direct and diffuse lighting conditions ( Hancock and Troscianko 2022 ). CamoEvo combines genetic algorithms (GAs), Gray-Scott reaction-diffusion patterns (aka Turing patterns), and human visual search experiments to compare the effects of background features on camouflage optimisation ( Allen et al. 2011 ; Fennell et al. 2019 , 2021 ). CamoEvo and similar natural selection-inspired mechanisms, such as other GAs and generative adversarial networks, have proved successful in creating functional animal-like camouflage patterns against different experimental backgrounds ( Bond and Kamil 2002 ; Talas et al. 2020 ; Fennell et al. 2021 ). By using a GA to compare camouflage optimisation between lighting conditions, we can determine whether and how lighting influences the pattern shape, colours and specular reflection of targets, while also validating the circumstances where characteristics known to be influenced by lighting, e.g., countershading and edge enhancement, are under selection ( Cuthill et al. 2016 ; Egan et al. 2016 ). A full table of predictions is provided below. Methods a Visual Scenes For our backgrounds, we used a set of 28 temperate habitats photographed across the UK as part of a previous study on the effects of lighting and geometry on the patterns of visual scenes and objects ( Hancock et al. 2025 ). These backgrounds included grassland, heathland, woodland and estuarine habitats. All photographs were taken from a height of 1.2 m with an ASUS Zenfone (ZenFone AR ZS571KL, AsusTek Computer Inc., Taipei, Taiwan) and calibrated with the MICA image analysis toolbox ( Moher Alsady et al. 2016 ). For each habitat, the same 24 scenes were photographed under direct and diffuse lighting conditions. Direct lighting conditions were days with <10% cloud and no less than 2 h from sunrise or sunset. The diffuse lighting photographs of the same background were taken under a 1.5 m 3 photography tent placed over the scene (NEEWER., Bee Block Inc, 15 Cotters Lane, East Brunswick, NJ 08816, USA), simulating the isotropic lighting conditions of cloudy days ( Figure 1 ). Within each scene, a 3D-printed 30 mm diameter target painted grey with a matt 8% reflectance paint was placed at the centre. This target was used to normalise each scene using the MICA toolbox, as well as for rendering the evolved pattern. Additionally, for each lighting condition, a repeat photograph was taken with a black unpainted target soaked with acetone to give it a ‘glossy’ texture. 3D scans of the scenes were taken from the same camera position using the phone’s built-in Tango-enabled 3D scanner (Tango being Google’s 3D mapping technology) ( Hancock et al. 2023 ). All scenes were limited to having some unobstructed lighting present (e.g., dappling in woodland), though the target itself could be placed within shadow or direct light within the scene. Habitat 3D variation was measured as the standard deviation of height across the scene averaged across all 24 scenes. Backgrounds with higher 3D variation featured vegetation and other tall objects. Download figure Open in new tab Figure 1. Schematic for experimental design using a meadow habitat as a demo. (A) Prey pattern generation using CamoEvo patterns, spherical deformation and rendering. (B) Calibrated raw, gloss and rendered targets under diffuse (left) and direct (right) lighting conditions. (C) Virtual online predation experiment using 28 different habitats and 3 lighting conditions. Each treatment evolved for 20 generations with 24 targets per population. The selection of targets was based on the time taken to click on the targets. The target pattern used was a sample pattern shown from the last generation (gen = 20) of the direct lighting-only evolved condition for the chalk wildflower meadow habitat. b Pattern Creation To create our evolving targets, we used a modified version of CamoEvo’s pattern generator ( Hancock and Troscianko 2022 ). CamoEvo uses Gray-Scott reaction-diffusion generated maculations, CIELAB colours ( CIE 2007 ) and additional image filters to provide edge enhancement and countershading, creating biologically relevant patterns ( Figure 1 ) These phenotypic traits of the target patterns were all controlled by 34 decimal genes on a haploid chromosome. These genes in turn were passed to CamoEvo’s genetic algorithm to mutate, recombine and select individuals. A spherical pattern deformation function was applied to the patterns for our experiment to create realistic 3D wrapping, and two additional genes/traits were added for controlling glossiness of the maculation and glossiness the background pattern. For full details of this system, see our CamoEvo paper and the supplementary material. c Stimuli To show our evolving patterns under the lighting conditions of the scene, the patterns were rendered onto the calibrated grey target by first subtracting the target by its known reflectance and then multiplying it by the RGB values of the CamoEvo pattern. To change the target from matt to glossy, the RGB values of the glossy targets were pasted with addition (see supplementary material A). Background images with rendered patterns were then randomly cropped to create the stimuli for our online experiment. Each image was 1904 ×1488 px, and the target button had a diameter of 80 px. The target positions were never less than 2x their diameter from the centre or border of the image. These no-go zones were to prevent biases to fitness within my visual search experiment from being too close to the periphery of the observer’s vision or immediately fixated at the centre of the screen. d Online Experiment Design For our game the 28 habitats were used for three different lighting treatments: two specialist lighting treatments, where all background images were from direct (DIRECT) or diffuse (DIFFUSE) and a mixed treatment, where half of the backgrounds were under diffuse and direct lighting (MIXED). This gave a total of 84 replicates, 28 per lighting treatment. For each replicate a starting population of 24 prey targets were generated using CamoEvo ( Hancock and Troscianko 2022 ). The genes of the starting population were set with a uniform distribution from 0-1 across all individuals to prevent initial clustering of genotypes within populations. These targets were rendered onto the target button and backgrounds to create the stimuli above. An online computer-based search game was created from existing JavaScript to be played on internet browsers: https://camoevo.visual-ecology.com/ ( Troscianko et al. 2021 ). The goal being to use humans as a surrogate predator to drive selection for the artificial prey for 20 generations (0-20). Whenever a player played the game, they were randomly assigned one of the 84 populations and were tasked with finding and capturing the targets as fast as they could. Each population was shown to one participant and once it had been played it could not be played again until all other populations at the same concurrent generation had been played to prevent one population from being ahead of the others. All 24 stimuli and their respective targets were displayed in random order. At the start of the game, instructions were provided on what the game was for and what the players needed to do to play the game. As a control for starting viewpoint, participants were tasked with moving their cursor to the centre of the screen before initialising each slide or clicking in the centre for touchscreens. A ring at the centre of the screen marked where the participant needed to move their cursor to, with the instruction to not move their cursor until they had spotted the target. To capture the targets, participants needed to click on them within a time window of 15 s. The capture time was coded as the time taken to click on the target, while response time was encoded as the time taken to leave the centre circle. Fitness was encoded as the response time unless a delay of 600 ms was exceeded or the response time was faster than the stimulus display, in which case the capture time was used in place of response time, dubbed survival time, following the same protocol as used for the CamoEvo toolbox ( Hancock and Troscianko 2022 ). Response and capture time were equal for touch screen users. Using response time and a centre fixation point minimises fitness noise caused by cursor travel time (Troscianko et al., 2017b). Before any member of the target population was shown, a demo target was displayed. This demo consisted of a randomly generated pattern for the first generation (Gen) and then a deceased pattern from the previous generation for all subsequent generations. The purpose of this demo-target was to allow the participant to create an initial search image for the targets, which might otherwise make the first target harder to find and so have a disproportionately high fitness ( Troscianko et al. 2021 ). Once a population had been completed, it was removed from the server, patterns were ranked by fitness, and CamoEvo’s genetic algorithm was used to create the next generation. For each round of selection, the 12 lowest (50%) ranking members of the population died, and new hybrid offspring were created by random pairing and recombination of the survivors from the previous generations. The new population for the next generation was then uploaded to the server to be played. This process was repeated until all populations had undergone 20 generations of selection and evolution. As an additional control for noise, the top 4 highest ranking targets from the generation prior to selection were given a lifeline against deletion, again following the same method used for CamoEvo ( Hancock and Troscianko 2022 ). e Colour Analyses For each scene, the 3D scans and direct and diffuse lighting images were rescaled to the minimum number of pixels per mm of all target images and converted to human CIELAB colour space ( CIE 2007 ). For each channel (L*, a* and b*), the contrast (standard deviation) at 6 different spatial scales (spatial frequencies relative to target diameter, [1/64, 1/32, 1/16, 1/4, 1/1, 1/2, 1/1] x) and 4 different orientations [0, 45, 90, 135] were measured with Gabor filters with custom plugins for ImageJ v 1.53 ( Talas et al. 2017 ; Van Den Berg et al. 2020 ; Barnett et al. 2021 ). These measures were taken for the target pattern before rendering (target-skin), the target pattern post rendering (rendered-target), the local surround (circle radius x2.5 target radius) and the global surround (circle radius x15 target radius). The ‘directionality’ of patterns was measured for each spatial scale by dividing the orientation with the maximum contrast by the mean contrast. Likewise, the ‘verticalness’ of patterning was calculated by subtracting the contrast filtered at 90 degrees from the contrast at 0 degrees, such that negative values indicated horizontal patterns and positive values vertical patterns. For the background, we also measured the 3D variability as the standard deviation of depth for the global surround. As a measure of habitat spatial variation in luminance, green-red, blue-yellow and depth we measured the mean contrast of each channel across all spatial scales, L variation , a variation , b variation , 3D variation respectively. To measure camouflage, we used metrics previously used for computer visual search and field experiments ( Troscianko et al. 2016 , 2017 ; Price et al. 2019 ). All metrics used have been shown to be able to predict the conspicuousness of prey. Luminance match was measured as the absolute difference between the mean of the L* channel of the local background and the rendered-target (Luminance Difference ), while colour match was the Euclidean distance in the green-red (a*) and blue-yellow (b*) plane (Colour Difference ) ( Troscianko et al. 2021 ). Pattern difference was measured as the sum of absolute difference in contrast at each spatial scale for the luminance channel (Pattern Difference ) ( Troscianko et al. 2016 ). Target edge disruption was measured using GabRat of the target’s surrounding in the luminance channel, with the default sigma of 3, against its original background ( Troscianko et al. 2017 ). Novel pattern measures were also used. To measure countershading and self-shading, the linear gradient from the top to the bottom of the target was measured for the CIELAB channels. Target gradients were measured for the target-skins, averaged direct lighting raw-targets for each habitat (see supplementary material A) and the targets rendered onto the averaged raw-target of its corresponding habitat. A positive gradient indicated that the top of the target was lighter than the bottom. Target glossiness was measured by calculating the difference in luminance value (mean and Std Dev) with and without the gloss genes active for each rendered target, as well as with the maximum gloss. Maximum glossiness was measured as the luminance and pattern of the targets could also affect glossiness; darker targets appeared glossier than lighter targets. Edge enhancement was measured as the difference in luminance pattern contrast at 4 spatial frequencies [1/64, 1/32, 1/16, 1/8] between the target with and without (no edge enhancement) the edge enhancement genes active. f Statistical Analyses Statistics were performed with R, version 4.3.0 ( R Core Team 2023 ). All metrics for target phenotype, camouflage and background structure were continuous and were re-scaled to a mean=0 and Std Dev=1, lighting treatment was given as a categorical variable with three-factor levels (DIRECT, DIFFUSE and MIXED). To test the effects of lighting and habitat 3D variation (3D variation ) on our proxy for fitness (survival time) we used linear mixed models with the lme4 package ( Douglas Bates et al. 2015 ). The rescaled log survival time was given as our predictor variable with generation number (N-Gen), lighting and 3D variation as our fixed effects with the interaction between the three variables. We also compared the effect of lighting and 3D variation on the predictive power of our camouflage metrics (Luminance Difference, Colour Difference, Pattern Difference, GabRat Difference ) for fitness, using each camouflage metric, instead of N-Gen, as the fixed effect. For all analyses, the habitat and population were used as random effects to account for changes caused by lighting between populations within the same habitat and individual population effects. For example, lmm(log(SurvivalTime) ∼ CamouflageMetric * Light * 3D + (1|Habitat) + (1|Population) … where the * indicates interaction between fixed effects . To compare the effects of lighting on the evolution of phenotypes predicted to be affected by direct lighting and its interaction with geometry (pattern contrast, countershading, pattern directionality, pattern orientation, edge enhancement and glossiness) we first compiled the pattern metrics of the target-skin (contrast, directionality, verticality and gradient in the L*, a* and b* channels). These phenotype metrics were then used in a principal component analysis to account for multicollinearity between variables and whether treatment explained any of the principal components. We then used a similar model structure to the above to compare how lighting and geometry affected the evolution of principal components and our phenotype metrics. The phenotype metrics and principal components were used as the response variables, while N-Gen, lighting and 3D variation were used as the fixed effects with population and habitat as random factors. For example, lmm (PhenotypeMetric ∼ N-Gen * Light * 3D + (1|Habitat) + (1|Population) …To ensure model assumptions were met, all residuals were checked for homogeneity of variance and homoscedasticity. Square root and log transformations were used as required to meet data distribution criteria. Results For brevity, unless stated otherwise, all effects are significant at p<0.001, the conservative threshold being necessitated by the large number of tests conducted. Full model output tables are provided in supplementary material B. 1. Camouflage: Fitness, Match and Edge Disruption We received the total of 1,764 individual players necessary for the experiment over 12 months, totalling 42,336 target presentations of which only 312 were timeouts. To assess whether targets became more camouflaged, the change in survival time, i.e., our fitness proxy, with generation number was measured ( Figure 2 ). On average, fitness improved with n-generations (model not using lighting treatment or 3D complexity as predictors; N-Gen, β = 0.035, t 42250 = 40.37) with a starting median survival time of 649 (IQR = 667.5) milliseconds (ms) and an ending median of 1026 (IQR = 1130.25) ms. Of the 84 treatment populations, 65 improved, and the remaining 19 (DIRECT=4, DIFFUSE=6, MIXED=10) either did not significantly increase in fitness or decreased in fitness with n-generations. The evolved fitness was highest for the population evolved against the gravel background under mixed lighting, with a median survival time of 1321 (IQR ± 3119) ms. Populations, where n-generations lowered survival time (N=12), were excluded from subsequent analyses, barring the habitat appearance analysis below. Download figure Open in new tab Figure 2. Evolution of Camouflage. A.i) Example change in phenotype for a population that improved in fitness. B.i) Average capture time increased over successive generations. B.ii) Panes showing the log predictive value of common camouflage metrics for survival time, luminance difference (absolute CIE L*difference), colour difference (Euclidean CIE a* and b* difference), pattern match (sum CIE L* contrast difference across scales) and edge disruption (GabRat L*). Lower values indicate a greater match to the background, while higher GabRat indicates greater edge disruption. Habitat 3D variation is split by the quantiles for the habitat’s mean depth variation across spatial scales. We tested the effects of spatio-chromatic variation/complexity in the L*, a* and b* channels as well as 3D variation on the slope of fitness with n-generations to determine whether properties of the background influenced the evolution of camouflage. In doing so we found that the slope of fitness was significantly higher for populations on more variable backgrounds for all 4-background metrics (L, a, b and 3D variation, ‘*’ removed from models to avoid confusion with interaction symbology). Whether the population had a negative slope for survival time with n-generations was used as a random factor. The greatest effect size of any habitat metric for fitness and fitness with n-generations was observed for high variance in the combined L* and a* channels (La variation , β = 0.034, t 42190 = 35.10; La variation * N-Gen, β= 0.0127, t ,42330 = 13.5). The highest fitness effect of any individual background metric was from background L variance (L variation , β = 0.0273, t 42330 = 15.00; L variation * N-Gen, β= 0.0009, t 42330 = 5.767), while simultaneously having the lowest effect on fitness with n-generations. Whereas, for improvement in fitness with n-generations it was background B variance which (B variation , β = 0.0020, t 42330 = 11.35, p =0.276 | B * N-Gen, β = 0.0022, t 42330 = 14.24). Most populations that failed to significantly improve in survival time were evolved on less variable backgrounds. As direct lighting increases background luminance and blue-yellow variation, both of which increased fitness (reduced detectability), it is unsurprising that direct-lighting-only treatments evolved targets with a greater fitness then in mixed and diffuse treatments (model using lighting and 3D as factors, as described in methods; N-Gen, β = 0.050, t 36210 = 31.08; N-Gen * MIXED, β = -0.009, t 36210 = -4.17; N-Gen * DIFFUSE, β = -0.004, t 36210 = -1.90). As 3D variation correlates with spatio-chromatic variation, targets evolved to be significantly harder to find when their habitat’s 3D variation was higher (N-Gen * 3D variation , β = 0.009, t 36210 = 5.90), but had lower survival times for diffuse and mixed lighting treatments (DIFFUSE * 3D variation , β= -0.025, t 2,41 = -2.43, p= 0.020; MIXED * 3D variation , β = -0.022, t 2,41 = -2.10, p= 0.042). For populations evolved under mixed lighting, targets had lower survival times when against diffuse lighting backgrounds (Effect of background type on survival times for MIXED treatments; Diffuse Background , β = -0.014, t 12070 = -4.33) especially when habitat 3D variation was high (Diffuse Background * 3D variation , β= -0.011, t 12070 = -3.39). Luminance difference, colour difference, pattern difference and edge disruption were all significant predictors of survival time. Colour difference (β = -0.043, t 35500 = -23.53) was the best predictor of survival time across habitats, followed by edge disruption (β = 0.040, t 33860 = 19.93), pattern difference (β = -0.036, t 34420 = -18.66) and lastly luminance difference (β= - 0.036, t 35780 = -20.21). All camouflage metrics had significantly steeper slopes for 3D complex habitats. The effect size of camouflage metrics was impacted by lighting treatment. Diffuse only evolved targets had shallower slopes for luminance match (Luminance Difference * Diffuse, β = 0.007, t 35910 = 2.75, p = 0.006), colour match (Colour Difference * Diffuse, β = 0.005, t 35780 = 2.19, p= 0.028), and edge disruption (GabRat * Diffuse, β = -0.014, t 34050 = -5.17). Whereas mixed lighting populations had a shallower slope for pattern match (Pattern Difference * MIXED, β = 0.023, t 34240 = 8.58) and edge disruption (GabRat * MIXED, β = -0.009, t 31400 = -3.32, p= 0.001). For mixed lighting evolved targets, colour and pattern difference had an even lower effect on survival time when 3D complexity was high (Colour Difference * MIXED * 3D variation , β = 0.008, t 35910 = 3.12, p= 0.002; Pattern Difference * MIXED * 3D Variation , β = 0.011, t 35480 = 3.70), where the difference in colour and pattern between diffuse and direct lighting was greater. 2. Colour: Mean and Contrast (Std Dev) Following the observed decrease in absolute colour difference between targets and their background, the colour space of targets in the final populations reflected the colour space of their habitat and lighting treatment ( Figure 3 ). Notably, within 3D complex habitats, targets evolved to be, and were fitter when, darker than their local background, but less so for DIFFUSE populations (see supplementary material A). The principal component analysis of the target-skin features (Contrast, directionality and verticality in the L*, a* and b* channels) found PC1 (15.66% variance explained) to consist predominantly of pattern contrast in b*, L*, then a* greater than or equal to 1/4x the target’s spatial frequency and a decrease in verticality at those same scales, i.e., increase in horizontal contrast. PC2 (9.76% var) was predominantly colour verticality at intermediate scales, PC3 was higher green-red (a*) contrast across spatial scales (7.16% var) and PC4 was higher luminance verticality and directionality at small spatial scales (6.77% var). PC1 decreased with n-generations (N-Gen, β = -0.042, t 36210 = -4.97), with PC1 being higher for DIRECT populations (DIFFUSE * N-Gen, β = -0.201, t 36210 = - 16.63; MIXED * N-Gen, β = -0.096, t 36210 = -8.04) and both DIRECT and MIXED populations against more 3D complex habitats but not diffuse (3D * N-Gen, β = 0.026, t 36210 = 3.04, p= 0.002; MIXED * 3D * N-Gen, β = 0.015, t 36210 = 1.24, p= 0.214; DIFFUSE * 3D * N-Gen, β = - 0.072, t 36210 = -5.99). As the pattern contrast and PC1 increases were for the un-rendered targets, differences in target luminance and blue-yellow contrast observed between lighting conditions was not from the self or received shadows on the target and were entirely driven by pattern phenotype evolution. Download figure Open in new tab Figure 3. Change in colour space and colour patterns. A.i) Populations become increasingly similar to the mean colours of their local backgrounds (2.5x target radius) starting from a dispersed colour space. B.i) Example evolved targets from populations in low and high 3D variation habitats selected for under the different lighting treatments. B.ii) Hybrid violin & boxplots of PC1 for target patterns, where PC1 is predominantly large-scale luminance and colour contrast, and large horizontal (- vertical) patterns. Habitat 3D variation is split by the quantiles for the habitats’ mean depth variation across spatial scales. 3. Pattern: Gradient and Shape As suggested by the above PC1, targets evolve larger scale horizontal patterns for direct lighting populations. Countershading requires a dark-to-light dorso-ventral gradient that flattens the internal contrast from self-shading ( Rowland 2009 ). This gradient should in turn be proportional to the intensity of the raw luminance gradient from self-shading with a steeper gradient required for flatter, more open habitats where the targets have more intense self-shading gradient. Target populations in direct-lighting-only treatments evolved a more positive gradient (i.e., stronger countershading) (N-Gen, β = 0.022, t 36210 = 20.99) than those in mixed lighting (N-Gen * MIXED, β = -0.008, t 36210 = -5.36), and particularly compared to those under diffuse only lighting (N-Gen * DIFFUSE, β = -0.018, t 36210 = -12.00) when rendered onto the raw direct lighting target of the corresponding habitat ( Figure 4 ). So, direct lighting targets evolved to be more effective at countershading with mixed lighting as an intermediate. However, the gradient increase was steeper for more 3D variable habitats (3D variation * N-Gen, β = 0.011, t 36210 = 10.11; 3D variation * DIFFUSE * N-Gen, β = -0.008, t 36210 = -5.18), i.e., when the raw target’s luminance gradient was lower rather than higher ( Allen et al. 2012 ; Cuthill et al. 2016 ). This reduction of gradient corresponded with the target-skin having a positive luminance gradient and a darker colouration. Although differences in background and target luminance alone could not explain the reduced gradient for the targets within flatter habitats. Comparison of countershading when splitting the habitats by their dominant substrate (bare, gravel, leaflitter, grass and misc-vegetation) found countershading did not affect survival time for gravel habitats and had a lower effect for closed-leaflitter habitats ( Figure 4 , Table 2 ). So, lighting environment and geometry both affected and interacted to affect the adaptive value of countershading. Download figure Open in new tab Figure 4. Phenotypic change in countershading and pattern shape. A.i) Targets under direct and mixed lighting became increasingly positive in their luminance gradient. A.ii) Having a more positive render target gradient increases survival time for all substrates barring gravel when the background has direct lighting, for both mixed and direct only conditions B.i) Targets evolved under direct and mixed lighting conditions evolve a greater pattern contrast at larger spatial scales and across all scales when background 3D complexity is hgih. Red dotted line shows the targets in generation zero, dashed lines show the pattern energy of the diffuse and direct backgrounds. B.ii) Under direct lighting contrasting patterns are more directional and orient vertically against 3D complex backgrounds, arrows indicate whether the population average orientation is vertical or horizontal. Habitat 3D variation is split by the quantiles for the habitats’ mean depth variation across spatial scales. View this table: View inline View popup Table 2. Linear mixed model output effects of dominant substrate on the relationship between countershading gradient of the target-skin (CS) and substrate type on target survival time. Positive estimates and t values are shown in blue while negative values are shown in red. Model formula: Compared with diffuse lighting treatments, targets under direct and mixed lighting evolved greater pattern contrasts then diffuse at larger spatial scales, especially when 3D complexity was high, but less so for mixed populations ( Figure 4 , Table 3 ). At the scale where the maculation genes for the target patterns best predicted pattern contrast for the unrendered target (1/32), targets became more directional in their patterning for direct and mixed lighting (N-Gen, β = 0.023, t 36210 = 2.81, p=0.005; N-Gen * MIXED, β = -0.004, t 36210 = -0.30, p=0.762) but less directional for diffuse (N-Gen * DIFFUSE, β = -0.126, t 36210 = -10.46). Directionality further increased with number of generations when 3D complexity was high, but only for direct lighting populations (N-Gen * 3D, β = 0.095, t 36210 = 11.10) and otherwise declined for mixed and diffuse populations (N-Gen * 3D * MIXED, β = -0.176, t 36210 = -14.35; N-Gen * 3D * DIFFUSE, β = -0.126, t 36210 = -10.26), supporting the hypothesis that direct lighting selects for more directional patterns then diffuse lighting. Patterns also became increasingly vertical for direct (N-Gen, β = 0.043 36210 , t = 5.27) compared to mixed and diffuse (N-Gen * MIXED, β = -0.031, t 36210 = -2.58; N-Gen * DIFFUSE, β = -0.073, t 36210 = -5.94). As with directionality, this observed increase in verticality was enhanced for 3D complex habitats for direct but not diffuse or mixed lighting populations (N-Gen * 3D variation , β = 0.095, t 36210 = 11.10; N-Gen * MIXED * 3D variation , β = -0.176, t 36210 = -14.35; N-Gen * DIFFUSE * 3D variation , β = -0.126, t 36210 = -10.26). View this table: View inline View popup Download powerpoint Table 3. Linear mixed model output effects of lighting treatment and 3D complexity on the unrendered target-skin’s contrast across spatial scales. Positive estimates and t values are shown in blue while negative values are shown in red. Model formula lmm (PatternEnergy ∼ Scale*Light*3D+(1|Treatment)+(1|Habitat) +(1|UniquePhoto))… 4. Additional Features: Edge enhancement and glossiness The positive shift in luminance contrast from edge enhancement increased with n-generations (N-Gen, β = 0.043, t 36210 = 5.31) but less so for diffuse lighting targets (DIFFUSE * N-Gen, β = -0.030, t 36210 = -2.54, p = 0.011). Increased 3D complexity also resulted in increased edge enhancement (N-Gen * 3D variation , β = 0.027, t 36210 = 3.283.10, p = 0.001), though unexpectedly this observed increase was greater for mixed lighting treatments for 3D variable habitats (N-Gen * MIXED * 3D variation , β = 0.077, t 36210 = 6.59) and irrespective of the 3D environment (N-Gen * MIXED, β = 0.024, t 36210 = 2.09, p=0.037). Whether the increased selection for edge enhancement within 3D complex mixed lighting regimes was due to it functioning as a generalist strategy or 3D environments increasing the survival time under direct lighting is difficult to disentangle. The ‘potential’ glossiness (change in target luminance value when gloss genes are maximised) was negatively affected by direct lighting and the target-skin’s luminance, darker targets inherently appear glossier (See Supplementary Material). The relative glossiness of the evolved targets was significantly lower for 3D complex habitats except for those evolved under mixed lighting conditions ( Table 4 ). Targets evolved significantly less-glossy phenotypes overtime but only within 3D complex backgrounds. Notably, diffuse lighting increased selection against glossiness while mixed lighting did not select against glossiness. Some level of glossiness may help compensate for changes in target and background appearance under variable lighting conditions. Most surviving targets, however, did not appear ‘glossy’, with extreme glossiness values dying out early and high internal contrast from patterning masking the specular highlights from gloss View this table: View inline View popup Download powerpoint Table 4. Linear mixed model output effects of lighting treatment and background geometry on the evolved glossiness of the targets, relative to the maximum glossiness value they could have. Model formula lmm (RelativeGlossiness ∼ N-Gen * Light * 3D variation + (1|Treatment) + (1|Habitat))… Discussion We assessed the effects of three different lighting treatments on the evolution of artificial animal colouration. In doing so we confirmed that direct lighting on average increased rather than decreased the difficulty of target detection due to higher background complexity and in doing so facilitated faster and more reliable evolution (fewer failures to improve the fitness proxy, survival time) of camouflage. This provides the first empirical demonstration of Merilaita’s oft-cited model for the importance of background complexity in the evolution of camouflage and shows shadows to be a powerful source of complexity ( Merilaita 2003 ). In line with our predictions, there were clear differences in the colouration, contrast and orientations of evolved target patterns between lighting treatments. Specifically, selection under direct lighting leads to more contrasting, darker-bluer patterns, countershading, increased edge enhancement and more directional patterns compared to diffuse lighting environments. These phenotypic features emerged in just 20 generations, demonstrating how alternate camouflage strategies are selected for rapidly under different habitat structures and lighting regimes. The phenotypic differences between evolved populations also corresponded with differences in the predictive power of common camouflage metrics, with edge disruption being more effective against backgrounds with direct lighting. Our results highlight the critical interactions between lighting and habitat geometry as most of the relationships between lighting and camouflage were influenced by geometry. Habitat geometries that produced larger shadows in the presence of direct lighting altered the evolved target patterns, increasing pattern contrast and directionality for both mixed and direct-lighting-only treatments. The increased scale of background spatio-chromatic variation under direct lighting against more 3D complex habitats increased the survival time benefits of camouflage under direct relative to diffuse lighting. This increased disparity between the lighting conditions may have driven the observed increased overlap in phenotype between the mixed and direct-only lighting treatments within more 3D complex habitats. As targets within the mixed lighting treatments were randomly assigned to either a diffuse or direct background, habitats where one lighting condition favours survival over another will have skewed selection of traits to the lighting with the highest benefit to survival ( Penacchio et al. 2018 ; Hughes et al. 2023 ). Some components of the mixed lighting evolved targets did differ from the direct within the more 3D complex habitats. For example, pattern contrast at larger spatial scales evolved to be more intermediate between direct and diffuse. Mixed lighting targets also continued to have low levels of glossiness in later generations despite diffuse lighting and 3D complexity selecting against glossiness for the other treatments. As the luminance of glossy surfaces changes in response to both lighting and geometry, glossiness may serve as a mechanism of maintaining contrast match across different environments. The overall selection against glossiness however was unsurprising, with previous experiments, both military and ecological, showing gloss to negatively impact survival ( Thomas et al. 2023 ). Countershading has long been proposed as an adaptation for camouflage by improving background match and/or by destroying shape-from-shading cues generated by the interaction of the illuminant with geometry ( Rowland 2009 ; Penacchio et al. 2015 ). We add to the mounting body of evidence that countershading does indeed improve camouflage under direct lighting and that, although mixed lighting selected for reduced countershading, some level of shading gradient persisted, indicating that it can be robust in the face of variable lighting conditions ( Penacchio et al. 2018 ). We also found correlations between countershading and striped patterns as well as reduced internal contrast under direct lighting for darker targets irrespective of countershading. Phylogenetic comparisons of ungulate patterns also found a correlation between more intense countershading and stripes ( Allen et al. 2012 ), suggesting that these two features may interact to disrupt shape. We also found exceptions to the prediction that the gradient of countershading should perfectly counter self-shading, known as ‘optimal countershading’ ( Cuthill et al. 2016 ). Against backgrounds where the substrate contained objects that resembled the target, e.g., pebbles and stones, countershading was not selected for and in some cases the inverse evolved, despite the intensity of self-shading being higher within these habitats. The presence of objects that match geometric features of the target could negate the need for self-shadow destruction and by extension make masquerade conflict with countershading as a camouflage strategy ( Troscianko et al. 2009 ). Indeed, many of the targets observed possessed patterns or colourations that resembled one singular object, particularly stones. Patterns which instead distort the shape of the self-shadow such as inverse countershading or shadow-like maculation could provide alternative mechanisms for masking shape recognition ( Kelley et al. 2022 ). However, it is worth noting that our experiment only considers prey viewed from one orientation in plain view, whereas countershading must function against more than one detection angle and in the presence or absence of obstruction. It is possible that countershading is still beneficial when viewed from the side where the background appearance differs in visible structure. Field experiments are required to further validate the phenotypic effects found within our experiments, both for countershading and other patterning. Likewise, the effect of body shape and the shape of background distractors on selection for countershading has yest to be explored. Many animals have directional striped maculation which can be orientated to match different background features ( Kang et al. 2012 ). Animals which occupy mixed lighting conditions may need to change their orientation and position as clouds pass over, not just for thermoregulation, but to maintain orientation match to the pictorial features of their background ( Penacchio et al. 2015 ; Mavrovouna et al. 2021 ). The orientation of maculation may reflect the typical orientation of the animal relative to the light when basking or navigating its environment, in a similar way to how orientation affects countershading in arboreal animals ( Angilletta 2009 ; Kamilar and Bradley 2011 ; Mavrovouna et al. 2021 ). The increased level of pattern directionality and shifts in pattern orientation observed between our lighting treatments may have been the result of how we orientated the targets. Targets were only orientated with respect to background features for backgrounds with direct lighting. The targets were always aligned parallel to their self-shading gradient so that their countershading patterns would in turn be align with them. As a result, targets against direct backgrounds could evolve patterns parallel to the light, matching the orientation of vertical received shadows from vegetation found within 3D complex habitats. Meanwhile, for diffuse backgrounds, the target orientation was random with respect to the background patterns. Other aspects of pattern shape and orientation may have also differed if the targets were allowed to make behavioural decisions on where to position and orientate themselves based on the global and/or local statistics of the scene, e.g. moths that align with the patterns of background bark ( Kang et al. 2012 ; Stevens and Ruxton 2019 ). These behavioural decisions are likely to have large impact on camouflage phenotypes ( Kang et al., 2012 ; Stevens and Ruxton, 2019 ). Overall, our work is the most comprehensive endeavour to link animal camouflage to the physical structure and lighting regimes of habitats. We have been able to show that while there are trends for optimising phenotypes under different conditions, there are also numerous exceptions and alternative strategies that provided effective protection by camouflage. These exceptions potentially act as important drivers of evolutionary diversity, particularly when linked with predator learning and frequency-dependent effects. Several camouflage adaptations such as masquerade, disruptive colouration, countershading and even colour match were affected by geometry and lighting environment in ways that were unexpected from previous work ( Cuthill et al. 2005 , 2016 ; Skelhorn et al. 2010 ). Patterns that are more contrasting than the background and superficially disruptive can also be pattern matching to the background contrast under direct lighting, as shown by the increased pattern contrast of mixed and direct lighting only evolved patterns. Simple ecological and behavioural differences between species in how they interact with their background’s geometry under different lighting conditions can, by extension, affect the mechanisms with which they camouflage themselves. Furthermore, any alterations to habitat geometry and lighting from human activity, whether it be shifts in atmospheric condition from climate change or habitat alteration from land-management and urbanisation, could affect the adaptive value of camouflaged phenotypes and the predation risk of vulnerable species. Finally, the methods used here can also be used to explore the effects of and interactions between lighting, geometry and a wide range of alternative drivers of colour evolution, such as phylogenetic constraints, object shape, thermoregulation, signalling and observer condition (visual system and field of view) ( Stuart-Fox et al. 2008 ; Stuart-Fox and Moussalli 2009 ; Smith et al. 2016 ; Cheng et al. 2018 ; Van Den Berg et al. 2020 ). Author Contributions The initial concept for assessing the interactions between geometry and lighting environment on camouflage was conceived by JT and added to by IC and GRAH. Colour-calibrated photographs and 3D scans were collected by GRAH. The code for running the online experiment paired with the CamoEvo toolbox was created by GRAH. The original computer game scripts were derived from previous games created by JT. The manuscript was first written by GRAH, with subsequent edits by all authors. GRAH performed all image and data analyses with guidance from JT and IC. Conflict of Interest The authors declare no conflict of interest. Acknowledgements. Natural Environment Research Council (NERC) GW4+ NE/S007504/1 funded GRAH in a CASE partnership with the Game and Wildlife Conservancy Trust, UK. JT was funded by a NERC Independent Research Fellowship NE/P018084/1 and ICC by Biotechnology and Biological Research Council grant BB/S00873X/1. Footnotes https://www.dropbox.com/scl/fi/an6m29a9jjla7z6uyztvh/Light-CamoEvo_Supp.zip?rlkey=hposjp19fcytrt3emltq69raf&st=dlq6wxh8&dl=0 References ↵ Allen , W. L. , R. Baddeley , I. C. Cuthill , and N. E. Scott-Samuel . 2012 . A quantitative test of the predicted relationship between countershading and lighting environment . The American Naturalist 180 : 762 – 776 . OpenUrl CrossRef PubMed Web of Science ↵ Allen , W. L. , I. C. Cuthill , N. E. Scott-Samuel , and R. Baddeley . 2011 . Why the leopard got its spots: relating pattern development to ecology in felids . Proceedings of the Royal Society B: Biological Sciences 278 : 1373 – 1380 . OpenUrl CrossRef PubMed ↵ Angilletta , M. J . 2009 . Thermal adaptation: a theoretical and empirical synthesis . ↵ Arenas , L. M. , J. Troscianko , and M. Stevens . 2014 . Color contrast and stability as key elements for effective warning signals . Frontiers in Ecology and Evolution 2 : 25 . OpenUrl ↵ Barbosa , A. , L. Litman , and R. T. Hanlon . 2008 . Changeable cuttlefish camouflage is influenced by horizontal and vertical aspects of the visual background . Journal of Comparative Physiology A 194 : 405 – 413 . OpenUrl CrossRef PubMed Web of Science ↵ Barnett , J. B. , C. Michalis , N. E. Scott-Samuel , and I. C. Cuthill . 2021 . Colour pattern variation forms local background matching camouflage in a leaf-mimicking toad . Journal of Evolutionary Biology 34 : 1531 – 1540 . OpenUrl CrossRef PubMed ↵ Bond , A. B. , and A. C. Kamil . 2002 . Visual predators select for crypticity and polymorphism in virtual prey . Nature 415 : 609 – 613 . OpenUrl CrossRef PubMed Web of Science ↵ Briolat , E. S. , L. M. Arenas , A. E. Hughes , E. Liggins , and M. Stevens . 2021 . Generalist camouflage can be more successful than microhabitat specialisation in natural environments . BMC Ecology and Evolution 21 : 1 – 15 . OpenUrl CrossRef Buresch , K. C. , L. M. Mäthger , J. J. Allen , C. Bennice , N. Smith , J. Schram , C.-C. Chiao , et al. 2011 . The use of background matching vs. masquerade for camouflage in cuttlefish Sepia officinalis . Vision Research 51 : 2362 – 2368 . OpenUrl CrossRef PubMed Web of Science ↵ Caro , T . 2005 . The adaptive significance of coloration in mammals . BioScience 55 : 125 – 136 . OpenUrl CrossRef Web of Science ↵ Casati , R. 2004 . The shadow knows: a primer on the informational structure of cast shadows . Perception 33 : 1385 – 1396 . OpenUrl CrossRef PubMed Cavanagh , P. , and Y. G. Leclerc . 1989 . Shape from shadows . Journal of Experimental Psychology: Human Perception and Performance 15 : 3 . OpenUrl CrossRef PubMed Web of Science ↵ Cheng , W. , S. Xing , Y. Chen , R. Lin , T. C. Bonebrake , and A. Nakamura . 2018 . Dark butterflies camouflaged from predation in dark tropical forest understories . Ecological Entomology 43 : 304 – 309 . OpenUrl CrossRef ↵ CIE . 2007 . Colorimetry-part 4: CIE 1976 L* a* b* colour space . International Standard 2019 – 06 . ↵ Cuthill , I. C . 2019 . Camouflage . Journal of Zoology 308 : 75 – 92 . OpenUrl CrossRef ↵ Cuthill , I. C. , S. R. Matchette , and N. E. Scott-Samuel . 2019 . Camouflage in a dynamic world . Visual perception 30 : 109 – 115 . OpenUrl ↵ Cuthill , I. C. , N. S. Sanghera , O. Penacchio , P. G. Lovell , G. D. Ruxton , and J. M. Harris . 2016 . Optimizing countershading camouflage . Proceedings of the National Academy of Sciences 113 : 13093 – 13097 . OpenUrl Abstract / FREE Full Text ↵ Cuthill , I. C. , M. Stevens , J. Sheppard , T. Maddocks , C. A. Párraga , and T. S. Troscianko . 2005 . Disruptive coloration and background pattern matching . Nature 434 : 72 – 74 . OpenUrl CrossRef PubMed Web of Science ↵ Dee , H. M. , and P. E. Santos . 2011 . The perception and content of cast shadows: An interdisciplinary review . Spatial Cognition & Computation 11 : 226 – 253 . OpenUrl CrossRef ↵ Douglas Bates , M. , B. Bolker , and S. Walker . 2015 . Fitting linear mixed-effects models using lme4 . Journal of Statistical Software 67 : 1 – 48 . OpenUrl ↵ Duarte , R. C. , A. A. Flores , and M. Stevens . 2017 . Camouflage through colour change: mechanisms, adaptive value and ecological significance . Philosophical Transactions of the Royal Society B: Biological Sciences 372 : 20160342 . OpenUrl CrossRef PubMed ↵ Egan , J. , R. J. Sharman , K. C. Scott-Brown , and P. G. Lovell . 2016 . Edge enhancement improves disruptive camouflage by emphasising false edges and creating pictorial relief . Scientific reports 6 : 1 – 9 . OpenUrl CrossRef PubMed ↵ El Nagar , A. , D. Osorio , S. Zylinski , and S. M. Sait . 2021 . Visual perception and camouflage response to 3D backgrounds and cast shadows in the European cuttlefish, Sepia officinalis . Journal of Experimental Biology 224 : jeb238717 . OpenUrl CrossRef PubMed ↵ Endler , J. 1987 . Effects of ambient light spectra and predator vision on crypsis . ↵ Endler , J. A . 1984 . Progressive background in moths, and a quantitative measure of crypsis . Biological Journal of the Linnean Society 22 : 187 – 231 . OpenUrl CrossRef Web of Science ↵ Endler , J. A . 1993 . The color of light in forests and its implications . Ecological monographs 63 : 1 – 27 . OpenUrl CrossRef Web of Science ↵ Fennell , J. G. , L. Talas , R. J. Baddeley , I. C. Cuthill , and N. E. Scott-Samuel . 2019 . Optimizing colour for camouflage and visibility using deep learning: the effects of the environment and the observer’s visual system . Journal of the Royal Society Interface 16 : 20190183 . OpenUrl CrossRef PubMed ↵ Fennell , J. G. , L. Talas , R. J. Baddeley , I. C. Cuthill , and N. E. Scott-Samuel . 2021 . The Camouflage Machine: Optimizing protective coloration using deep learning with genetic algorithms . Evolution 75 : 614 – 624 . OpenUrl CrossRef PubMed ↵ Hancock , G. R. A. , and J. Troscianko . 2022 . CamoEvo: An open access toolbox for artificial camouflage evolution experiments . Evolution 76 : 870 – 882 . OpenUrl CrossRef PubMed ↵ Hancock , G. R. , I. C. Cuthill , and J. Troscianko . 2025 . The effects of habitat structure and lighting on object and background appearance . bioRxiv 2025.02.19.639053 . ↵ Hancock , G. R. , L. Grayshon , R. Burrell , I. Cuthill , A. Hoodless , and J. Troscianko . 2023 . Habitat geometry rather than visual acuity limits the visibility of a ground-nesting bird’s clutch to terrestrial predators . Ecology and Evolution 13 : e10471 . OpenUrl CrossRef ↵ Hughes , A. , E. S. Briolat , L. M. Arenas , E. Liggins , and M. Stevens . 2023 . Varying benefits of generalist and specialist camouflage in two versus four background environments . Behavioral Ecology 34 : 426 – 436 . OpenUrl CrossRef PubMed ↵ Jones , M. R. , L. S. Mills , P. C. Alves , C. M. Callahan , J. M. Alves , D. J. Lafferty , F. M. Jiggins , et al. 2018 . Adaptive introgression underlies polymorphic seasonal camouflage in snowshoe hares . Science 360 : 1355 – 1358 . OpenUrl Abstract / FREE Full Text ↵ Kamilar , J. M. , and B. J. Bradley . 2011 . Countershading is related to positional behavior in primates . Journal of Zoology 283 : 227 – 233 . OpenUrl CrossRef ↵ Kang , C.-K. , J.-Y. Moon , S.-I. Lee , and P. G. Jablonski . 2012 . Camouflage through an active choice of a resting spot and body orientation in moths . Journal of evolutionary biology 25 : 1695 – 1702 . OpenUrl CrossRef PubMed ↵ Kelley , J. L. , L. A. Kelley , and D. R. Badcock . 2022 . 3D animal camouflage . Trends in Ecology & Evolution 37 : 628 – 631 . OpenUrl CrossRef PubMed ↵ Lovell , P. G. , D. J. Tolhurst , C. A. Párraga , R. Baddeley , U. Leonards , J. Troscianko , and T. Troscianko . 2005 . Stability of the color-opponent signals under changes of illuminant in natural scenes . JOSA A 22 : 2060 – 2071 . OpenUrl CrossRef PubMed ↵ Marcondes , R. S. , J. A. Nations , G. F. Seeholzer , and R. T. Brumfield . 2021 . Rethinking Gloger’s rule: climate, light environments, and color in a large family of tropical birds (Furnariidae) . The American Naturalist 197 : 592 – 606 . OpenUrl CrossRef PubMed ↵ Matchette , S. R. , I. C. Cuthill , and N. E. Scott-Samuel . 2018 . Concealment in a dynamic world: dappled light and caustics mask movement . Animal Behaviour 143 : 51 – 57 . OpenUrl CrossRef ↵ Matchette , S. R. , I. C. Cuthill , and N. E. Scott-Samuel . 2019 . Dappled light disrupts prey detection by masking movement . Animal Behaviour 155 : 89 – 95 . OpenUrl CrossRef ↵ Mavrovouna , V. , O. Penacchio , and W. L. Allen . 2021 . Orienting to the sun improves camouflage for bilaterally symmetrical prey . Biological Journal of the Linnean Society 134 : 803 – 808 . OpenUrl CrossRef ↵ Merilaita , S . 2003 . Visual background complexity facilitates the evolution of camouflage . Evolution 57 : 1248 – 1254 . OpenUrl CrossRef PubMed Web of Science ↵ Merilaita , S. , A. Lyytinen , and J. Mappes . 2001 . Selection for cryptic coloration in a visually heterogeneous habitat . Proceedings of the Royal Society of London. Series B: Biological Sciences 268 : 1925 – 1929 . OpenUrl CrossRef PubMed Web of Science ↵ Moher Alsady , T. , E. M. Blessing , and F. Beissner . 2016 . MICA—A toolbox for masked independent component analysis of fMRI data . Wiley Online Library . ↵ Narasimhan , S. G. , and S. K. Nayar . 2002 . Vision and the atmosphere . International journal of computer vision 48 : 233 . OpenUrl CrossRef ↵ Ortolani , A . 1999 . Spots, stripes, tail tips and dark eyes: predicting the function of carnivore colour patterns using the comparative method . Biological Journal of the Linnean Society 67 : 433 – 476 . OpenUrl CrossRef Web of Science ↵ Osorio , D. , and M. V. Srinivasan . 1991 . Camouflage by edge enhancement in animal coloration patterns and its implications for visual mechanisms . Proceedings of the Royal Society of London. Series B: Biological Sciences 244 : 81 – 85 . OpenUrl CrossRef PubMed ↵ Penacchio , O. , P. G. Lovell , I. C. Cuthill , G. D. Ruxton , and J. M. Harris . 2015 . Three-dimensional camouflage: exploiting photons to conceal form . The American Naturalist 186 : 553 – 563 . OpenUrl CrossRef PubMed ↵ Penacchio , O. , P. G. Lovell , and J. M. Harris . 2018 . Is countershading camouflage robust to lighting change due to weather? Royal Society Open Science 5 : 170801 . OpenUrl CrossRef PubMed ↵ Pessoa , D. M. A. , R. Maia , R. C. de Albuquerque Ajuz , P. Z. P. M. R. De Moraes , M. H. C. Spyrides , and V. F. Pessoa . 2014 . The adaptive value of primate color vision for predator detection . American journal of primatology 76 : 721 – 729 . OpenUrl CrossRef PubMed ↵ Pike , T. W . 2018 . Quantifying camouflage and conspicuousness using visual salience . Methods in Ecology and Evolution 9 : 1883 – 1895 . OpenUrl CrossRef ↵ Price , N. , S. Green , J. Troscianko , T. Tregenza , and M. Stevens . 2019 . Background matching and disruptive coloration as habitat-specific strategies for camouflage . Scientific reports 9 : 7840 . OpenUrl CrossRef PubMed ↵ R Core Team . 2023 . R: A language and environment for statistical computing . R Foundation for Statistical Computing , Vienna, Austria , 4.3.0. ↵ Rensink , R. A. , and P. Cavanagh . 2004 . The influence of cast shadows on visual search . Perception 33 : 1339 – 1358 . OpenUrl CrossRef PubMed ↵ Rowland , H. M . 2009 . From Abbott Thayer to the present day: what have we learned about the function of countershading? Philosophical Transactions of the Royal Society B: Biological Sciences 364 : 519 – 527 . OpenUrl CrossRef PubMed ↵ Skelhorn , J. , and C. Rowe . 2016 . Cognition and the evolution of camouflage . Proceedings of the Royal Society B: Biological Sciences 283 : 20152890 . OpenUrl CrossRef PubMed ↵ Skelhorn , J. , H. M. Rowland , M. P. Speed , and G. D. Ruxton . 2010 . Masquerade: camouflage without crypsis . Science 327 : 51 – 51 . OpenUrl Abstract / FREE Full Text ↵ Smith , K. R. , V. Cadena , J. A. Endler , M. R. Kearney , W. P. Porter , and D. Stuart-Fox . 2016 . Color change for thermoregulation versus camouflage in free-ranging lizards . The American Naturalist 188 : 668 – 678 . OpenUrl CrossRef PubMed ↵ Stevens , M. , A. C. Broderick , B. J. Godley , A. E. Lown , J. Troscianko , N. Weber , and S. B. Weber . 2015 . Phenotype–environment matching in sand fleas . Biology Letters 11 : 20150494 . OpenUrl CrossRef PubMed ↵ Stevens , M. , and G. D. Ruxton . 2019 . The key role of behaviour in animal camouflage . Biological Reviews 94 : 116 – 134 . OpenUrl CrossRef PubMed ↵ Stuart-Fox , D. , and A. Moussalli . 2009 . Camouflage, communication and thermoregulation: lessons from colour changing organisms . Philosophical Transactions of the Royal Society B: Biological Sciences 364 : 463 – 470 . OpenUrl CrossRef PubMed ↵ Stuart-Fox , D. , A. Moussalli , and M. J. Whiting . 2008 . Predator-specific camouflage in chameleons . Biology letters 4 : 326 – 329 . OpenUrl CrossRef PubMed ↵ Talas , L. , R. J. Baddeley , and I. C. Cuthill . 2017 . Cultural evolution of military camouflage . Philosophical Transactions of the Royal Society B: Biological Sciences 372 : 20160351 . OpenUrl CrossRef PubMed ↵ Talas , L. , J. G. Fennell , K. Kjernsmo , I. C. Cuthill , N. E. Scott-Samuel , and R. J. Baddeley . 2020 . CamoGAN: evolving optimum camouflage with Generative Adversarial Networks . Methods Ecol. Evol 11 : 240 – 247 . OpenUrl CrossRef ↵ Thomas , D. H. , K. Kjernsmo , N. E. Scott-Samuel , H. M. Whitney , and I. C. Cuthill . 2023 . Interactions between color and gloss in iridescent camouflage . Behavioral Ecology arad 050 . ↵ Troscianko , J. , O. Nokelainen , J. Skelhorn , and M. Stevens . 2021 . Variable crab camouflage patterns defeat search image formation . Communications biology 4 : 287 . OpenUrl CrossRef PubMed ↵ Troscianko , J. , J. Skelhorn , and M. Stevens . 2017 . Quantifying camouflage: how to predict detectability from appearance . BMC evolutionary biology 17 : 1 – 13 . OpenUrl CrossRef PubMed ↵ Troscianko , J. , J. Wilson-Aggarwal , M. Stevens , and C. N. Spottiswoode . 2016 . Camouflage predicts survival in ground-nesting birds . Scientific Reports 6 : 19966 . OpenUrl CrossRef PubMed ↵ Troscianko , T. , C. P. Benton , P. G. Lovell , D. J. Tolhurst , and Z. Pizlo . 2009 . Camouflage and visual perception . Philosophical Transactions of the Royal Society B: Biological Sciences 364 : 449 – 461 . OpenUrl CrossRef PubMed ↵ Troscianko , T. , C. A. Parraga , P. G. Lovell , D. J. Tolhurst , R. J. Baddeley , and U. Leonards . 2004 . Natural illumination, shadows and primate colour vision . Perception 33 : 45 – 45 . OpenUrl ↵ Van Den Berg , C. P. , J. Troscianko , J. A. Endler , N. J. Marshall , and K. L. Cheney . 2020 . Quantitative Colour Pattern Analysis (QCPA): A comprehensive framework for the analysis of colour patterns in nature . Methods in Ecology and Evolution 11 : 316 – 332 . OpenUrl CrossRef ↵ Webster , R. J . 2015 . Does disruptive camouflage conceal edges and features? Current Zoology 61 : 708 – 717 . OpenUrl CrossRef ↵ Webster , R. J. , C. Hassall , C. M. Herdman , J.-G. J. Godin , and T. N. Sherratt . 2013 . Disruptive camouflage impairs object recognition . Biology Letters 9 : 20130501 . OpenUrl CrossRef PubMed View the discussion thread. Back to top Previous Next Posted March 06, 2025. Download PDF Supplementary Material Data/Code Email Thank you for your interest in spreading the word about bioRxiv. NOTE: Your email address is requested solely to identify you as the sender of this article. Your Email * Your Name * Send To * Enter multiple addresses on separate lines or separate them with commas. You are going to email the following Shining a light on camouflage evolution: using genetic algorithms to determine the effects of geometry and lighting on optimal camouflage Message Subject (Your Name) has forwarded a page to you from bioRxiv Message Body (Your Name) thought you would like to see this page from the bioRxiv website. Your Personal Message CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions. Share Shining a light on camouflage evolution: using genetic algorithms to determine the effects of geometry and lighting on optimal camouflage George R.A. Hancock , Innes C. Cuthill , Jolyon Troscianko bioRxiv 2025.03.01.640995; doi: https://doi.org/10.1101/2025.03.01.640995 Share This Article: Copy Citation Tools Shining a light on camouflage evolution: using genetic algorithms to determine the effects of geometry and lighting on optimal camouflage George R.A. Hancock , Innes C. Cuthill , Jolyon Troscianko bioRxiv 2025.03.01.640995; doi: https://doi.org/10.1101/2025.03.01.640995 Citation Manager Formats BibTeX Bookends EasyBib EndNote (tagged) EndNote 8 (xml) Medlars Mendeley Papers RefWorks Tagged Ref Manager RIS Zotero Tweet Widget Facebook Like Google Plus One Subject Area Ecology Subject Areas All Articles Animal Behavior and Cognition (7642) Biochemistry (17715) Bioengineering (13907) Bioinformatics (42003) Biophysics (21470) Cancer Biology (18624) Cell Biology (25533) Clinical Trials (138) Developmental Biology (13390) Ecology (19935) Epidemiology (2067) Evolutionary Biology (24356) Genetics (15617) Genomics (22529) Immunology (17753) Microbiology (40432) Molecular Biology (17200) Neuroscience (88681) Paleontology (667) Pathology (2840) Pharmacology and Toxicology (4828) Physiology (7653) Plant Biology (15161) Scientific Communication and Education (2046) Synthetic Biology (4304) Systems Biology (9826) Zoology (2271)

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00