简体   繁体   中英

Three.js - SSAO defect transparent area

I've been trying to add SSAO into my game, per this SSAO EXAMPLE

Unfortunately, my transparent trees now defected: 在此处输入图片说明

Please advise on how to fix it.

This is not a defect, during the depth-Path, which you need to pass to the SSAO shader further on, transparency is not taken into account, thus your leave-defining planes get detected as planar geometry and get the appropriate outline. Concerning a solution, I cannot really help you. What you can do is hide all the transparent stuff before rendering the depth pass but then, the AO-pass gets multiplied over it, so you just trade in a visual problem against another one. To really solve this, i think you need an additional Three.MaskPass, see here:

Rendering multiple scenes, with only 1 using SSAO [Three.js]

Hope this helps.

您可以将纹理传递到普通/深度片段着色器中,并丢弃alpha <0.5的所有片段

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM