0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

three.jsでスプライトのrenderOrderが正しく反映されないとき

Last updated at Posted at 2022-02-27

解決法

順序を指定したい"全てのmaterial"に同じtransparentを設定する

  • Material.transparent = true

Object3D.renderOrder

This value allows the default rendering order of scene graph objects to be overridden although opaque and transparent objects remain sorted independently

同じZに複数のスプライトを描画する場合、materialにdepthTest=falseを設定する

  • Material.depthTest = false

Material.depthTest

注意
Rendererでdepth=falseを指定していてもこの設定は必要。ブラウザによって挙動が異なる。

  • Firefox: MaterialでdepthTest:falseを設定していなくても正しく表示される
  • Chrome/Edge: MaterialでdepthTest:falseを設定していないと正しく表示されない
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?