Ambient occlusion in threejs

2019-02-16 15:11发布

I've just finished porting of my first cloth simulation from opengl to webgl using three.js (can be seen here).

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.

Maybe some hints how to apply ambient occlusion?

So the shading is fixed thanks to WestLangley! Now back to the other questions: any helpful resources on shaders for threejs, or just hlsl in general?

1条回答
萌系小妹纸
2楼-- · 2019-02-16 16:06

There are several ways to produce ambient occlusion:

  • global illumination (GI)
  • global low-frequency approximation of light intensity (GI shortcuts)
  • screen-space approximations, most commonly referred to as SSAO (screen space ambient occlusion)

here are a few discussions on ambient occlusion in three.js:

most likely you would want to refer to this example from three.js to start you off:

查看更多
登录 后发表回答