gpt4 book ai didi

c++ - 点光源阴影贴图和光照着色器

转载 作者:行者123 更新时间:2023-11-30 04:05:45 25 4
gpt4 key购买 nike

我正在做全向阴影贴图,我无法掌握的一件事是在照明阶段,如何获得用于对立方体贴图进行采样的 vector ?

在阴影 channel 中,我只使用深度值,所以我现在需要在同一个空间中。但是我怎么知道要使用六个 View 矩阵中的哪一个(因为每个面一个)将世界空间位置转换为 NDC 空间?

例如,使用 this作为引用,查看片段着色器有一个“light_view_matrix” - 但它是什么?光 View 矩阵……是什么脸?我在阴影过程中为每张脸生成了一个。

最佳答案

实际上有一个非常深入的关于可编程管线阴影映射的教程,查看Tutorial 16: Shadow mapping

网站上有关点光源的引述:

Point lights

Same thing, but with depth cubemaps. A cubemap is a set of 6 textures, one on each side of >a cube; what’s more, it is not accessed with standard UV coordinates, but with a 3D vector >representing a direction.

The depth is stored for all directions in space, which make possible for shadows to be >cast all around the point light.

关于c++ - 点光源阴影贴图和光照着色器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23153248/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com