Browse Source

Merge pull request #352 from xhwanlan/patch

Particles Patch
Vaclav Elias 1 year ago
parent
commit
82e88e6757

+ 8 - 8
en/manual/particles/initializers.md

@@ -7,7 +7,7 @@
 **Initializers** control the states of particles such as position, velocity, size, and so on when the particles are first spawned. They have no effect on particles spawned on previous frames.
 
 > [!Note] 
-Some [updaters](updaters.md) act change the particle's value at the *end* of the frame. They effectively overwrite any initial values set by a similar initializer. Such is the case with all animations. They operate on the particle's lifetime and a color animation updater will overwrite any initial values from a color initializer.
+> Some [updaters](updaters.md) act change the particle's value at the *end* of the frame. They effectively overwrite any initial values set by a similar initializer. Such is the case with all animations. They operate on the particle's lifetime and a color animation updater will overwrite any initial values from a color initializer.
 
 Similarly, initializers which operate on the same field are exclusive and only the bottom one will have any effect, since they are executed in order. For example if you assign two color initializer, only the second one will have any effect.]
 
@@ -39,7 +39,7 @@ Particles are spawned in an axis-aligned bounding box, defined by its left lower
 
 | Property                    | Description
 |-----------------------------|-------------
-| Seed offset                 | Used for random numbers. Set it to the same value to force the position to be coupled with other other particle fields which have three properties (X, Y, Z), eg velocity. Make them different to force the position to be unique and independent from other fields
+| Seed offset                 | Used for random numbers. Set it to the same value to force the position to be coupled with other particle fields which have three properties (X, Y, Z), eg velocity. Make them different to force the position to be unique and independent from other fields
 | Position min                | Left lower back corner for the box
 | Position max                | Right upper front corner for the box
 
@@ -55,7 +55,7 @@ Particles spawn with initial velocity which ranges between the defined values. T
 
 | Property                    | Description
 |-----------------------------|-------------
-| Seed offset                 | This is used for random numbers. Set it to the same value to force the velocity to be coupled with other other particle fields which have 3 properties (x, Y, Z), like position for example. Make them different to force the velocity to be unique and independent from other fields.
+| Seed offset                 | This is used for random numbers. Set it to the same value to force the velocity to be coupled with other particle fields which have 3 properties (X, Y, Z), like position for example. Make them different to force the velocity to be unique and independent from other fields.
 | Velocity min                | Left lower back corner for the box
 | Velocity max                | Right upper front corner for the box
 
@@ -111,7 +111,7 @@ This initializer creates the **Direction** field in the particle properties and
 
 | Property                    | Description
 |-----------------------------|-------------
-| Seed offset                 | This is used for random numbers. Set it to the same value to force the direction to be coupled with other other particle fields which have 3 properties (x, Y, Z), like position for example. Make them different to force the velocity to be unique and independent from other fields.
+| Seed offset                 | This is used for random numbers. Set it to the same value to force the direction to be coupled with other particle fields which have 3 properties (X, Y, Z), like position for example. Make them different to force the velocity to be unique and independent from other fields.
 | Direction min               | Left lower back corner for the box
 | Direction max               | Right upper front corner for the box
 
