Compute normals from displacement map in three.js r.58?

后端 未结 3 864
天命终不由人
天命终不由人 2021-01-01 02:52

I\'m using the normal shader in three.js r.58, which I understand requires a normal map. However, I\'m using a dynamic displacement map, so a pre-computed normal map won\'t

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-01 03:31

    What I was describing above is called a "bump map" and it comes as a default with the three.js phong shader. I combined the normalmap shader with chunks of the phong shader responsible for bump mapping:

    http://meetar.github.io/three.js-normal-map-0/bump.html

    Though the normals are a bit noisy they are basically correct.

    sphere with displacement and bump mapping

提交回复
热议问题