Version: 2022.3
言語: 日本語
Mesh コンポーネント
Skinned Mesh Renderer コンポーネント

Mesh Renderer コンポーネント

Mesh Renderer コンポーネントはメッシュをレンダリングします。Mesh Renderer は同じゲームオブジェクト上の Mesh Filter コンポーネントと連動し、Mesh Filter が参照するメッシュを描画します。

可変 (deformable) メッシュをレンダリングするには、代わりに Skinned Mesh Renderer を使用します。

C# コードでは、MeshRenderer クラスは、Mesh Renderer コンポーネントを表します。 MeshRenderer クラスは、その機能の多くをRenderer クラスから継承しています。そのため、このコンポーネントは Renderer を継承する他のコンポーネント、例えば Line RendererTrail Renderer などと多くの共通点があります。

Mesh Renderer Inspector リファレンス

Inspector ウィンドウに表示された Mesh Renderer コンポーネント。 Receive Global Illumination は Lightmaps に設定。
Inspector ウィンドウに表示された Mesh Renderer コンポーネント。 Receive Global IlluminationLightmaps に設定。

A: Materials
B: Lighting
C: Lightmapping
D: Probes
E: Additional Settings

Materials

Material セクション
Material セクション

Materials セクションには、このコンポーネントが使用するすべての マテリアル が列挙されています。

プロパティ 説明
Size The number of elements in the material list.

If you decrease the number of elements, Unity deletes the elements at the end of the list. If you increase the number of elements, Unity adds new elements to the end of the list. Unity populates new elements with the same material that the element at the end of the list uses.
Element The materials in the list. You can assign a material asset to each element.

By default, Unity orders the list alphabetically based on the name of the materials. This list is reorderable, and Unity updates the number of the elements automatically as you change their order.

ノート: サブメッシュの数よりもマテリアルの数が多い場合、Unity は最後のサブメッシュを残っている各マテリアルでレンダリングし、1 つずつ重ねていきます。マテリアルが完全に不透明でない場合、さまざまなマテリアルを重ねて、興味深い視覚効果を作成できます。ただし、完全に不透明なマテリアルは前のレイヤーを上書きします。そのため、Unity が最後のサブメッシュに不透明なマテリアルを加えると、パフォーマンスに悪い影響があり、メリットがありません。

Lighting

Lighting セクションには、ライティングに関連するプロパティを含まれています。

プロパティ 説明
Cast Shadows Specify if and how this Renderer casts shadows when a suitable Light shines on it.

This property corresponds to the Renderer.shadowCastingMode API.
On This Renderer casts a shadow when a shadow-casting Light shines on it.
Off This Renderer does not cast shadows.
Two-sided This Renderer casts two-sided shadows. This means that single-sided objects like a plane or a quad can cast shadows, even if the light source is behind the mesh.

For Baked Global Illumination or Enlighten Realtime Global Illumination to support two-sided shadows, the material must support Double Sided Global Illumination.
Shadows Only This Renderer casts shadows, but the Renderer itself isn’t visible.
Receive Shadows Specify if Unity displays shadows cast onto this Renderer.

This property only has an effect if you enable Baked Global Illumination or Enlighten Realtime Global Illumination for this scene.

This property corresponds to the Renderer.receiveShadows API.
Contribute Global Illumination Include this Renderer in global illumination calculations, which take place at bake time.

This property only has an effect if you enable Baked Global Illumination or Enlighten Realtime Global Illumination for this scene.

Enabling this property enables the Contribute GI flag in the GameObject’s Static Editor Flags. It corresponds to the StaticEditorFlags.ContributeGI API.
Receive Global Illumination Whether Unity provides global illumination data to this Renderer from baked lightmaps, or from runtime Light Probes.

This property is only editable if you enable Contribute Global Illumination. It only has an effect if you enable Baked Global Illumination or Enlighten Realtime Global Illumination for this scene.

This property corresponds to the MeshRenderer.receiveGI API.
Lightmaps Unity provides global illumination data to this Renderer from lightmaps.
Light Probes Unity provides global illumination data to this Renderer from Light Probes in the scene.
Prioritize Illumination Enable this property to always include this Renderer in Enlighten Realtime Global Illumination calculations. This ensures that the Renderer is affected by distant emissives, even those which are normally excluded from Global Illumination calculations for performance reasons.

This property is visible only if Contribute GI is enabled in the GameObject’s Static Editor Flags, your project uses the Built-in Render Pipeline, and Enlighten Realtime Global Illumination is enabled in your scene.

Lightmapping

Lightmapping セクションには、ベイクしたライトマップとリアルタイムのライトマップに関連するプロパティが含まれています。

このセクションは、Receive Global IlluminationLightmaps に設定されている場合にのみ表示されます 。

プロパティ 機能
Scale in Lightmap ライトマップ内のレンダラーの UV の相対的なサイズを指定します。

値が 0 の場合、レンダラーはライトマップに含まれませんが、シーン内の他のレンダラーのライティングに影響します。1.0 より大きい値は、このオブジェクトに使用されるピクセル数 (ライトマップ解像度) を増加させ、1.0 未満の場合はピクセル数を減少させます。

