Discuz! Board

 找回密码
 立即注册
查看: 835|回复: 0

What is shadow mapping in computer graphics?

[复制链接]

1

主题

1

帖子

5

积分

新手上路

积分
5
发表于 2023-7-17 19:22:49 | 显示全部楼层 |阅读模式
Shadow mapping is a technique used in computer graphics to generate realistic shadows in a three-dimensional scene. It is commonly employed in real-time rendering applications such as video games and interactive simulations. The basic idea behind shadow mapping invol ves simulating the behavior of


light sources in a scene to determine  Shadow and Reflection which areas are in shadow and which are illuminated. This technique works by rendering the scene from the perspective of the light source, creating a depth map known as the shadow map. The shadow map is essentially a two-

dimensional texture that represents the depth values​​​​of the scene as seen from the light source's viewpoint. Each texel (texture pixel) in the shadow map contains the distance between the light source and the closest surface visible from that particular texel. During the rendering process ,

the shadow map is used to determine whether a point in the scene is in shadow or not. This is achieved by comparing the depth value of the current fragment being rendered with the corresponding depth value in the shadow map. If the Fragment's depth is greater than the stored depth in the shadow map, it means that the point is occluded from the light source and is therefore in shadow.


To achieve accurate shadows, multiple steps are typically involved in the shadow mapping process, including setting up the camera and light matrices, rendering the depth map from the light's perspective, and finally rendering the scene from the viewer's perspective, incorporating the shadow map to determine the visibility of each fragment.

While shadow mapping provides a fast and efficient way to generate shadows in real-time, it can suffer from certain limitations such as aliasing artifacts, self-shadowing artifacts, and light bleeding. These issues can be addressed th rough Various Techniques like f filtering, PCF (Percentage Closer Filtering), and using higher resolution shadow maps.

Overall, shadow mapping is a widely used technique in computer graphics that allows for the creation of realistic shadows, enhancing the visual quality and immersion of virtual scenes.

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|NFT数字藏品交易-全球交流论坛

GMT+8, 2024-11-25 12:09 , Processed in 0.060447 second(s), 19 queries .

NFTOTC!

快速回复 返回顶部 返回列表