【问题标题】:Where does Unity 5.6 Render into the ShadowMask when lights aren't baked未烘焙灯光时,Unity 5.6 在哪里渲染到 ShadowMask
【发布时间】:2017-04-20 17:53:28
【问题描述】:

我目前正在尝试使用 CommandBuffers 来使用 CommandBuffer.DrawProcedural 为我的几何体渲染灯光和阴影,但仅当渲染的对象与这个新的 ShadowMask 重叠时才有效。

Here is you can see the masking effect

And this is the Shadowmask Buffer

所以我想我的问题是,Unity 是否有办法使用 CommandBuffer 渲染到该掩码中,还是我只是在我的游戏世界中放置一个网格立方体?

【问题讨论】:

  • 我忘了提到那个小矮人是程序绘制的网格,而绿色和灰色框是传统的统一网格。
  • 这似乎是由于内置延迟着色器中的模板操作造成的,如果我找到答案,我会在这里发布。

标签: unity3d rendering unity5 shadow


【解决方案1】:

将此模板遮罩添加到我的延迟通道中,可以在使用带有绘图程序和命令缓冲区的光和阴影时正确渲染灯光

Stencil{
            ref[_StencilNonBackground]
            Comp Always
            Pass Replace

            ZFail Keep
            Fail Keep
        }

【讨论】:

    猜你喜欢
    • 2021-03-18
    • 1970-01-01
    • 2018-07-25
    • 1970-01-01
    • 2019-01-15
    • 2013-02-20
    • 1970-01-01
    • 2015-06-24
    • 1970-01-01
    相关资源
    最近更新 更多