diff --git a/docs/user-manual/graphics/lighting/clustered-lighting.md b/docs/user-manual/graphics/lighting/clustered-lighting.md
index e9814e1f352..e4fa0f27157 100644
--- a/docs/user-manual/graphics/lighting/clustered-lighting.md
+++ b/docs/user-manual/graphics/lighting/clustered-lighting.md
@@ -97,7 +97,7 @@ The main advantage of using manual subdivision is the level of detail that can b
### Shadows Type {#shadows-type}
-All lights that cast shadows use the same shadow type. This allows you to globally set the shadow softness and related performance impact. The supported options are PCF1, PCF3, and PCF5. For more information, see the [Shadows](/user-manual/graphics/lighting/shadows/#shadow-type) page.
+All lights that cast shadows use the same shadow type. This allows you to globally set the shadow softness and related performance impact. The supported options are PCF1, PCF3, and PCF5. For more information, see the [Shadows](/user-manual/graphics/lighting/shadows/#shadow-types) page.
## Limitations {#limitations}
diff --git a/docs/user-manual/graphics/lighting/shadows.md b/docs/user-manual/graphics/lighting/shadows.md
index c18f5e7af09..fcaf974e2c9 100644
--- a/docs/user-manual/graphics/lighting/shadows.md
+++ b/docs/user-manual/graphics/lighting/shadows.md
@@ -12,7 +12,7 @@ PlayCanvas renders real-time, dynamic shadows using a technique called shadow ma
## Enabling Shadows {#enabling-shadows}
-By default, shadow casting is disabled in PlayCanvas, so you have to explicitly enable it yourself. First, identify which lights in your scene should cast shadows — every light exposes a **Cast Shadows** option. You then choose which graphical objects cast and receive shadows: by default, all render and model components both cast and receive shadows, and you can toggle this per entity.
+By default, shadow casting is disabled in PlayCanvas, so you have to explicitly enable it yourself. First, identify which lights in your scene should cast shadows — every light exposes a **Cast Shadows** option. You then choose which graphical objects cast and receive shadows: by default, all render and model components both cast and receive shadows, and you can toggle this per entity. Gsplat components can also cast shadows — though not receive them — and for these, shadow casting is disabled by default.
@@ -25,6 +25,9 @@ entity.light.castShadows = true;
// toggle per entity as needed
meshEntity.render.castShadows = true;
meshEntity.render.receiveShadows = true;
+
+// Gsplat entities can cast shadows too (off by default)
+splatEntity.gsplat.castShadows = true;
```
@@ -32,7 +35,7 @@ meshEntity.render.receiveShadows = true;
Select a light in the Hierarchy and enable **Cast Shadows** in its [Light Component](/user-manual/editor/scenes/components/light).
-To control which objects participate, select an entity and toggle the **Cast Shadows** / **Receive Shadows** options on its [render](/user-manual/editor/scenes/components/render) or [model](/user-manual/editor/scenes/components/model) component.
+To control which objects participate, select an entity and toggle the **Cast Shadows** / **Receive Shadows** options on its [render](/user-manual/editor/scenes/components/render) or [model](/user-manual/editor/scenes/components/model) component, or enable **Cast Shadows** on its [gsplat](/user-manual/editor/scenes/components/gsplat) component.
@@ -47,6 +50,11 @@ To control which objects participate, select an entity and toggle the **Cast Sha
+
+// GSplat components can cast shadows too (off by default)
+
+
+
```
@@ -62,12 +70,17 @@ To control which objects participate, select an entity and toggle the **Cast Sha
+
+
+
+
+
```
-## Shadow Type {#shadow-type}
+## Shadow Types {#shadow-types}
The technique used to filter a light's shadows — trading off edge softness, quality, and performance — is chosen per light. PlayCanvas offers three filtering techniques:
@@ -242,31 +255,15 @@ import { SHADOW_PCSS_32F } from 'playcanvas';
The shadow mapping technique used by PlayCanvas has only finite resolution. Therefore, you may need to tune some values to make them look as good as possible. Each property below can be set in the [Light Component](/user-manual/editor/scenes/components/light) UI in the Editor, or on the light component in code (`entity.light.*`).
-### Shadow Distance {#shadow-distance}
-
-The shadow distance (`light.shadowDistance`) is the distance from the viewpoint beyond which directional light shadows are no longer rendered. The smaller this value, the crisper your shadows will be. The problem is that the viewer will be able to see the shadows suddenly appear as the viewpoint moves around the scene. Therefore, you should balance this value based on how far the player can see into the distance and generally what looks good.
-
-### Shadow Intensity {#shadow-intensity}
-
-The intensity of the shadow (`light.shadowIntensity`), where 1 represents full intensity shadow cast by this light, and 0 represents no shadow.
-
-
-
### Shadow Resolution {#shadow-resolution}
Every light casts shadows via a shadow map. This shadow map (`light.shadowResolution`) can range from 16x16 up to 4096x4096, and this value is also set in the light component's interface. The higher the resolution, the crisper the shadows. However, higher resolution shadows are more expensive to render so be sure to balance performance against quality.
-### Shadow Bias {#shadow-bias}
-
-Shadow mapping can be prone to rendering artifacts that can look very ugly. If you notice bands of shadow or speckled patches where you do not expect, you should try tuning the shadow bias (`light.shadowBias`) to resolve the problem.
-
-### Normal Offset Bias {#normal-offset-bias}
-
-'Shadow acne' artifacts are a big problem and the shadow bias can eliminate them quite effectively. Unfortunately, this always introduces some level of 'Peter Panning', the phenomenon where shadows make an object appear to be floating in mid-air.
+### Shadow Distance {#shadow-distance}
-The Normal Offset Bias (`light.normalOffsetBias`) solves this problem. In addition to using the depth bias, we can avoid both shadow acne and Peter Panning by making small tweaks to the UV coordinates used in the shadow map look-up. A fragment's position is offset along its geometric normal. This "Normal Offset" technique yields vastly superior results to a constant shadow bias only approach.
+The shadow distance (`light.shadowDistance`) is the distance from the viewpoint beyond which directional light shadows are no longer rendered. The smaller this value, the crisper your shadows will be. The problem is that the viewer will be able to see the shadows suddenly appear as the viewpoint moves around the scene. Therefore, you should balance this value based on how far the player can see into the distance and generally what looks good.
-## Shadow Cascades {#shadow-cascades}
+### Shadow Cascades {#shadow-cascades}
When a directional shadow is used over a large area, it often exhibits aliasing, where a shadow near the camera has a low resolution. Capturing the shadow in a single shadow map requires very high and impractical resolution to improve this.
@@ -274,11 +271,7 @@ Shadow cascades help to fix this problem by splitting the camera view frustum al
Note that the number of shadow cascades has an effect on performance, as each shadow casting mesh might need to be rendered into more than a single shadow map.
-The following properties can be used to set up shadow cascades.
-
-### Number of cascades {#number-of-cascades}
-
-Number of cascades (`light.numCascades`) represents the number of view frustum subdivisions, and can be 1, 2, 3 or 4. The default value of 1 represents a single shadow map.
+The number of cascades (`light.numCascades`) represents the number of view frustum subdivisions, and can be 1, 2, 3 or 4. The default value of 1 represents a single shadow map.
A screenshot showing a single shadow cascade.
@@ -288,16 +281,34 @@ A screenshot showing four shadow cascades.

-### Distribution of cascades {#distribution-of-cascades}
-
The distribution (`light.cascadeDistribution`) of subdivision of the camera frustum for individual shadow cascades. A value in the range of 0 to 1 can be specified. A value of 0 represents a linear distribution and a value of 1 represents a logarithmic distribution. Visually, a higher value distributes more shadow map resolution to foreground objects, while a lower value distributes it to more distant objects.
+### Shadow Intensity {#shadow-intensity}
+
+The intensity of the shadow (`light.shadowIntensity`), where 1 represents full intensity shadow cast by this light, and 0 represents no shadow.
+
+
+
+## Fixing Shadow Artifacts {#fixing-shadow-artifacts}
+
+Shadow mapping can be prone to rendering artifacts that can look very ugly. The properties below can help you eliminate them.
+
+### Shadow Bias {#shadow-bias}
+
+If you notice bands of shadow or speckled patches where you do not expect, you should try tuning the shadow bias (`light.shadowBias`) to resolve the problem.
+
+### Normal Offset Bias {#normal-offset-bias}
+
+'Shadow acne' artifacts are a big problem and the shadow bias can eliminate them quite effectively. Unfortunately, this always introduces some level of 'Peter Panning', the phenomenon where shadows make an object appear to be floating in mid-air.
+
+The Normal Offset Bias (`light.normalOffsetBias`) solves this problem. In addition to using the depth bias, we can avoid both shadow acne and Peter Panning by making small tweaks to the UV coordinates used in the shadow map look-up. A fragment's position is offset along its geometric normal. This "Normal Offset" technique yields vastly superior results to a constant shadow bias only approach.
+
## Performance Considerations {#performance-considerations}
Enabling shadows has performance implications:
* For each shadow casting directional or spot light, the scene must be rendered once into a shadow map every frame. Omni light shadows are far more expensive since the scene is rendered six times per light (the shadow map is stored as a 6-sided cube map). Rendering the scene into shadow maps places load on both the CPU and the GPU.
* Using a greater shadow map resolution will generate crisper shadows but the GPU must fill more shadow map pixels and therefore this may affect frame rate.
-* The [shadow type](#shadow-type) affects cost: larger PCF kernels, VSM blurring, and especially PCSS (which takes many samples per pixel) are more expensive on the GPU than a hard, single-sample shadow.
+* The [shadow type](#shadow-types) affects cost: larger PCF kernels, VSM blurring, and especially PCSS (which takes many samples per pixel) are more expensive on the GPU than a hard, single-sample shadow.
* For directional lights, each additional [shadow cascade](#shadow-cascades) may require shadow casters to be rendered into more than one shadow map, increasing cost.
* If your shadows are from static parts of the environment consider using [lightmaps](/user-manual/graphics/lighting/lightmapping) to bake shadows into textures.
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/graphics/lighting/clustered-lighting.md b/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/graphics/lighting/clustered-lighting.md
index 71c3781eb0c..c4b12ad3cca 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/graphics/lighting/clustered-lighting.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/graphics/lighting/clustered-lighting.md
@@ -97,7 +97,7 @@ Clustered Lightingシェーダーは、サポートされるすべてのライ
### シャドウタイプ {#shadows-type}
-影を投影する全てのライトは同じシャドウタイプを使用します。これにより、シャドウのソフトネスと関連するパフォーマンス影響をグローバルに設定することができます。サポートされているオプションはPCF1、PCF3、PCF5です。詳細は、[Shadows](/user-manual/graphics/lighting/shadows/#shadow-type)ページをご覧ください。
+影を投影する全てのライトは同じシャドウタイプを使用します。これにより、シャドウのソフトネスと関連するパフォーマンス影響をグローバルに設定することができます。サポートされているオプションはPCF1、PCF3、PCF5です。詳細は、[Shadows](/user-manual/graphics/lighting/shadows/#shadow-types)ページをご覧ください。
## 制限事項 {#limitations}
diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/graphics/lighting/shadows.md b/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/graphics/lighting/shadows.md
index 2d7292cd398..d5744340b27 100644
--- a/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/graphics/lighting/shadows.md
+++ b/i18n/ja/docusaurus-plugin-content-docs/current/user-manual/graphics/lighting/shadows.md
@@ -12,7 +12,7 @@ PlayCanvas は、シャドウマッピングと呼ばれる技術を使用して
## シャドウの有効化 {#enabling-shadows}
-デフォルトでは、PlayCanvasではシャドウキャストは無効になっているため、自分で明示的に有効にする必要があります。まず、シーンでシャドウをキャストするライトを特定します。各ライトには「Cast Shadows」というオプションがあります。次に、どのグラフィカルオブジェクトがシャドウをキャストおよび受信するかを選択します。デフォルトでは、すべての render および model コンポーネントがシャドウをキャストおよび受信し、エンティティごとに切り替えることができます。
+デフォルトでは、PlayCanvasではシャドウキャストは無効になっているため、自分で明示的に有効にする必要があります。まず、シーンでシャドウをキャストするライトを特定します。各ライトには「Cast Shadows」というオプションがあります。次に、どのグラフィカルオブジェクトがシャドウをキャストおよび受信するかを選択します。デフォルトでは、すべての render および model コンポーネントがシャドウをキャストおよび受信し、エンティティごとに切り替えることができます。gsplat コンポーネントもシャドウをキャストできますが(受信はできません)、こちらはデフォルトで無効になっています。
@@ -25,6 +25,9 @@ entity.light.castShadows = true;
// 必要に応じてエンティティごとに切り替えます
meshEntity.render.castShadows = true;
meshEntity.render.receiveShadows = true;
+
+// Gsplat エンティティもシャドウをキャストできます(デフォルトでは無効)
+splatEntity.gsplat.castShadows = true;
```
@@ -32,7 +35,7 @@ meshEntity.render.receiveShadows = true;
Hierarchyでライトを選択し、その[Lightコンポーネント](/user-manual/editor/scenes/components/light)で **Cast Shadows** を有効にします。
-どのオブジェクトが対象になるかを制御するには、エンティティを選択し、その [render](/user-manual/editor/scenes/components/render) または [model](/user-manual/editor/scenes/components/model) コンポーネントの **Cast Shadows** / **Receive Shadows** オプションを切り替えます。
+どのオブジェクトが対象になるかを制御するには、エンティティを選択し、その [render](/user-manual/editor/scenes/components/render) または [model](/user-manual/editor/scenes/components/model) コンポーネントの **Cast Shadows** / **Receive Shadows** オプションを切り替えるか、[gsplat](/user-manual/editor/scenes/components/gsplat) コンポーネントの **Cast Shadows** を有効にします。
@@ -47,6 +50,11 @@ Hierarchyでライトを選択し、その[Lightコンポーネント](/user-man
+
+// GSplat コンポーネントもシャドウをキャストできます(デフォルトでは無効)
+
+
+
```
@@ -62,12 +70,17 @@ Hierarchyでライトを選択し、その[Lightコンポーネント](/user-man
+
+
+
+
+
```
-## シャドウタイプ {#shadow-type}
+## シャドウタイプ {#shadow-types}
ライトのシャドウをフィルタリングする技術(エッジの柔らかさ、品質、パフォーマンスのトレードオフ)は、ライトごとに選択します。PlayCanvas には3つのフィルタリング技術があります。
@@ -242,31 +255,15 @@ import { SHADOW_PCSS_32F } from 'playcanvas';
PlayCanvasが使用するシャドウマッピング技術には有限の解像度しかありません。そのため、できるだけ見栄え良くするために、いくつかの値を調整する必要があります。以下の各プロパティは、Editorの[Lightコンポーネント](/user-manual/editor/scenes/components/light)のUIで設定するか、コードでライトコンポーネント(`entity.light.*`)に設定できます。
-### シャドウ距離 {#shadow-distance}
-
-シャドウ距離(`light.shadowDistance`)は、ビューポイントから遠くの方向性ライトのシャドウがレンダリングされなくなる距離です。この値が小さいほど、シャドウがより鮮明になります。問題は、ビューポイントがシーンを移動すると、見る人が影が突然現れるのを見ることができるということです。したがって、この値は、プレイヤーが遠くまで見ることができる距離と一般的にどちらが良いかに基づいてバランスを取る必要があります。
-
-### シャドウ強度 {#shadow-intensity}
-
-このライトによってキャストされる、1を完全な強度のシャドウ、0をシャドウのないものとするシャドウの強度(`light.shadowIntensity`)。
-
-
-
### シャドウ解像度 {#shadow-resolution}
すべてのライトは、シャドウマップを介してシャドウをキャストします。このシャドウマップ(`light.shadowResolution`)は、16x16 から 4096x4096 までの解像度になり、この値もLightコンポーネントのインターフェイスで設定されます。解像度が高いほど、シャドウがより鮮明になります。ただし、解像度が高いほど、シャドウをレンダリングするために負荷がかかり、フレームレートに影響を与える可能性があります。
-### シャドウバイアス {#shadow-bias}
-
-シャドウマッピングは、非常に醜い外観のレンダリングアーティファクトが発生する可能性があります。影の帯や、期待しない場所に斑点状のパッチがある場合は、シャドウバイアス(`light.shadowBias`)を調整して問題を解決する必要があります。
-
-### 法線オフセットバイアス {#normal-offset-bias}
-
-「影の吹き出物」は大きな問題ですが、シャドウバイアスを使用することで効果的に解決できます。残念ながら、これにより常に「ピーターパン」現象が発生します。それは、影によってオブジェクトが空中に浮いているように見える現象です。
+### シャドウ距離 {#shadow-distance}
-法線オフセットバイアス(`light.normalOffsetBias`)は、この問題を解決します。深度バイアスを使用するだけでなく、シャドウマップルックアップに使用されるUV座標をわずかに調整することで、シャドウの吹き出物とピーターパンを回避できます。フラグメントの位置は、そのジオメトリの法線に沿ってオフセットされます。この「法線オフセット」技術は、定数シャドウバイアスのみを使用するアプローチよりもはるかに優れた結果をもたらします。
+シャドウ距離(`light.shadowDistance`)は、ビューポイントから遠くの方向性ライトのシャドウがレンダリングされなくなる距離です。この値が小さいほど、シャドウがより鮮明になります。問題は、ビューポイントがシーンを移動すると、見る人が影が突然現れるのを見ることができるということです。したがって、この値は、プレイヤーが遠くまで見ることができる距離と一般的にどちらが良いかに基づいてバランスを取る必要があります。
-## シャドウカスケード {#shadow-cascades}
+### シャドウカスケード {#shadow-cascades}
大面積の方向性シャドウを使用すると、しばしばエイリアシングが発生し、カメラの近くの影が低解像度になることがあります。単一のシャドウマップで影をキャプチャするには、この問題を改善するために非常に高い解像度が必要ですが、実用的ではありません。
@@ -274,10 +271,6 @@ PlayCanvasが使用するシャドウマッピング技術には有限の解像
ただし、シャドウキャスティングメッシュの数に影響を与えるため、シャドウカスケードの数はパフォーマンスに影響を与えます。
-次のプロパティを使用して、シャドウカスケードを設定できます。
-
-### カスケード数 {#number-of-cascades}
-
カスケード数(`light.numCascades`)は、ビューフラスタムの分割数を表し、1、2、3、4の値が設定できます。既定値の1は、単一のシャドウマップを表します。
単一のシャドウカスケードを示すスクリーンショット。
@@ -288,16 +281,34 @@ PlayCanvasが使用するシャドウマッピング技術には有限の解像

-### カスケードの分布 {#distribution-of-cascades}
-
個々のシャドウカスケードのカメラフラスタムのサブディビジョンの分布(`light.cascadeDistribution`)。0から1の値を指定できます。値0は線形分布を表し、値1は対数分布を表します。ビジュアル的には、値が高いほど、前景オブジェクトにシャドウマップ解像度がより多く割り当てられ、値が低いほど、遠くのオブジェクトに割り当てられます。
+### シャドウ強度 {#shadow-intensity}
+
+このライトによってキャストされる、1を完全な強度のシャドウ、0をシャドウのないものとするシャドウの強度(`light.shadowIntensity`)。
+
+
+
+## シャドウアーティファクトの解消 {#fixing-shadow-artifacts}
+
+シャドウマッピングは、非常に醜い外観のレンダリングアーティファクトが発生する可能性があります。以下のプロパティは、それらの解消に役立ちます。
+
+### シャドウバイアス {#shadow-bias}
+
+影の帯や、期待しない場所に斑点状のパッチがある場合は、シャドウバイアス(`light.shadowBias`)を調整して問題を解決する必要があります。
+
+### 法線オフセットバイアス {#normal-offset-bias}
+
+「影の吹き出物」は大きな問題ですが、シャドウバイアスを使用することで効果的に解決できます。残念ながら、これにより常に「ピーターパン」現象が発生します。それは、影によってオブジェクトが空中に浮いているように見える現象です。
+
+法線オフセットバイアス(`light.normalOffsetBias`)は、この問題を解決します。深度バイアスを使用するだけでなく、シャドウマップルックアップに使用されるUV座標をわずかに調整することで、シャドウの吹き出物とピーターパンを回避できます。フラグメントの位置は、そのジオメトリの法線に沿ってオフセットされます。この「法線オフセット」技術は、定数シャドウバイアスのみを使用するアプローチよりもはるかに優れた結果をもたらします。
+
## パフォーマンスに関する考慮事項 {#performance-considerations}
影を使用すると、パフォーマンスに以下のような影響があります:
* 指向性またはスポットライトを落とすそれぞれの影のために、すべてのフレームで一度シーンをシャドウマップにレンダリングする必要があります。ポイントライトの場合はシーンがライトごとに6回レンダリングされるので(シャドウマップが6面のキューブマップとして保存される)、負荷が大きくなります。シャドウマップの中にシーンをレンダリングすると、CPUとGPUの両方に負荷を加えます。
* シャドウマップの解像度を上げるとより鮮明な影を生成しますが、GPUはより多くのシャドウマップピクセルを埋める必要があり、フレームレートに影響を与える可能性があります。
-* [シャドウタイプ](#shadow-type)はコストに影響します。大きな PCF カーネル、VSM のブラー、特に PCSS(ピクセルごとに多数のサンプルを取得)は、ハードな単一サンプルのシャドウよりも GPU 負荷が高くなります。
+* [シャドウタイプ](#shadow-types)はコストに影響します。大きな PCF カーネル、VSM のブラー、特に PCSS(ピクセルごとに多数のサンプルを取得)は、ハードな単一サンプルのシャドウよりも GPU 負荷が高くなります。
* Directional ライトでは、[シャドウカスケード](#shadow-cascades)を追加するごとに、シャドウキャスターが複数のシャドウマップにレンダリングされる場合があり、コストが増加します。
* 影が環境の静的な部分から発生している場合は、[ライトマップ](/user-manual/graphics/lighting/lightmapping)を使用してテクスチャに影をbakeすることを検討してください。