このプロパティを使用してライトマップを最適化し、重要で詳細に表現したい領域がより正確にライティングされるようにすることができます。例えば、平らで暗い壁を持つ孤立した建物では、低いライトマップスケール (1.0 未満) を使用しますが、カラフルなオートバイコレクションが 1 か所に集められて展示してある場面では、高いスケール値が必要です。
Stitch Seams このレンダラーの ライトマップの継ぎ目の縫合 を有効化します。

このプロパティは MeshRenderer.stitchLightmapSeams API に対応します。
Lightmap Parameters こレンダラーの Lightmap Parameters アセットを選択または作成します。
Optimize Realtime UVs こレンダラーに対して リアルタイムライトマップ UV をマージするかどうかを決定します。

このプロパティは、プロジェクトがビルトインレンダーパイプラインを使用し、シーンで Enlighten の Realtime Global Illumination が有効になっている場合にのみ表示されます。
Max Distance リアルタイムのライトマップで UV チャートの簡略化に使用される最大ワールド空間距離を指定します。チャートがこの距離内の場合は、チャートは簡略化されます。

このプロパティは、プロジェクトでビルトインレンダーパイプラインが使用されており、Enlighten の Realtime Global Illumination がシーンで有効になっている場合にのみ表示されます。
Max Angle リアルタイムのライトマップで UV エッジを共有する面の間の最大角 (度) を指定します。面の間の角がこの値より小さい時は、UV チャートは簡略化されます。

このプロパティは、プロジェクトでビルトインレンダーパイプラインが使用されており、Enlighten の Realtime Global Illumination がシーンで有効になっている場合にのみ表示されます。
Ignore Normals これを有効にすると、リアルタイムのライトマップの UV チャートが分割されるのを防ぎます。

このプロパティは、プロジェクトでビルトインレンダーパイプラインが使用されており、Enlighten の Realtime Global Illumination がシーンで有効になっている場合にのみ表示されます。
Min Chart Size リアルタイムのライトマップの UV チャートに使用する最小テクセルサイズを指定します。ステッチが必要な場合は、値を 4 にすると 4x4 テクセルのチャートを作り、ライティングと指向性を格納します。ステッチが不要な場合は、値を 2 にするとテクセルの密度を減らし、ライティングのビルド時間を短縮しゲームパフォーマンスを向上させます。

このプロパティは、プロジェクトでビルトインレンダーパイプラインが使用されており、Enlighten の Realtime Global Illumination がシーンで有効になっている場合にのみ表示されます。

ライティングデータをベイクした場合 (メニュー: Window > Rendering > Lighting > Generate Lighting)、このセクションには、このレンダラーが使用する現際のシーンのベイクしたライトマップとリアルタイムのライトマップも表示されます。

ベイク後にシーンに表示されるライトマップの例
ベイク後にシーンに表示されるライトマップの例

Probes

Probes セクションには、ライトプローブリフレクションプローブ に関するプロパティが含まれています。

プロパティ 説明
Light Probes Set how this Renderer receives light from the Light Probes system.

This property corresponds to the Renderer.lightProbeUsage API.
Off The Renderer doesn’t use any interpolated Light Probes.
Blend Probes The Renderer uses one interpolated Light Probe. This is the default value.
Use Proxy Volume The Renderer uses a 3D grid of interpolated Light Probes.
Custom Provided The Renderer extracts Light Probe shader uniform values from the MaterialPropertyBlock.
Proxy Volume Override Set a reference to another GameObject that has a Light Probe Proxy Volume component.

This property is only visible when Light Probes is set to Use Proxy Volume.
Reflection Probes Set how the Renderer receives reflections from the Reflection Probe system.

This property corresponds to the Renderer.probeAnchor API.
Off Disables Reflection Probes. Unity uses a skybox for reflection.
Blend Probes Enables Reflection Probes. Blending occurs only between Reflection Probes. This is useful in indoor environments where the character may transition between areas with different lighting settings.
Blend Probes and Skybox Enables Reflection Probes. Blending occurs between Reflection Probes, or between Reflection Probes and the default reflection. This is useful for outdoor environments.
Simple Enables Reflection Probes, but no blending occurs between Reflection Probes when there are two overlapping volumes.
Anchor Override Set the Transform that Unity uses to determine the interpolation position when using the Light Probe or Reflection Probe systems. By default, this is the centre of the bounding box of the Renderer’s geometry.

This property corresponds to the Renderer.probeAnchor API.

Additional Settings

Additional Settings には付加的なプロパティが含まれています。

プロパティ 説明
Motion Vectors Set whether to use motion vectors to track this Renderer’s per-pixel, screen-space motion from one frame to the next. You can use this information to apply post-processing effects such as motion blur.

Note: not all platforms support motion vectors. See SystemInfo.supportsMotionVectors for more information.

This property corresponds to the Renderer.motionVectorGenerationMode API.
Camera Motion Only Use only Camera movement to track motion.
Per Object Motion Use a specific pass to track motion for this Renderer.
Force No Motion Do not track motion.
Dynamic Occlusion When Dynamic Occlusion is enabled, Unity’s occlusion culling system culls this Renderer when it is blocked from a Camera’s view by a Static Occluder. Otherwise, the system does not cull this Renderer when it is blocked from a Camera’s view by a Static Occluder.

Dynamic Occlusion is enabled by default. Disable it for effects such as drawing the outline of a character behind a wall.

MeshRenderer

Mesh コンポーネント
Skinned Mesh Renderer コンポーネント