Patent ID: 12198267

DESCRIPTION OF IMPLEMENTATIONS

Techniques for generating shadows are often inaccurate and computationally expensive. For example, one technique includes generating a three-dimensional (3D) mesh indicating a depth value, and tracing a light ray against the 3D mesh in order to determine a shadow based on the depth value. However, determining the shadow based on the 3D mesh is computationally expensive. For example, it is computationally expensive to test shadow rays against potentially thousands or millions of triangles in the 3D mesh. As another example, one technique includes arbitrarily sampling across a plurality of directions, and tracing a light ray across the plurality of directions in order to determine a shadow. Accordingly, determining the shadow based on the particular light ray includes a relatively large number of calculations, resulting in a high level of processor utilization.

By contrast, various implementations include methods, systems, and electronic devices that generate a shadow for a computer-generated object based on a depth value and a spherical Gaussian (SG) lobe. The SG lobe characterizes ambient light from a physical environment, such as light generated by a physical desk lamp or by the Sun. As used herein, “ambient light” may refer to light produced by direct or indirect light sources. The SG indicates a directional characteristic associated with the ambient light. In some implementations, a method includes determining the SG lobe based on a 360 degree image of the physical environment. For example, a neural network receives the 360 degree image and outputs a corresponding SG lobe. The method includes determining a plurality of sampling rays based on the directional characteristic. For example, each of the plurality of sampling rays is substantially parallel to the SG lobe. In some implementations, the method includes obtaining a plurality of SG lobes, and determines a plurality of sampling rays for each of the plurality of SG lobes. For example, in some implementations, ambient light from a physical environment includes light from multiple physical light sources (e.g., a street lamp, the Sun, etc.), and each of the multiple physical light sources is characterized by one or more SG lobes. Moreover, the method includes obtaining a depth value that is associated with a computer-generated object. To that end, in some implementations, the method includes generating the depth value during rendering the computer-generated object, and storing the depth value in a depth buffer for subsequent retrieval. For example, a rendering system, which may be integrated in a graphics processing unit (GPU), renders the computer-generated object. Thus, in contrast to other techniques, the method foregoes generating a 3D mesh of the environment, instead utilizing the depth value that is determined during rendering of the computer-generated object, thereby reducing resource utilization. Based on the depth value and at least one of the plurality of sampling rays, the method includes generating a shadow that is associated with the computer-generated object. In some implementations, generating the shadow includes tracing a sampling ray against the depth value. Accordingly, in contrast to other techniques that include tracing light rays in arbitrary directions, the method includes tracing the sampling ray based on a directional characteristic associated with the ambient light. Accordingly, the method includes generating a more accurate shadow for a computer-generated object, while using less system resources.

DESCRIPTION

Reference will now be made in detail to implementations, examples of which are illustrated in the accompanying drawings. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the various described implementations. However, it will be apparent to one of ordinary skill in the art that the various described implementations may be practiced without these specific details. In other instances, well-known methods, procedures, components, circuits, and networks have not been described in detail so as not to unnecessarily obscure aspects of the implementations.

It will also be understood that, although the terms first, second, etc. are, in some instances, used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first contact could be termed a second contact, and, similarly, a second contact could be termed a first contact, without departing from the scope of the various described implementations. The first contact and the second contact are both contacts, but they are not the same contact, unless the context clearly indicates otherwise.

The terminology used in the description of the various described implementations herein is for the purpose of describing particular implementations only and is not intended to be limiting. As used in the description of the various described implementations and the appended claims, the singular forms “a”, “an,” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term “and/or” as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. It will be further understood that the terms “includes,” “including”, “comprises”, and/or “comprising”, when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.

As used herein, the term “if” is, optionally, construed to mean “when” or “upon” or “in response to determining” or “in response to detecting”, depending on the context. Similarly, the phrase “if it is determined” or “if [a stated condition or event] is detected” is, optionally, construed to mean “upon determining” or “in response to determining” or “upon detecting [the stated condition or event]” or “in response to detecting [the stated condition or event]”, depending on the context.

A physical environment refers to a physical world that people can sense and/or interact with without aid of electronic devices. The physical environment may include physical features such as a physical surface or a physical object. For example, the physical environment corresponds to a physical park that includes physical trees, physical buildings, and physical people. People can directly sense and/or interact with the physical environment such as through sight, touch, hearing, taste, and smell. In contrast, an extended reality (XR) environment refers to a wholly or partially simulated environment that people sense and/or interact with via an electronic device. For example, the XR environment may include augmented reality (AR) content, mixed reality (MR) content, virtual reality (VR) content, and/or the like. With an XR system, a subset of a person's physical motions, or representations thereof, are tracked, and, in response, one or more characteristics of one or more virtual objects simulated in the XR environment are adjusted in a manner that comports with at least one law of physics. As one example, the XR system may detect head movement and, in response, adjust graphical content and an acoustic field presented to the person in a manner similar to how such views and sounds would change in a physical environment. As another example, the XR system may detect movement of the electronic device presenting the XR environment (e.g., a mobile phone, a tablet, a laptop, or the like) and, in response, adjust graphical content and an acoustic field presented to the person in a manner similar to how such views and sounds would change in a physical environment. In some situations (e.g., for accessibility reasons), the XR system may adjust characteristic(s) of graphical content in the XR environment in response to representations of physical motions (e.g., vocal commands).

