2
3

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 5 years have passed since last update.

DrawTextureしたものの上にParticleを表示させる

Last updated at Posted at 2014-09-09

概要

Particle, Texture, その他をLayerに分けて、それぞれのLayerを表示するカメラを作る
OnGUIとGUI.DrawTextureを使わずに、OnRenderObjectとGraphics.DrawTextureを使うのがポイント

やること

  1. Particle, Texture, その他をLayerに分ける
  • Textureを表示する際にはOnGUIではなく、OnRenderObjectで
  • カメラをParticle, Texture, その他のLayerを映すようにする (depthは Particle > Texture > その他)

ゲームオブジェクト

Particle

Textureの上に表示させるParticle
LayerをParticleにしておく。

SS 2014-09-09 19.41.06.png

Texture

Particleの下にあるTexture
LayerをTextureにしておく。

SS 2014-09-09 19.41.49.png

ポイント

Layerを設定するために、空のゲームオブジェクトを別に作り、そこにTexture生成用のスクリプトを貼り付ける。
OnGUIとGUI.DrawTextureを使わずに、OnRenderObjectとGraphics.DrawTextureを使う!

void OnRenderObject() {
	Graphics.DrawTexture(new Rect(x, y, width, height), yourTexture);
}

その他

Layerはdefaultのままでよい。
SS 2014-09-09 19.46.45.png

カメラ

Particle用カメラ

Clear Flags Depth only
Culling Mask Particle
Depth 1
AudioListener チェックを外す

SS 2014-09-09 19.48.02.png

Texture用カメラ

Clear Flags Depth only
Culling Mask Texture
Depth 0
AudioListener チェックを外す

SS 2014-09-09 19.52.05.png

その他のカメラ

SS 2014-09-09 19.53.53.png

Clear Flags Skybox
Culling Mask Particle、Texture以外
Depth -1
AudioListener チェックはつける

参考

2
3
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
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?