在延迟渲染器中实现环境照明? [英] Implementing Ambient lighting in a deferred Renderer?

查看:88
本文介绍了在延迟渲染器中实现环境照明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在我的引擎中添加了延迟阴影,并遇到了一种称为轻量"的技术.尽管它很棒,因为它可以将照明计算降至最低(仅执行光量中的片段),但我无法弄清楚如何使用环境照明来渲染场景的其余部分!

I recently added deferred shading into my engine, and ran across a technique called "light volumes". While being great because it reduces lighting computations to the minimum (executing only fragments in the light volume), I cannot figure out how I could render the rest of the scene with ambient lighting!

我得到以下场景,没有环境照明:(光量已突出显示为灰色)

I get the following scene without ambient lighting: (the light volume has been highlighted in gray)

当然,我总是可以渲染全屏四边形,但是我会放弃这种技术的好处.

Of course, I could always render a fullscreen quad, but I would loose the benefit of this technique.

有什么建议吗?

多亏了尼科尔,我终于可以工作了:)这是一张新照片:

Edit : I finally got it to work thanks to Nicol : ) Here is a new picture :

推荐答案

您需要单独进行一次环境照明.就像您对带有延迟渲染的灯光进行处理一样.通常的想法是,每道光都是自己发生的,通过与它们进行累加混合,将结果累积到帧缓冲区中.

You do the ambient lighting in a separate pass. Just like you do with lights in general with deferred rendering. That is the general idea, that each light happens in its own pass, with you accumulating the results into the framebuffer by doing additive blending with them.

环境光仅被视为另一种光源.

The ambient light is simply considered another lightsource.

这篇关于在延迟渲染器中实现环境照明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