There are many different types of electronic systems that enable a person to sense and/or interact with various XR environments. Examples include head mountable systems, projection-based systems, heads-up displays (HUDs), vehicle windshields having integrated display capability, windows having integrated display capability, displays formed as lenses designed to be placed on a person's eyes (e.g., similar to contact lenses), headphones/earphones, speaker arrays, input systems (e.g., wearable or handheld controllers with or without haptic feedback), smartphones, tablets, and desktop/laptop computers. A head mountable system may have one or more speaker(s) and an integrated opaque display. Alternatively, a head mountable system may be configured to accept an external opaque display (e.g., a smartphone). The head mountable system may incorporate one or more imaging sensors to capture images or video of the physical environment, and/or one or more microphones to capture audio of the physical environment. Rather than an opaque display, a head mountable system may have a transparent or translucent display. The transparent or translucent display may have a medium through which light representative of images is directed to a person's eyes. The display may utilize digital light projection, OLEDs, LEDs, uLEDs, liquid crystal on silicon, laser scanning light source, or any combination of these technologies. The medium may be an optical waveguide, a hologram medium, an optical combiner, an optical reflector, or any combination thereof. In some implementations, the transparent or translucent display may be configured to become opaque selectively. Projection-based systems may employ retinal projection technology that projects graphical images onto a person's retina. Projection systems also may be configured to project virtual objects into the physical environment, for example, as a hologram or on a physical surface.

FIG.1is a block diagram of an example of a portable multifunction device100(sometimes also referred to herein as the “electronic device100” for the sake of brevity) in accordance with some implementations. The electronic device100includes memory102(e.g., one or more non-transitory computer readable storage mediums), a memory controller122, one or more processing units (CPUs)120, a peripherals interface118, an input/output (I/O) subsystem106, a display system112, an inertial measurement unit (IMU)130, image sensor(s)143(e.g., camera), contact intensity sensor(s)165, audio sensor(s)113(e.g., microphone), eye tracking sensor(s)164(e.g., included within a head-mountable device (HMD)), an extremity tracking sensor150, and other input or control device(s)116. In some implementations, the electronic device100corresponds to one of a mobile phone, tablet, laptop, wearable computing device, head-mountable device (HMD), head-mountable enclosure (e.g., the electronic device100slides into or otherwise attaches to a head-mountable enclosure), or the like. In some implementations, the head-mountable enclosure is shaped to form a receptacle for receiving the electronic device100with a display.

In some implementations, the peripherals interface118, the one or more processing units120, and the memory controller122are, optionally, implemented on a single chip, such as a chip103. In some other implementations, they are, optionally, implemented on separate chips.

The I/O subsystem106couples input/output peripherals on the electronic device100, such as the display system112and the other input or control devices116, with the peripherals interface118. The I/O subsystem106optionally includes a display controller156, an image sensor controller158, an intensity sensor controller159, an audio controller157, an eye tracking controller160, one or more input controllers152for other input or control devices, an IMU controller132, an extremity tracking controller180, and a privacy subsystem170. The one or more input controllers152receive/send electrical signals from/to the other input or control devices116. The other input or control devices116optionally include physical buttons (e.g., push buttons, rocker buttons, etc.), dials, slider switches, joysticks, click wheels, and so forth. In some alternate implementations, the one or more input controllers152are, optionally, coupled with any (or none) of the following: a keyboard, infrared port, Universal Serial Bus (USB) port, stylus, finger-wearable device, and/or a pointer device such as a mouse. The one or more buttons optionally include a push button. In some implementations, the other input or control devices116includes a positional system (e.g., GPS) that obtains information concerning the location and/or orientation of the electronic device100relative to a particular object. In some implementations, the other input or control devices116include a depth sensor and/or a time-of-flight sensor that obtains depth information characterizing a physical object within a physical environment. In some implementations, the other input or control devices116include an ambient light sensor that senses ambient light from a physical environment and outputs corresponding ambient light data.

The display system112provides an input interface and an output interface between the electronic device100and a user. The display controller156receives and/or sends electrical signals from/to the display system112. The display system112displays visual output to the user. The visual output optionally includes graphics, text, icons, video, and any combination thereof (sometimes referred to herein as “computer-generated content”). In some implementations, some or all of the visual output corresponds to user interface objects. As used herein, the term “affordance” refers to a user-interactive graphical user interface object (e.g., a graphical user interface object that is configured to respond to inputs directed toward the graphical user interface object). Examples of user-interactive graphical user interface objects include, without limitation, a button, slider, icon, selectable menu item, switch, hyperlink, or other user interface control.

The display system112may have a touch-sensitive surface, sensor, or set of sensors that accepts input from the user based on haptic and/or tactile contact. The display system112and the display controller156(along with any associated modules and/or sets of instructions in the memory102) detect contact (and any movement or breaking of the contact) on the display system112and converts the detected contact into interaction with user-interface objects (e.g., one or more soft keys, icons, web pages or images) that are displayed on the display system112. In an example implementation, a point of contact between the display system112and the user corresponds to a finger of the user or a finger-wearable device.

