模糊立方体贴图
有什么想法如何去做吗?现在我已经动态生成了立方体贴图,我将其用作圆环上的反射纹理。
单独模糊每一面不会有效果,对吧?因为边界附近的像素不会受到相邻像素的模糊影响。
也许我应该制作另一个 FBO,绑定它,在屏幕上“展开”立方体贴图,应用基本的模糊着色器,然后将模糊纹理分成 6 个面?不知道如何做“单独”部分。
Any ideas how to do it? Now i have dynamically generated cubemap, which i use as a reflection texture on torus.
Blurring every side separately won't do the trick, right? Because of pixels near the border, which won't get blur impact from their neighbours.
Maybe i should make another FBO, bind it, "unroll" cubemap on the screen, apply basic blur shader and then separate that blurred texture into 6 sides? Not sure how to do the "separate" part.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
模糊立方体贴图?那是相当难的。
要进行数学上正确的高斯模糊,您需要将其变换到频域(球谐函数),在那里应用低通滤波器,然后进行逆变换。这不是一个简单的任务。
如果近似值足够,请执行以下操作。
对于立方体的每个面 F,渲染面 F 和其他 4 个面的相邻像素,如下所示:
<前><代码> ___________
|\ /|
| \ / |
| \-----/ |
| | | |
| | F | |
| | | |
| /-----\ |
| / \ |
|/_________\|
相邻像素的数量取决于模糊半径。
Blurring a cubemap? That's pretty hard.
To do a mathematically correct Gaussian blur, you need to transform it to the frequency domain (spherical harmonics), apply a low-pass filter there, and then do the inverse transform. That's not a simple task.
If an approximation is enough, do the following.
For each face F of your cube, render the face F and the neighboring pixels from the other 4 faces like this:
The amount of neighboring pixels depends on blur radius.