Dynamic soft shadow
AssigneeMicrosoft Technology Licensing, LLC
InventorsTong Chen, Jonathan Perron
Life of this patent
Estimating the term…
Abstract
Dynamic soft shadows may be generated without resorting to computationally-expensive multiple render passes and sampling, or lightmap generation. With disclosed systems and methods, a dynamic soft shadow may be rendered in a single pass, which is sufficiently efficient to run on an untethered virtual reality (VR) device, such as a head mounted device (HMD). Despite the efficiency, the shadow quality may be markedly superior to those generated with other methods. In some embodiments, a script may be used with a shader to render a shadow having a realistic size, shape, position, fading factor and sharpness, based on a position and size of a shadow casting element and a light vector.
Claims20
A system for rendering a soft shadow, the system comprising:
- a processor;
- and
- a computer-readable medium storing instructions that are operative when executed by the processor to:
- obtain a position and a size of a shadow casting element;
- obtain a direction of a light vector;
- based at least on a distance between the shadow casting element and a shadowed element, a relative direction between the shadow casting element and the shadowed element, and the direction of the light vector, determine a shadow position, a shadow size, and a shadow fading;
- based at least on the shadow position, the shadow size, and the shadow fading, render a shadow for the shadow casting element on the shadowed element;
- and
- attach a script to the shadowed element that passes information to a shader for dynamic updating of the rendered shadow;
- and
- dynamically update the rendered shadow using the attached script.
A method of rendering a soft shadow, the method comprising:
- obtaining a position and a size of a shadow casting element;
- obtaining a direction of a light vector;
- based at least on a distance between the shadow casting element and a shadowed element, a relative direction between the shadow casting element and the shadowed element, and the direction of the light vector, determining a shadow position, a shadow size, and a shadow fading;
- and
- based at least on the shadow position, the shadow size, and the shadow fading, rendering a shadow for the shadow casting element on the shadowed element;
- attaching a script to the shadowed element that passes information to a shader for dynamic updating of the rendered shadow;
- and
- dynamically updating the rendered shadow using the attached script.
One or more computer storage devices having computer-executable instructions stored thereon for rendering a soft shadow, which, on execution by a computer, cause the computer to perform operations comprising:
- obtaining a position and a size and a shape of a shadow casting element, wherein the shadow casting element comprises a user interface (UI) element;
- obtaining a direction of a light vector;
- based at least on a distance between the shadow casting element and a shadowed element, a relative direction between the shadow casting element and the shadowed element, and the direction of the light vector, determining a shadow position, a shadow size, a shadow fading, a shadow sharpness, and a shadow shape;
- and
- based at least on the shadow position, the shadow size, the shadow fading, the shadow sharpness, and the shadow shape, rendering a shadow for the shadow casting element on the shadowed element,
- wherein the shadowed element comprises a UI element,
- wherein rendering a shadow for the shadow casting element comprises testing positions of pixels against the shadow position, and
- wherein rendering a shadow for the shadow casting element comprises rendering a soft shadow in a single-pass operation;
- and
- attaching a script to the shadowed element that passes information to a shader for dynamic updating of the rendered shadow
- attaching a script to the shadowed element that passes information to a shader for dynamic updating of the rendered shadow;
- dynamically updating the rendered shadow using the attached script.
Dependencies are inferred from the claim text.