The display system112optionally uses LCD (liquid crystal display) technology, LPD (light emitting polymer display) technology, or LED (light emitting diode) technology, although other display technologies are used in other implementations. The display system112and the display controller156optionally detect contact and any movement or breaking thereof using any of a plurality of touch sensing technologies now known or later developed, including but not limited to capacitive, resistive, infrared, and surface acoustic wave technologies, as well as other proximity sensor arrays or other elements for determining one or more points of contact with the display system112.

The user optionally makes contact with the display system112using any suitable object or appendage, such as a stylus, a finger-wearable device, a finger, and so forth. In some implementations, the user interface is designed to work with finger-based contacts and gestures, which can be less precise than stylus-based input due to the larger area of contact of a finger on the touch screen. In some implementations, the electronic device100translates the rough finger-based input into a precise pointer/cursor position or command for performing the actions desired by the user.

Audio circuitry also receives electrical signals converted by the audio sensors113(e.g., a microphone) from sound waves. Audio circuitry converts the electrical signal to audio data and transmits the audio data to the peripherals interface118for processing. Audio data is, optionally, retrieved from and/or transmitted to the memory102and/or RF circuitry by the peripherals interface118. In some implementations, audio circuitry also includes a headset jack. The headset jack provides an interface between audio circuitry and removable audio input/output peripherals, such as output-only headphones or a headset with both output (e.g., a headphone for one or both ears) and input (e.g., a microphone).

The inertial measurement unit (IMU)130includes accelerometers, gyroscopes, and/or magnetometers in order measure various forces, angular rates, and/or magnetic field information with respect to the electronic device100. Accordingly, according to various implementations, the IMU130detects one or more positional change inputs of the electronic device100, such as the electronic device100being shaken, rotated, moved in a particular direction, and/or the like.

The image sensor(s)143capture still images and/or video. In some implementations, an image sensor143is located on the back of the electronic device100, opposite a touch screen on the front of the electronic device100, so that the touch screen is enabled for use as a viewfinder for still and/or video image acquisition. In some implementations, another image sensor143is located on the front of the electronic device100so that the user's image is obtained (e.g., for selfies, for videoconferencing while the user views the other video conference participants on the touch screen, etc.). In some implementations, the image sensor(s) are integrated within an HMD. For example, the image sensor(s)143output image data that represents a physical object (e.g., a physical agent) within a physical environment.

The contact intensity sensors165detect intensity of contacts on the electronic device100(e.g., a touch input on a touch-sensitive surface of the electronic device100). The contact intensity sensors165are coupled with the intensity sensor controller159in the I/O subsystem106. The contact intensity sensor(s)165optionally include one or more piezoresistive strain gauges, capacitive force sensors, electric force sensors, piezoelectric force sensors, optical force sensors, capacitive touch-sensitive surfaces, or other intensity sensors (e.g., sensors used to measure the force (or pressure) of a contact on a touch-sensitive surface). The contact intensity sensor(s)165receive contact intensity information (e.g., pressure information or a proxy for pressure information) from the physical environment. In some implementations, at least one contact intensity sensor165is collocated with, or proximate to, a touch-sensitive surface of the electronic device100. In some implementations, at least one contact intensity sensor165is located on the side of the electronic device100.

The eye tracking sensor(s)164detect an eye gaze of a user of the electronic device100and generate eye tracking data indicative of a gaze position of the user. In various implementations, the eye tracking data includes data indicative of a fixation point (e.g., point of regard) of the user on a display panel, such as a display panel within a head-mountable device (HMD), a head-mountable enclosure, or within a heads-up display.

The extremity tracking sensor150obtains extremity tracking data indicative of a position of an extremity of a user. For example, in some implementations, the extremity tracking sensor150corresponds to a hand tracking sensor that obtains hand tracking data indicative of a position of a hand or a finger of a user within a particular object. In some implementations, the extremity tracking sensor150utilizes computer vision techniques to estimate the pose of the extremity based on camera images.

In various implementations, the electronic device100includes a privacy subsystem170that includes one or more privacy setting filters associated with user information, such as user information included in extremity tracking data, eye gaze data, and/or body position data associated with a user. In some implementations, the privacy subsystem170selectively prevents and/or limits the electronic device100or portions thereof from obtaining and/or transmitting the user information. To this end, the privacy subsystem170receives user preferences and/or selections from the user in response to prompting the user for the same. In some implementations, the privacy subsystem170prevents the electronic device100from obtaining and/or transmitting the user information unless and until the privacy subsystem170obtains informed consent from the user. In some implementations, the privacy subsystem170anonymizes (e.g., scrambles or obscures) certain types of user information. For example, the privacy subsystem170receives user inputs designating which types of user information the privacy subsystem170anonymizes. As another example, the privacy subsystem170anonymizes certain types of user information likely to include sensitive and/or identifying information, independent of user designation (e.g., automatically).

FIGS.2A-2Iare an example of generating shadows based on respective depth values and an SG lobe in accordance with some implementations. As illustrated inFIG.2A, a physical environment200includes a first wall202, a second wall204, a physical lamp230, and a user50holding an electronic device210. The physical lamp230emits ambient light232within the physical environment200. The electronic device210includes a display212that is associated with a viewable region214of the physical environment200. The viewable region214includes a portion of the first wall202and a portion of the second wall204.

In some implementations, the electronic device210corresponds to a head-mountable device (HMD) that includes an integrated display (e.g., a built-in display) that displays a representation of the physical environment200. For example, the electronic device210displays, on the display212, a computer-generated object that is overlaid on a portion of the physical environment200. To that end, in some implementations, the electronic device210displays an XR environment. In some implementations, the electronic device210includes a head-mountable enclosure. In various implementations, the head-mountable enclosure includes an attachment region to which another device with a display can be attached. In various implementations, the head-mountable enclosure is shaped to form a receptacle for receiving another device that includes a display (e.g., the electronic device210). For example, in some implementations, the electronic device210slides/snaps into or otherwise attaches to the head-mountable enclosure. In some implementations, the display of the device attached to the head-mountable enclosure presents (e.g., displays) the representation of the physical environment200. For example, in some implementations, the electronic device210corresponds to a mobile phone that can be attached to the head-mountable enclosure.

In some implementations, the electronic device210includes an image sensor, such as a scene camera. For example, with references toFIGS.2B and2C, the electronic device210includes an image sensor233. The image sensor233senses (e.g., captures) the ambient light232from the physical environment200, and outputs image data234of the physical environment200. The image data234may correspond to an image or a sequence of images (e.g., a video stream). According to various implementations, the electronic device210composites, via a compositing system219, the image data234with various object renders in order to generate display data to be displayed on the display212.

In some implementations, the electronic device210includes a see-through display. The see-through display permits ambient light from the physical environment200through the see-through display, and the representation of the physical environment is a function of the ambient light. In some implementations, the see-through display is an additive display that enables optical see-through of the physical surface, such as an optical HMD (OHMD). For example, unlike purely compositing using the image data234, the see-through display is capable of reflecting projected images off of the display while enabling a user to see through the display.

Referring toFIG.2B, the electronic device210renders, via a rendering system216, a first computer-generated cube240(e.g., XR content) in order to generate a first cube render242. For example, the rendering system216is integrated in a GPU. The rendering system216includes a depth value generator217. While rendering the first-computer generated cube240, the depth value generator217determines a first depth value244associated with the first-computer generated cube240. For example, the first depth value244indicates a depth of the first-computer generated cube240within a scene, such that a higher depth value indicates that the first-computer generated cube240is positioned nearer to the background of the scene, and vice versa for a lower depth value. In some implementations, the electronic device210includes a depth buffer218, and the electronic device210stores the first depth value244in the depth buffer218. Utilization of the depth buffer218for generating shadows will be described with reference toFIGS.2E and2F. Moreover, in some implementations, the electronic device210includes a compositing system219that composites the image data234with the first cube render242, in order to generate display data that is displayed on the display212, as illustrated inFIG.2D.

Referring toFIG.2C, the electronic device210renders, via the rendering system216, a second computer-generated cube250(e.g., XR content) in order to generate a second cube render252. Rendering the second computer-generated cube250includes determining a second depth value254associated with the second computer-generated cube250. The second depth value254is greater than the first depth value244, as is illustrated inFIG.2D. Moreover, the electronic device210stores the second depth value254in the depth buffer218. The rendering system216may render the first computer-generated cube240and the second computer-generated cube250during a common rendering cycle, or during separate rendering cycles. Moreover, the compositing system219composites the image data234with the second cube render252in order to generate display data that is displayed on the display212, as illustrated inFIG.2D.

As illustrated inFIG.2D, the electronic device210displays the display data on the display212. The display data includes the first cube render242and the second cube render252, composited with the image data234. The image data234represents a portion of the physical environment200. The portion of the physical environment200includes a portion of the first wall202and a portion of the second wall204, based on the current viewable region214. Accordingly, the first cube render242and the second cube render252appear as displayed overlaid respective portions of the physical environment200.

The first depth value244and the second depth value254are illustrated inFIG.2Dfor purely explanatory purposes. The first depth value244is less than the second depth value254, and thus the first cube render242appears closer to the display212than does the second cube render252. Accordingly, the first cube render242appears farther from the first wall202than does the second cube render252.

As illustrated inFIG.2E, according to various implementations, the electronic device210includes components for generating and displaying a first shadow246and a second shadow256. The first shadow246and the second shadow256are respectively associated with the first computer-generated cube240and the second computer-generated cube250. Each of the first shadow246and the second shadow256is based on the ambient light232, which is characterized by a Spherical Gaussian (SG) lobe264. To that end, in some implementations, the electronic device210includes a shadow generator260, an SG lobe generator263, and a combiner266.

