Realtime shadow rendering log (1)

Source: Internet
Author: User

In computer graphics, real-time shadows fall into two categories: Shadow volume and shadow maps. In essence, it is to find the pixels that are not illuminated by the light source in the screen, and ignore these pixels when drawing illumination objects. The Shadow elements consist of light sources, blocks, and receivers. Blocks are also a shadow receiver.
Shadow and Shadow space : The light source is centered (or in the direction). Any space that is blocked by the surface of the block is in the shadow. When there is no receiver, this space is divided into two parts. Illumination space and Shadow space. Shadow space is an irregular, infinitely large cone formed by the contour of the light source and the shelter. At this time, the shadow only exists on the backlight of the shelter. When a third object is separated in this space and some are in the Shadow space, the third object becomes a shadow receiver, and its shadow facing the surface of the light source is blocked. At the same time, it is also a block.
Screen Space shadow : The common idea is to compare the depth value of the pixel location in the relationship between a ray and a shelter in the screen depth buffer of A rastered object. This determines whether the pixel is in the Shadow space.
Shadow volume (Shadow) The Shadow space defined here. A shadow body consists of several triangular edges from the light source to the contour edges facing the light source. You also need to add all triangles whose blocks are oriented to the light source. It is the cover of the shadow. The target drawn by shadow volume is to determine whether an object is in the Shadow space. Mark all the pixels in the shadow. Not rendered.
Due to the use of Infinitely distant projection volume, combined with volume cap and Z-FAILED, the near-cross-section penetration of volume is improved, and the hard damage such as the correct shadow painting of the lens in volume has become mature.
Acceleration of Filling Rate Control :
Double surface stencel Rendering : The hardware draws the cone in the stencel buffer at one time; otherwise, the cone must be rendered both inside and outside.
Depth range culling: Stencer operations are performed only within the range of hardware detection depth.
Volume culling In the figure, the white point is the light source, the white box is the light source AABB, and the blue is the screen space AABB. Yellow is a block. The intersection of the shadow and AABB constitutes a green AABB in screen space. This is what really requires stenpencil operations. Use sissor test for optimization.

Geometric Optimization:
Aotu Gen volume in vertex shader: Generate a volume triangle directly in the video card using vertex shader
Non-closed grid volume generation: The volume of a non-closed grid can be solved now.
Static pre-computing volume: I have nothing to say. The volume is first computed and saved when the relatively immobile light and block elements are lined up.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.