简体   繁体   English

三个环境中的环境遮挡

[英]Ambient occlusion in threejs

I've just finished porting of my first cloth simulation from opengl to webgl using three.js (can be seen here) . 我刚刚使用three.js将我的第一个布料模拟从opengl移植到webgl (可以在这里看到)

The thing is it looks a bit dull, and I want to add (as i hope i remember correctly from my computer graphics classes) ambient occlusion, to make the cloth nicely shaded on collision with ball. 事情是它看起来有点沉闷,我想添加(因为我希望我从我的计算机图形类中正确记住)环境遮挡,以使布料在与球碰撞时很好地遮挡。 My knowledge about shaders is now on very low level, so I'd be very thankful for any resources on this topic helpful with three.js development (tutorials, book titles etc), because googles doesn't know anything about it. 我对着色器的了解现在处于非常低的水平,所以我非常感谢有关这个主题的任何资源,有助于three.js开发(教程,书名等),因为谷歌对它一无所知。

Maybe some hints how to apply ambient occlusion? 也许有些提示如何应用环境遮挡?

So the shading is fixed thanks to WestLangley! 所以,由于WestLangley,阴影得到了修复! Now back to the other questions: any helpful resources on shaders for threejs, or just hlsl in general? 现在回到其他问题:关于三个着色器的任何有用资源,或者只是一般的hlsl?

There are several ways to produce ambient occlusion: 有几种方法可以产生环境遮挡:

  • global illumination (GI) 全球照明(GI)
  • global low-frequency approximation of light intensity (GI shortcuts) 全局低频近似光强度(GI快捷键)
  • screen-space approximations, most commonly referred to as SSAO (screen space ambient occlusion) 屏幕空间近似,通常称为SSAO(屏幕空间环境遮挡)

here are a few discussions on ambient occlusion in three.js: 以下是关于three.js中环境遮挡的一些讨论:

most likely you would want to refer to this example from three.js to start you off: 你很可能想从three.js引用这个例子来启动你:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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