The shadow generator260determines the first shadow246and the second shadow256, based on the SG lobe264and respective depth values244/254. The SG lobe264indicates a directional characteristic associated with the ambient light232. Details regarding the shadow generator260determining the first shadow246and the second shadow256are described with reference toFIGS.2F-2H. The SG lobe264is associated with a Spherical Gaussian (SG) function, which may be a standard Gaussian function defined on a surface of a sphere. For example, an SG function, denoted G (v; μ; λ; a), corresponds to: G (v; μ; λ; a)=aeλ(μ·v−1)

The SG function characterizes the ambient light232, and the parameters (v; μ; λ; a) of the SG function affect the shape and location of the SG lobe264. The parameter ‘μ’ corresponds to a unit vector that indicates the axis or direction associated with the SG lobe264, such as a location of the SG lobe264on a surface of a sphere. For example, the parameter ‘μ’ indicates the directional characteristic associated with the ambient light232. The parameter ‘μ’ may effectively point to the center of the SG lobe264. In some implementations, the parameter ‘μ’ is represented by a three dimensional (3D) XYZ directional value. The parameter ‘a’ corresponds to the amplitude or intensity associated with the SG lobe264. In some implementations, the amplitude is represented by a scalar value. In some implementations, the amplitude is represented by an RGB color value. The parameter ‘λ’ corresponds to the sharpness associated with the SG lobe264. For example, a larger ‘λ’ value corresponds to a narrower SG lobe, resulting in a faster decrease from the axis associated with the SG lobe264(as compared with a smaller ‘λ’ value).

In various implementations, the SG lobe generator263generates the SG lobe264based on the image data234. For example, in some implementations, the image data234corresponds to a 360 degree image of the physical environment200, and the SG lobe generator263includes a neural network that determines the SG lobe264based on the 360 degree image.

The combiner266combines an object render with a corresponding shadow in order to generate a combined render268. Namely, the combiner266combines the first cube render242with the first shadow246, and combines the second cube render252with the second shadow256, in order to generate the combined render268. The compositing system219composites the combined render268with the image data234in order to generate display data269. The display data269is displayed on the display212, as illustrated inFIG.2I.

As illustrated inFIG.2F, the shadow generator260determines the first shadow246and the second shadow256, based on the SG lobe264and respective depth values244/254. To that end, in some implementations, the shadow generator260includes a sampling ray generator270, a ray selector274, and a shadow drawer280.

The sampling ray generator270obtains the SG lobe264. A graphical representation of the SG lobe264, on a corresponding SG262, is illustrated inFIG.2G. Referring back toFIG.2A, the physical lamp230is positioned behind and to the right of the electronic device210within the physical environment200. Accordingly, the directional characteristic associated with the SG lobe264(e.g., the position of the SG lobe264) is also towards the bottom right of the SG262, as illustrated inFIG.2G. The sampling ray generator270determines a plurality of sampling rays272-1, . . . ,272-N based on the directional characteristic. For example, as illustrated inFIG.2G, each of the plurality of sampling rays272-1, . . . ,272-N is substantially parallel to the SG lobe264. One of ordinary skill in the art will appreciate that the number of the plurality of sampling rays272-1, . . . ,272-N may vary according to different implementations. For example, the number of the plurality of sampling rays272-1, . . . ,272-N is between 16 and 64.

The ray selector274selects at least a portion of plurality of sampling rays272-1, . . . ,272-N. For example, with reference toFIG.2F, the ray selector274selects a first sampling ray272-1based on the first depth value244, and selects a second sampling ray272-2based on the second depth value254. As described with reference toFIGS.2B and2C, the electronic device210determines the first depth value244and the second depth value254during rendering of the first computer-generated cube240and the second computer-generated cube250, respectively. Moreover, the electronic device210stores the first depth value244and the second depth value254in the depth buffer218. During ray selection, the ray selector274obtains the first depth value244and the second depth value254from the depth buffer218, and selects appropriate sampling rays based on the depth values. In some implementations, the selected portion of the plurality of sampling rays272-1, . . . ,272-N and a corresponding object render together satisfy an occlusion criterion. For example, as illustrated inFIG.2Hand with reference back toFIG.2D, the first sampling ray272-1and the first cube render242satisfy the occlusion criterion based on intersection between the first sampling ray272-1and the first cube render242. Moreover, the second sampling ray272-2and the second cube render252satisfy the occlusion criterion based on intersection between the second sampling ray272-2and the second cube render252.

The shadow drawer280generates the first shadow246(associated with the first computer-generated cube240) based on the first sampling ray272-1and the first depth value244. Moreover, the shadow drawer280generates the second shadow256(associated with the second computer-generated cube250) based on the second sampling ray272-2and the second depth value254. To that end, in some implementations, generating a shadow includes tracing one or more sampling ray(s) against a corresponding depth value. For example, the shadow drawer280traces the first sampling ray272-1against the first depth value244in order to generate the first shadow246. As another example, the shadow drawer280traces the second sampling ray272-2against the second depth value254in order to generate the second shadow256. Accordingly, in contrast to other systems that arbitrarily sample light rays (e.g., guess direction of the ambient light), the electronic device210uses the directional characteristic associated with the SG lobe264in order to efficiently trace sampling rays. The electronic device210, therefore, performs fewer tracing operations in order to generate a photorealistic shadow.

