LoginSignup
4
1

More than 1 year has passed since last update.

PlayCanvas v1.25.0アップデート内容【追記】

Last updated at Posted at 2020-02-26
スクリーンショット 2020-02-26 12.49.13.png PlayCanvasのアップデートについて 昨日PlayCanvas Engineがバージョン 1.24.7から 1.25.0にアップデートされました。

このアップデートでは、WebXRのサポートの追加、examplesの追加、ドキュメントの修正、バッチングに対してのアップデートが入りました。

機能追加

WebXRサポート

こちらのコミットでWebXRのソースコードが追加されました

Particle System コンポーネントについて

こちらのコミットでParticle texture atlas start frame propertyデモとソースコードが追加されました

この変更によりParticle Systemコンポーネントに対してanimStartFrameのプロパティを追加できるようになりました。

使ってみる

作成したプロジェクトはこちらです
https://playcanvas.com/project/667962/
このテクスチャをパーティクルとして使用する場合する際にanimStartFrame を設定します。

1. Particle Systemコンポーネントをを持つエンティティを作成する

a. Particle Systemを追加
スクリーンショット 2020-02-26 12.19.02.png

b. Color Map, Normal Mapにテクスチャを追加

この画像を使用します

particles-numbers.png

属性名
Color Map particles-numbers.png
Normal Map particles-numbers.png
スクリーンショット 2020-02-26 12.19.28.png

c. 各種プロパティを設定
今回適用するテクスチャアトラスは4x4のものなのでそれに沿った設定をしていきます。

属性名
Horizontal Tiles 4
Vertical Tiles Tiles 4
2. animStartFrameを設定するParticleSystemコンポーネントを持つエンティティを4つ複製
スクリーンショット 2020-02-26 12.11.36.png
3. animStartFrameを設定するスクリプトを追加

PlayCanvasのattributesを指定する方法でエディタからanimStartFrame を設定できるようにします。


/*jshint esversion: 6, asi: true, laxbreak: true*/
const Particle = pc.createScript('particle');
Particle.attributes.add("animStartFrame", {"type": "number"})

Particle.prototype.initialize = function() {
    this.entity.particlesystem.animStartFrame = this.animStartFrame
};

3.それぞれ値を設定する

それぞれのエンティティに対して、animStartFrameを設定します。

エンテティ1
属性名
animStartFrame 0
スクリーンショット 2020-02-26 12.12.53.png
エンテティ2
属性名
animStartFrame 4
スクリーンショット 2020-02-26 12.12.58.png
エンテティ3
属性名
animStartFrame 8
スクリーンショット 2020-02-26 12.13.02.png
エンテティ4
属性名
animStartFrame 12
スクリーンショット 2020-02-26 12.13.07.png

実行する

スクリーンショット 2020-02-26 12.08.17.png

実行をすると、パーティクルとして表示されているものがそれぞれ異なる位置から開始されました。
スクリーンショット 2020-02-26 12.22.55.png

このスクリプトを設定したプロジェクトはこちら
https://playcanv.as/p/9bfxB3nU/

GPU Instancing

こちらのコミットでGPU Instancingデモとソースコードが追加されました。

GPU Instancingについてはこちらの記事が参考になりました。
https://github.com/playcanvas/engine/commit/5f7c50102082cae250af8abf47d70b8636b1ccaa

GPU Instancingは、複数の「同一メッシュ」かつ「同一マテリアル」なオブジェクトがあった場合に、GPU側で一括で描画してくれる技術みたいです。
http://tsubakit1.hateblo.jp/entry/2016/06/28/233000

色々Examplesが追加

ARとVRのデモが多く追加されました。

※ 以上がv1.25.0のアップデート内容ですが、v1.25.1に今朝アップデートされていたのでそちらも追記致します

※ v1.25.1

[FIX] Remove confusing WebXR debug warnings that are shown by Chrome 79 in debug build
[FIX] Batching without an index buffer
[EXAMPLES] Improved hardware instancing example
[EXAMPLES] Tweak WebXR examples

※ v1.25.2

[NEW] Add render-to-texture and dynamic batching examples.
[FIX] on and once called on the same object for different events.
[FIX] Disable culling for batched UI elements.

※ v1.25.3

[FIX] Decompress Basis normal maps to 565 for PVR-devices to improve quality
[DOCS] Document APIs related to morph animations
[DOCS] Document APIs related to the scene's skybox
[DOCS] Document API properties related to skinned mesh animations
PlayCanvas開発で参考になりそうな記事の一覧です。 入門 応用 その他の記事はこちらになります。 その他関連 - [PlayCanvasタグの付いた記事一覧](https://qiita.com/tags/playcanvas)

PlayCanvasのユーザー会のSlackを作りました!

少しでも興味がありましたら、ユーザー同士で解決・PlayCanvasを推進するためのSlackを作りましたので、もしよろしければご参加ください!

日本PlayCanvasユーザー会 - Slack

4
1
1

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
4
1