@@ -127,7 +127,7 @@ The arc position initializer positions the particles in an arc (or a straight li
 
 | Property                    | Description
 |-----------------------------|------------
-| Seed offset                 | This is used for random numbers. Set it to the same value to force the position to be coupled with other other particle fields which have 3 properties (X, Y, Z), like velocity for example. Make them different to force the position to be unique and independent from other fields.
+| Seed offset                 | This is used for random numbers. Set it to the same value to force the position to be coupled with other particle fields which have 3 properties (X, Y, Z), like velocity for example. Make them different to force the position to be unique and independent from other fields.
 | Position min                | Left lower back corner for the box
 | Position max                | Right upper front corner for the box
 | Target                      | Allows you to pick up an Entity for the end of the arc. If no Entity is set, Fallback Target will be used, which is an offset from the emitter's location.
@@ -135,7 +135,7 @@ The arc position initializer positions the particles in an arc (or a straight li
 | Arc Height                  | The height of the arc at its highest point (middle of the distance between the two points). By default it's the Y-up vector, but can be rotated with rotation offset and rotation inheritance
 | Ordered                     | If checked, new particles will appear in order from the emitter towards the target. If unchecked, new particles will appear randomly on the arc anywhere between the emitter and the target. If you plan to visualize the particles as a ribbon or a trail you should set this box to checked.
 | Fixed count                 | By default particles will appear on the arc at distances enough for the maximum number of particles to fit exactly on the line. If you want to control spawn rate and distance, you can set how many fixed "positions" are there on the arc. For example, with a fixed count of 10 and Ordered spawning, the first 10 particles will appear in order, then the 11th particle will appear from the beginning, at the same position as the first, and so on.
-| Seed offset                 | This is used for random numbers. Set it to the same value to force the position to be coupled with other other particle fields which have 3 properties (X, Y, Z), like velocity for example. Make them different to force the position to be unique and independent from other fields.
+| Seed offset                 | This is used for random numbers. Set it to the same value to force the position to be coupled with other particle fields which have 3 properties (X, Y, Z), like velocity for example. Make them different to force the position to be unique and independent from other fields.
 | Position min                | Left lower back corner for the box. This is an offset in addition to the arc position.
 | Position max                | Right upper front corner for the box. This is an offset in addition to the arc position.
 
@@ -143,7 +143,7 @@ The arc position initializer positions the particles in an arc (or a straight li
 
 | Property                    | Description
 |-----------------------------|-------------
-| Seed offset                 | This is used for random numbers. Set it to the same value to force the position to be coupled with other other particle fields which have 3 properties (X, Y, Z), like velocity for example. Make them different to force the position to be unique and independent from other fields.
+| Seed offset                 | This is used for random numbers. Set it to the same value to force the position to be coupled with other particle fields which have 3 properties (X, Y, Z), like velocity for example. Make them different to force the position to be unique and independent from other fields.
 | Position min                | Left lower back corner for the box
 | Position max                | Right upper front corner for the box
 | Parent emitter              | You have to type the name of the parent emitter. Child particles' positions will match the parent emitter's particles' positions.
@@ -154,7 +154,7 @@ The arc position initializer positions the particles in an arc (or a straight li
 
 | Property                    | Description
 |-----------------------------|-------------
-| Seed offset                 | This is used for random numbers. Set it to the same value to force the velocity to be coupled with other other particle fields which have 3 properties (x, Y, Z), like position for example. Make them different to force the velocity to be unique and independent from other fields.
+| Seed offset                 | This is used for random numbers. Set it to the same value to force the velocity to be coupled with other particle fields which have 3 properties (X, Y, Z), like position for example. Make them different to force the velocity to be unique and independent from other fields.
 | Velocity min                | Left lower back corner for the box
 | Velocity max                | Right upper front corner for the box
 | Parent emitter              | You have to type the name of the parent emitter. Child particles' positions will match the parent emitter's particles' positions.

+ 2 - 2
en/manual/particles/tutorials/create-a-trail.md

@@ -284,7 +284,7 @@ We've created a sword trail effect prefab. Next we'll use a script to spawn the
 
 2. In Visual Studio, right-click the game project and select **Add > New item**. In the **Name** field, give your script the name *SpawnTrail*, and click **Add**.
 
-3. Replace the script content with the code in this script: [SpawnTrail.cs](https://github.com/SiliconStudio/stride-docs/blob/master-1.9/manual/particles/tutorials/media/SpawnTrail.cs)
+3. Replace the script content with the code in this script: [SpawnTrail.cs](https://github.com/stride3d/stride-docs/blob/master/en/manual/particles/tutorials/media/SpawnTrail.cs)
 
     This is a modified version of the Prefab Instance script included in Stride. Instead of listening to events or key presses, it listens to animation changes — such as our sword swing animation.
 
@@ -316,7 +316,7 @@ We've created a sword trail effect prefab. Next we'll use a script to spawn the
 
 11. In the SpawnTrail component, in the **Animation** field, click the hand icon (**Select an asset**).     The **Select an asset** window opens.
 
-In the left pane, select the **mannequinModel** and click **OK**.
+    In the left pane, select the **mannequinModel** and click **OK**.
 
     ![Pick mannequin model in Entity Picker](media/pick-mannequin-model.png)
 

+ 1 - 1
en/manual/particles/tutorials/particle-materials.md

@@ -197,7 +197,7 @@ class ParticleCustomShader : ParticleBase
 };
 ```
 
-It defines two composed shaders, `baseColor` and `abseIntensity`, where we'll plug our generated shaders for RGB and A respectively. It inherits `ParticleBase` which already defines `VSMain`, `PSMain` and texturing, and uses very simple `Shading()` method.
+It defines two composed shaders, `baseColor` and `baseIntensity`, where we'll plug our generated shaders for RGB and A respectively. It inherits `ParticleBase` which already defines `VSMain`, `PSMain` and texturing, and uses very simple `Shading()` method.
 
 By overriding the `Shading()` method we can define our custom behavior. Because the composed shaders we use are derived from `ComputeColor`, we can easily evaluate them using `Compute()`, which gives us the root of the compute tree for color and intensity.
 

+ 1 - 1
jp/manual/particles/initializers.md

@@ -18,7 +18,7 @@
 -->
 
 > [!Note] 
-[アップデーター](updaters.md)には、フレームの**最後**にパーティクルの値を変更することで、イニシャライザーが設定した初期値を効果的に上書きするものもあります。これはすべてのアニメーションに当てはまります。これらはパーティクルの寿命に作用し、色アニメーションアップデーターは、色イニシャライザーが設定した初期値を上書きするでしょう。
+> [アップデーター](updaters.md)には、フレームの**最後**にパーティクルの値を変更することで、イニシャライザーが設定した初期値を効果的に上書きするものもあります。これはすべてのアニメーションに当てはまります。これらはパーティクルの寿命に作用し、色アニメーションアップデーターは、色イニシャライザーが設定した初期値を上書きするでしょう。
 
 <!--
 > [!Note] 

+ 46 - 46
jp/manual/particles/tutorials/create-a-trail.md

@@ -6,11 +6,11 @@
 
 このチュートリアルでは、パーティクルを使用して、剣を振ったときの[残影効果](../ribbons-and-trails.md)を作成する方法を説明します。
 
-<p>
-<video autoplay loop class="responsive-video" poster="media/sword-slash-9.jpg">
-   <source src="media/sword-slash-9.mp4" type="video/mp4">
+<div class="ratio ratio-16x9 mb-3">
+<video autoplay controls loop preload="none" poster="media/sword-slash-9.jpg">
+<source src="media/sword-slash-9.mp4" type="video/mp4">
 </video>
-</p>
+</div>
 
 ## 1. プロジェクトを作成する
 
@@ -60,11 +60,11 @@
 
 10. ここまでの結果を見てみます。[Play]をクリックしてゲームを実行し、結果を確認します。マウスと WASD キーを使用してカメラを移動し、異なる視点からアニメーションを見ることができることを思い出してください。
 
-<p>
-<video autoplay loop class="responsive-video" poster="media/sword-slash-1.jpg">
-   <source src="media/sword-slash-1.mp4" type="video/mp4">
+<div class="ratio ratio-16x9 mb-3">
+<video autoplay controls loop preload="none" poster="media/sword-slash-1.jpg">
+<source src="media/sword-slash-1.mp4" type="video/mp4">
 </video>
-</p>
+</div>
 
 剣を振るアニメーションができました。次に、残影効果を追加します。
 
@@ -122,11 +122,11 @@
 
 11. ゲームを実行し、剣撃アニメーションでパーティクルがどのように見えるかを確認します。
 
-<p>
-<video autoplay loop class="responsive-video" poster="media/sword-slash-2.jpg">
-   <source src="media/sword-slash-2.mp4" type="video/mp4">
+<div class="ratio ratio-16x9 mb-3">
+<video autoplay controls loop preload="none" poster="media/sword-slash-2.jpg">
+<source src="media/sword-slash-2.mp4" type="video/mp4">
 </video>
-</p>
+</div>
 
 残影はできましたが、まだあまりよくありません。長過ぎ、色が同じであり、パーティクルの相互接続がおかしく、消えません。
 
@@ -153,11 +153,11 @@
 
 4. ゲームを実行します。
 
-<p>
-<video autoplay loop class="responsive-video" poster="media/sword-slash-3.jpg">
-   <source src="media/sword-slash-3.mp4" type="video/mp4">
+<div class="ratio ratio-16x9 mb-3">
+<video autoplay controls loop preload="none" poster="media/sword-slash-3.jpg">
+<source src="media/sword-slash-3.mp4" type="video/mp4">
 </video>
-</p>
+</div>
 
 パーティクルがまとまって動くようになりました。
 
@@ -199,11 +199,11 @@ SwordModel のプロパティの[Particle System]>[Source]>[Emitters
 
 7. ゲームを実行します。
 
-<p>
-<video autoplay loop class="responsive-video" poster="media/sword-slash-4.jpg">
-   <source src="media/sword-slash-4.mp4" type="video/mp4">
+<div class="ratio ratio-16x9 mb-3">
+<video autoplay controls loop preload="none" poster="media/sword-slash-4.jpg">
+<source src="media/sword-slash-4.mp4" type="video/mp4">
 </video>
-</p>
+</div>
 
 完成に近づいています。しかし、まだ残影が消えないので、剣の一部であるように見えます。マネキンが剣を振ったら効果が表示されて、振り終わったら表示されなくなるようにする必要があります。
 
@@ -253,7 +253,7 @@ SwordModel のプロパティの[Particle System]>[Source]>[Emitters
 
 2. Visual Studio でゲーム プロジェクトを右クリックし、[追加]>[新しいアイテム]を選択します。[名前]フィールドにスクリプトの名前として「*SpawnTrail*」と入力し、[追加]をクリックします。
 
-3. スクリプトの内容を、スクリプト [SpawnTrail.cs](https://github.com/SiliconStudio/stride-docs/blob/master-1.9/manual/particles/tutorials/media/SpawnTrail.cs) のコードに置き換えます。
+3. スクリプトの内容を、スクリプト [SpawnTrail.cs](https://github.com/stride3d/stride-docs/blob/master/en/manual/particles/tutorials/media/SpawnTrail.cs) のコードに置き換えます。
 
     これは、Stride に含まれるプレハブ インスタンス スクリプトを変更したものです。イベントまたはキーの押下をリッスンするのではなく、剣撃アニメーションのようなアニメーションの変化をリッスンします。
 
@@ -285,17 +285,17 @@ SwordModel のプロパティの[Particle System]>[Source]>[Emitters
 
 11. SpawnTrail コンポーネントの[Animation]フィールドで、手のアイコン ([Pick an asset up]) をクリックします。    [Select an asset]ウィンドウが開きます。
 
-左側のペインで **mannequinModel** を選択して[OK]をクリックします。
+    左側のペインで **mannequinModel** を選択して[OK]をクリックします。
 
     ![Pick mannequin model in Entity Picker](media/pick-mannequin-model.png)
 
 12. ゲームを実行します。
 
-<p>
-<video autoplay loop class="responsive-video" poster="media/sword-slash-5.jpg">
-   <source src="media/sword-slash-5.mp4" type="video/mp4">
+<div class="ratio ratio-16x9 mb-3">
+<video autoplay controls loop preload="none" poster="media/sword-slash-5.jpg">
+<source src="media/sword-slash-5.mp4" type="video/mp4">
 </video>
-</p>
+</div>
 
 スクリプトにより、剣撃アニメーションが開始するとパーティクル効果が表示され、終了すると表示されなくなります。
 
@@ -311,11 +311,11 @@ SwordModel のプロパティの[Particle System]>[Source]>[Emitters
 
 4. ゲームを実行して結果を確認します。
 
-<p>
-<video autoplay loop class="responsive-video" poster="media/sword-slash-6.jpg">
-   <source src="media/sword-slash-6.mp4" type="video/mp4">
+<div class="ratio ratio-16x9 mb-3">
+<video autoplay controls loop preload="none" poster="media/sword-slash-6.jpg">
+<source src="media/sword-slash-6.mp4" type="video/mp4">
 </video>
-</p>
+</div>
 
 残影効果が若干滑らかではなく、「クモの巣」効果が発生していることに気付くかもしれません。さらに曲げてみましょう。
 
@@ -329,11 +329,11 @@ SwordModel のプロパティの[Particle System]>[Source]>[Emitters
 
 2. ゲームを実行します。
 
-<p>
-<video autoplay loop class="responsive-video" poster="media/sword-slash-7.jpg">
-   <source src="media/sword-slash-7.mp4" type="video/mp4">
+<div class="ratio ratio-16x9 mb-3">
+<video autoplay controls loop preload="none" poster="media/sword-slash-7.jpg">
+<source src="media/sword-slash-7.mp4" type="video/mp4">
 </video>
-</p>
+</div>
 
 剣の柄がある内側の曲線は前より滑らかになりました。しかし、剣の先端の曲線はまだ滑らかではありません。
 
@@ -349,11 +349,11 @@ SwordModel のプロパティの[Particle System]>[Source]>[Emitters
 
 2. ゲームを実行します。
 
-<p>
-<video autoplay loop class="responsive-video" poster="media/sword-slash-8.jpg">
-   <source src="media/sword-slash-8.mp4" type="video/mp4">
+<div class="ratio ratio-16x9 mb-3">
+<video autoplay controls loop preload="none" poster="media/sword-slash-8.jpg">
+<source src="media/sword-slash-8.mp4" type="video/mp4">
 </video>
-</p>
+</div>
 
 新しい問題が発生しています。パーティクル効果を剣の先端に移動したため、パーティクルが先端から飛び散っています。パーティクルの向きを逆にして、剣の刃に沿って柄の方に動くようにする必要があります。
 
@@ -363,11 +363,11 @@ SwordModel のプロパティの[Particle System]>[Source]>[Emitters
 
 7. ゲームを実行します。
 
-<p>
-<video autoplay loop class="responsive-video" poster="media/sword-slash-9.jpg">
-   <source src="media/sword-slash-9.mp4" type="video/mp4">
+<div class="ratio ratio-16x9 mb-3">
+<video autoplay controls loop preload="none" poster="media/sword-slash-9.jpg">
+<source src="media/sword-slash-9.mp4" type="video/mp4">
 </video>
-</p>
+</div>
 
 以上で終了です。残影効果を一から作成しました。後は自分でいろいろ試してください。
 
@@ -375,11 +375,11 @@ SwordModel のプロパティの[Particle System]>[Source]>[Emitters
 
 複数のパーティクル効果が組み合わせた、さらに精巧な残影の例を次に示します。
 
-<p>
-<video autoplay loop class="responsive-video" poster="media/sword-slash-10.jpg">
-   <source src="media/sword-slash-10.mp4" type="video/mp4">
+<div class="ratio ratio-16x9 mb-3">
+<video autoplay controls loop preload="none" poster="media/sword-slash-10.jpg">
+<source src="media/sword-slash-10.mp4" type="video/mp4">
 </video>
-</p>
+</div>
 
 動作を確認する場合は、[プロジェクト ファイルをダウンロード](media/MyTrailEffect.zip)して実行してみてください。
 

+ 2 - 2
jp/manual/particles/tutorials/particle-materials.md

@@ -314,9 +314,9 @@ class ParticleCustomShader : ParticleBase
 };
 ```
 
-ここでは 2 つの compose シェーダー `baseColor` と `abseIntensity` を定義しており、ここに RGB と A 用に生成されたシェーダーをそれぞれ挿入しています。すでに `VSMain`, `PSMain` ならびにテクスチャリング(textureing)を定義している `ParticleBase` を継承しており、非常にシンプルな `Shading()` メソッドを使用しています。
+ここでは 2 つの compose シェーダー `baseColor` と `baseIntensity` を定義しており、ここに RGB と A 用に生成されたシェーダーをそれぞれ挿入しています。すでに `VSMain`, `PSMain` ならびにテクスチャリング(textureing)を定義している `ParticleBase` を継承しており、非常にシンプルな `Shading()` メソッドを使用しています。
 <!--
-It defines two composed shaders, `baseColor` and `abseIntensity`, where we'll plug our generated shaders for RGB and A respectively. It inherits `ParticleBase` which already defines `VSMain`, `PSMain` and texturing, and uses very simple `Shading()` method.
+It defines two composed shaders, `baseColor` and `baseIntensity`, where we'll plug our generated shaders for RGB and A respectively. It inherits `ParticleBase` which already defines `VSMain`, `PSMain` and texturing, and uses very simple `Shading()` method.
 -->
 
 `Shading()` メソッドをオーバーライドすることで、カスタム動作を定義することができます。使用するコンポジット シェーダーは `ComputeColor` から派生したものなので、`Compute()` を使って簡単に評価することができ、色と強度の計算ツリーのルートを得ることができます。