As illustrated inFIG.2I, the display212displays the first shadow246for the first cube render242, and displays the second shadow256for the second cube render252. The respective positions of the first shadow246and the second shadow256are based on the first sampling ray272-1and the second sampling ray272-2. Because the second cube render252is nearer to the first wall202, the second shadow256is smaller and has a sharper appearance, as compared with the first shadow246. The difference in sharpness is indicated by different respective hatch patterns for the first shadow246and the second shadow256.

FIGS.3A-3Dare an example of utilizing a plurality of SG lobes for generating different shadows in accordance with some implementations. As illustrated inFIG.3A, a physical environment300includes the user50holding the electronic device210. The electronic device210is outside at daytime, and thus the physical environment300includes the Sun302. The Sun302emits a first portion of ambient light340atowards the electronic device210. The physical environment300also includes a physical street lamp304that emits a second portion of ambient light340btowards the electronic device210. Because of the relative proximity of the physical street lamp304to the electronic device210, the second portion of ambient light340bis brighter (e.g., has a higher luminance) than the first portion of ambient light340afrom the Sun302. Moreover, the electronic device210has rendered, via a rendering system, a computer-generated cube in order to generate a cube render320, including determining a depth value322associated with the computer-generated cube. The display212displays the cube render320, as shown inFIG.3A.

As illustrated inFIGS.3B and3C, the electronic device210obtains a first SG lobe332of an SG330, and obtains a second SG lobe336of the SG330. The first SG lobe332characterizes the first portion of ambient light340afrom the Sun302, and the second SG lobe336characterizes the second portion of ambient light340bfrom the physical street lamp304. The electronic device210determines, via the sampling ray generator270, a first plurality of sampling rays associated with the first SG lobe332, based on a first directional characteristic associated with the first SG lobe332. Moreover, the electronic device210determines, via the sampling ray generator270, a second plurality of sampling rays associated with the second SG lobe336, based on a second directional characteristic associated with the second SG lobe336.

In some implementations, the electronic device210selects, via the ray selector274, a first portion334of the first plurality of sampling rays and a second portion338of the second plurality of sampling rays. In some implementations, the number of selected sampling rays is based on a corresponding intensity of the SG lobe, as indicated by a corresponding SG function. For example, as illustrated inFIGS.3B and3C, the second portion338of the second plurality of sampling rays includes more sampling rays than the first portion334of the first plurality of sampling rays, because the second portion of ambient light340bfrom the physical street lamp304is more intense (e.g., brighter) than the first portion of ambient light340afrom the Sun302.

The electronic device210generates, via the shadow drawer280, a first shadow350associated with the first portion of ambient light340a, and a second shadow352associated with the second portion of ambient light340b. The first shadow350is generated based on the depth value322and the first portion334of the first plurality of sampling rays. The second shadow352is generated based on the depth value322and the second portion338of the second plurality of sampling rays. For example, generating a particular shadow includes tracing respective sampling rays towards the cube render320, based on a function of the depth value322. As illustrated inFIG.3D, the display212displays the cube render320, the first shadow350, and the second shadow352. Because of the relatively high intensity of the second portion of ambient light340b, the corresponding second shadow352is sharper than the first shadow350, which is associated with the first portion of ambient light340a. Additionally, the first shadow350is longer than the second shadow352because the Sun302is farther from the electronic device210than the physical street lamp304is from the electronic device210.

FIG.4is an example of a flow diagram of a method400of generating a shadow based on an SG lobe and a depth value in accordance with some implementations. In various implementations, the method400or portions thereof are performed by an electronic device (e.g., the electronic device210). In various implementations, the method400or portions thereof are performed by a mobile device, such as a smartphone, tablet, or wearable device. In various implementations, the method400or portions thereof are performed by a head-mountable device (HMD) including a display. In some implementations, the method400is performed by processing logic, including hardware, firmware, software, or a combination thereof. In some implementations, the method400is performed by a processor executing code stored in a non-transitory computer-readable medium (e.g., a memory).

As represented by block402, the method400includes obtaining a first SG lobe that characterizes ambient light from a physical environment. The first SG lobe indicates a first directional characteristic associated with the ambient light. For example, with reference toFIGS.2A and2G, the electronic device210obtains the SG lobe264, which is associated with the ambient light232produced by the physical lamp230. In some implementations, the first SG lobe further indicates an intensity characteristic and/or a sharpness characteristic associated with the ambient light. In some implementations, the first SG lobe is characterized by an SG function G (v; μ; λ; a)=aeλ(μ·v−1).

As represented by block404, in some implementations, obtaining the first SG lobe includes determining the first SG lobe based on image data that represents the physical environment. For example, with reference toFIGS.2E, the image sensor233captures ambient light232from the physical environment200, and outputs the image data234to the SG lobe generator264, which determines the SG lobe264based on the image data234. In some implementations, the image data includes a plurality of images associated with a plurality of poses. In some implementations, the image data includes a 360 degree image of the physical environment. For example, with reference toFIG.2A, while the image sensor233is activated, the user50rotates the electronic device210in order to capture a 360 degree image of the physical environment200.

As represented by block406, the method400includes determining a first plurality of sampling rays based on the first directional characteristic. As represented by block408, in some implementations, each of the plurality of sampling rays is substantially parallel to the first SG lobe. For example, with reference toFIGS.2F and2G, the sampling ray generator270determines a plurality of sampling rays272-1, . . . ,272-N, based on a directional characteristic indicated by the SG lobe264. Continuing with this example, the directional characteristic indicates a position of the SG lobe264on the SG262. In some implementations, each of the first plurality of sampling rays is associated with a distinct position on the first SG lobe.

As represented by block410, in some implementations, the method400includes rendering, via the rendering system, the computer-generated object in order to generate an object render. The rendering system may be integrated in a GPU. The computer-generated object may correspond to a 2D or a 3D object, such as an object model. Rendering the computer-generated object includes determining a depth value that is associated with the computer-generated object. Moreover, the method400may include storing the depth value in a depth buffer. For example, with reference toFIG.2B, the rendering system216, while rendering the first computer-generated cube240, determines the first depth value244. Moreover, the electronic device210stores the first depth value244in the depth buffer218.

As represented by block412, the method400includes obtaining the depth value that is associated with the computer-generated object. As represented by block414, in some implementations, obtaining the depth value includes retrieving the depth value from the depth buffer. For example, with reference toFIG.2E, the shadow generator260obtains the first depth value244from the depth buffer218. Accordingly, an electronic device retrieves the depth value that is determined as part of the standard rendering process. Retrieving the depth value from the depth buffer enables an electronic device to avoid performing additional depth information calculations, such as a determination of a 3D mesh performed by other systems.

As represented by block416, in some implementations, the method400includes selecting a first sampling ray of the first plurality of sampling rays according to a determination that the first sampling ray and the object render together satisfy an occlusion criterion. For example, with reference toFIGS.2D and2H, the first sampling ray272-1and the first cube render242satisfy the occlusion criterion based on intersection between the first sampling ray272-1and the first cube render242.

As represented by block418, the method400includes generating a first shadow that is associated with the computer-generated object, based on the depth value and a first sampling ray of the first plurality of sampling rays. To that end, in some implementations, the method400includes tracing the first sampling ray against the depth value, as represented by block420. In other words, the depth value may be used as a proxy for tracing the first sampling ray. For example, with reference toFIGS.2H and2I, the electronic device210uses the first sampling ray272-1and the first depth value244in order to generate and display display data that includes a first shadow246. The first shadow246represents a real-world shadow that would be cast by a physical approximation of the first computer-generated cube240, such as a physical cube. Details regarding generation of the display data are described with reference to blocks424and426. As represented by block422, in some implementations, generating the first shadow is further based on a second sampling ray of the first plurality of sampling rays.

As represented by block424, in some implementations, the method400includes combining the object render with the first shadow in order to generate a combined render, and compositing the combined render with image data of the physical environment in order to generate the display data. For example, with reference toFIG.2E, the combiner266combines first and second cube renders242and252with respective first and second shadows246and256, in order to generate the combined render268. Moreover, the compositing system219composites the combined render268with the image data234in order to generate the display data269. As represented by block426, in some implementations, the method400includes displaying the display data on a display, such as on the display212illustrated inFIG.2I.

FIG.5is an example of a flow diagram of a method500of generating a shadow based on a plurality of SG lobes and a depth value in accordance with some implementations. In various implementations, the method500or portions thereof are performed by an electronic device (e.g., the electronic device210). In various implementations, the method500or portions thereof are performed by a mobile device, such as a smartphone, tablet, or wearable device. In various implementations, the method500or portions thereof are performed by an HMD including a display. In some implementations, the method500is performed by processing logic, including hardware, firmware, software, or a combination thereof. In some implementations, the method500is performed by a processor executing code stored in a non-transitory computer-readable medium (e.g., a memory).

As represented by block502, in some implementations, the method500includes obtaining a plurality of SG lobes. In some implementations, as represented by block504, each of the plurality of SG lobes indicates a respective directional characteristic associated with ambient light from a physical environment.

As represented by block506, in some implementations, the plurality of SGlobes may be associated with a particular physical light source. For example, the method500includes obtaining a first SG lobe that characterizes a first portion of ambient light produced by a particular physical light source, and obtaining a second SG lobe that characterizes a second portion of the ambient light produced by the particular physical light source. Continuing with this example, the first SG lobe indicates a first directional characteristic, and the second SG lobe indicates a second directional characteristic that is different from the first directional characteristic. The number of SG lobes associated with a particular physical light source may be proportional to the complexity of the particular physical light source.

As another example, as represented by block508, the plurality of SG lobes may be associated with different physical light sources. Because each of the plurality of SG lobes is localized, each SG lobe may quantify a different physical light source. Moreover, the amplitude (e.g., RGB value) and sharpness value associated with a particular SG lobe can be independently adjusted. For example, with reference toFIGS.3A-3C, the first SG lobe332characterizes the first portion of the ambient light340afrom the Sun302, and the second SG lobe336characterizes the second portion of the ambient light340bfrom the physical street lamp304. Accordingly, in some implementations, each of the plurality of SG lobes characterizes a distinct physical light source. In some implementations, each of a plurality of physical light sources is characterized by multiple SG lobes. In some implementations, the method500includes obtaining a single SG lobe for a less complex light source, and multiple SG lobes for a more complex light source.

As represented by block510, in some implementations, the method500includes determining a respective plurality of sampling rays for each of the plurality of SG lobes. In some implementations, the number of a plurality of sampling rays for a particular SG lobe is proportional to an intensity characteristic indicated by the particular SG lobe. In other words, more sampling rays may be used for a brighter physical light source. For example, an electronic device determines16sampling rays based on a first SG lobe associated with the Sun, and determines64sampling rays based on a second SG lobe associated with a physical fluorescent lamp. In some implementations, the number of a plurality of sampling rays for a particular SG lobe is based on a sharpness or softness characteristic indicated by a particular SG lobe. For example, the method500utilizes fewer sampling rays for a narrower (e.g., sharper) SG lobe than for a wider SG lobe, because the narrower SG lobe is associated with a sharper shadow boundary. The width of a penumbra associated with a particular SG lobe is based on geometry involved in the light transport. For example, the width of a penumbra is based on the size of a physical light source, and the distances between the light, the occluder, and physical surface on which a shadow is cast. In some implementations, the number of a plurality of sampling rays for a particular SG lobe is based on a combination of an intensity characteristic indicated by a particular SG lobe, and a sharpness/softness characteristic indicated by the particular SG lobe.

As represented by block512, the method500includes obtaining the depth value that is associated with a computer-generated object, such as is described with reference to block412. As represented by block514, the method500includes generating a shadow that is associated with the computer-generated object, based on a portion of the respective plurality of sampling rays. For example, with reference toFIGS.3B and3C, the electronic device210selects three sampling rays based on the first SG lobe332, and selects six sampling rays based on the second SG lobe336. Accordingly, with reference toFIG.3D, the electronic device210generates the first shadow350based on the three sampling rays, and generates the second shadow352based on the six sampling rays.

The present disclosure describes various features, no single one of which is solely responsible for the benefits described herein. It will be understood that various features described herein may be combined, modified, or omitted, as would be apparent to one of ordinary skill. Other combinations and sub-combinations than those specifically described herein will be apparent to one of ordinary skill, and are intended to form a part of this disclosure. Various methods are described herein in connection with various flowchart steps and/or phases. It will be understood that in many cases, certain steps and/or phases may be combined together such that multiple steps and/or phases shown in the flowcharts can be performed as a single step and/or phase. Also, certain steps and/or phases can be broken into additional sub-components to be performed separately. In some instances, the order of the steps and/or phases can be rearranged and certain steps and/or phases may be omitted entirely. Also, the methods described herein are to be understood to be open-ended, such that additional steps and/or phases to those shown and described herein can also be performed.

Some or all of the methods and tasks described herein may be performed and fully automated by a computer system. The computer system may, in some cases, include multiple distinct computers or computing devices (e.g., physical servers, workstations, storage arrays, etc.) that communicate and interoperate over a network to perform the described functions. Each such computing device typically includes a processor (or multiple processors) that executes program instructions or modules stored in a memory or other non-transitory computer-readable storage medium or device. The various functions disclosed herein may be implemented in such program instructions, although some or all of the disclosed functions may alternatively be implemented in application-specific circuitry (e.g., ASICs or FPGAs or GP-GPUs) of the computer system. Where the computer system includes multiple computing devices, these devices may be co-located or not co-located. The results of the disclosed methods and tasks may be persistently stored by transforming physical storage devices, such as solid-state memory chips and/or magnetic disks, into a different state.

Various processes defined herein consider the option of obtaining and utilizing a user's personal information. For example, such personal information may be utilized in order to provide an improved privacy screen on an electronic device. However, to the extent such personal information is collected, such information should be obtained with the user's informed consent. As described herein, the user should have knowledge of and control over the use of their personal information.

Personal information will be utilized by appropriate parties only for legitimate and reasonable purposes. Those parties utilizing such information will adhere to privacy policies and practices that are at least in accordance with appropriate laws and regulations. In addition, such policies are to be well-established, user-accessible, and recognized as in compliance with or above governmental/industry standards. Moreover, these parties will not distribute, sell, or otherwise share such information outside of any reasonable and legitimate purposes.

Users may, however, limit the degree to which such parties may access or otherwise obtain personal information. For instance, settings or other preferences may be adjusted such that users can decide whether their personal information can be accessed by various entities. Furthermore, while some features defined herein are described in the context of using personal information, various aspects of these features can be implemented without the need to use such information. As an example, if user preferences, account names, and/or location history are gathered, this information can be obscured or otherwise generalized such that the information does not identify the respective user.

The disclosure is not intended to be limited to the implementations shown herein. Various modifications to the implementations described in this disclosure may be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other implementations without departing from the spirit or scope of this disclosure. The teachings of the invention provided herein can be applied to other methods and systems, and are not limited to the methods and systems described above, and elements and acts of the various implementations described above can be combined to provide further implementations. Accordingly, the novel methods and systems described herein may be implemented in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the methods and systems described herein may be made without departing from the spirit of the disclosure. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the disclosure.