# Nanite Foliage の Voxel 用マテリアルでのエラーについて 

**URL:** <https://forums.unrealengine.com/t/nanite-foliage-voxel/2856137>\
**Category:** 日本語 (Japanese)\
**Tags:** unreal-engine, Epic-Pro-Support, question\
**Created:** [September 28, 2026, 9:00am UTC](https://forums.unrealengine.com/t/nanite-foliage-voxel/2856137 "2026-09-28T09:00:32Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [September 28, 2026, 9:00am UTC](https://forums.unrealengine.com/t/nanite-foliage-voxel/2856137/1 "2026-09-28T09:00:32Z")

</div>

お世話になっております。

Nanite Foliage の Voxel 機能のテストをしております。

​

そこでマテリアルエディターの Usage 欄で

Used with Nanite

Used with Voxels

のチェックを入れました。

この時

Used with Static Lighting

にチェックが入っていると下記のようなエラーが出ます。

そこでお尋ねします。

現状この機能は Experimental ですのでめエラーが出ることには承知しております。

将来的に対応されるのかどうかについて情報がありますと助かります。

よろしくお願いいたします。

```auto
[SM6] Internal Error!
	.../Default/FNaniteVertexFactory/TBasePassCSTDistanceFieldShadowsAndLightMapPolicyHQVoxel/1:/Engine/Private/BasePassPixelShader.usf|MainCS VF 'FNaniteVertexFactory' Type 'TBasePassCSTDistanceFieldShadowsAndLightMapPolicyHQVoxel' '/Engine/Private/BasePassPixelShader.usf' Entry 'MainCS' Permutation 1 

[SM6] Internal Error!
	.../Default/FNaniteVertexFactory/TBasePassCSTLightMapPolicyHQVoxel/1:/Engine/Private/BasePassPixelShader.usf|MainCS VF 'FNaniteVertexFactory' Type 'TBasePassCSTLightMapPolicyHQVoxel' '/Engine/Private/BasePassPixelShader.usf' Entry 'MainCS' Permutation 1 

[SM6] Internal Error!
	.../Default/FNaniteVertexFactory/TBasePassCSTLightMapPolicyLQVoxel/1:/Engine/Private/BasePassPixelShader.usf|MainCS VF 'FNaniteVertexFactory' Type 'TBasePassCSTLightMapPolicyLQVoxel' '/Engine/Private/BasePassPixelShader.usf' Entry 'MainCS' Permutation 1 

```

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [September 28, 2026, 9:00am UTC](https://forums.unrealengine.com/t/nanite-foliage-voxel/2856137/2 "2026-09-28T09:00:36Z")

</div>

**再現手順**  
エディターにて新規にマテリアルを作成します。

デフォルトのまま Usage 欄において

Used with Static Lighting

Used with Nanite

Used with Voxels

の 3 つにチェックを入れます。

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![Takashi.Suzuki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Takashi.Suzuki](https://forums.unrealengine.com/u/Takashi.Suzuki)\
**Post date:** [September 29, 2026, 5:38pm UTC](https://forums.unrealengine.com/t/nanite-foliage-voxel/2856137/3 "2026-09-29T17:38:36Z")

</div>

再現手順でマテリアルを作成してみましたがエラーが再現できていません。

こちらでは NaniteFoliage及びStaticLightingを有効化して、再現手順を踏みましたがログに出ているシェーダーもコンパイルが成功しました。

この状態で実際にレベルにライトビルドを適用しライトマップが適用されたメッシュのVoxel描画ができることを確認しています。

恐らく設定やエンジンなどに差があるのかもしれません。こちらではUE5.8.3ソースからビルドしたもので、ThirdPersonTempleteのBP版に上記設定を適用して確認しています。

なにか設定等に差があればご共有ください。またバニラエンジン及び新規作成したプロジェクトで問題がでるかも確認いただけますと問題の切り分けに役立ちます。

さらにShaderDebugInfoを出力されていたら対象のマテリアルのShaderDebugInfoをご共有いただけると幸いです。

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![Takashi.Suzuki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Takashi.Suzuki](https://forums.unrealengine.com/u/Takashi.Suzuki)\
**Post date:** [October 5, 2026, 4:51pm UTC](https://forums.unrealengine.com/t/nanite-foliage-voxel/2856137/4 "2026-10-05T16:51:35Z")

</div>

エラー位置から解析したところ、 **r.Shaders.Optimize=0の時のみ** 、VoxelのLightMapCoordinateを計算している NaniteVertexFactory.ush:959 でのVerts[1],Verts[2]へのアクセスが配列外参照ととなり中間言語DXILでエラーがでるようです。この動作はUE5.8.0でもUE5.8.3での同じです。

恐らくConsoleVariables.iniのr.Shader.Optimize=0が適用される状態のままになっていると考えられます。一度ご確認いただけますでしょうか。

ワークアラウンドとしては上記のusfファイルの位置の配列アクセスを以下の様な形でクランプすることが機能しますが、

`uint3(Verts[0].VertIndex, Verts[min(1u, N - 1)].VertIndex, Verts[min(2u, N - 1)].VertIndex)`一旦このUsageの組み合わせのマテリアルが本当に必要かどうか検討をお願いします。

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![Takashi.Suzuki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Takashi.Suzuki](https://forums.unrealengine.com/u/Takashi.Suzuki)\
**Post date:** [October 8, 2026, 8:38am UTC](https://forums.unrealengine.com/t/nanite-foliage-voxel/2856137/5 "2026-10-08T08:38:28Z")

</div>

Optimize=1でも再現している旨承知しました。

確認のために、もし残っていたら該当マテリアルのダンプしたシェーダーデバッグインフォの出力フォルダをいただくことは可能でしょうか？

もしかすると、いくつかのポストで添付ファイルが含まれているような表示が本トピックにあるのでアップロードいただいている可能性がございますが、なんらかの理由で削除されてしまっているようです。

当面のワークアラウンドとしては前回のポストにあるようにボクセル用のシェーダーでの範囲外アクセスをケアするのが適切です。

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 9, 2026, 1:08am UTC](https://forums.unrealengine.com/t/nanite-foliage-voxel/2856137/6 "2026-10-09T01:08:58Z")

</div>

お返事ありがとうございます。

いただいた修正方法で回避いたします。

ShaderDebugInfo を固めたファイルを添付いたします。

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![Takashi.Suzuki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Takashi.Suzuki](https://forums.unrealengine.com/u/Takashi.Suzuki)\
**Post date:** [October 13, 2026, 8:48am UTC](https://forums.unrealengine.com/t/nanite-foliage-voxel/2856137/7 "2026-10-13T08:48:42Z")

</div>

ShaderDebugInfo​のアップロードありがとうございます。

出力されているシェーダーから ​ USES\_BASE\_PASS\_VELOCITY と PIXELSHADEROUTPUT\_MRT4 が付与されていることが分かりました。

これらは ​ r.VelocityOutputPass=1 がiniに記述されていると追加されます。実際にこちらのiniに追加した所問題が再現しました。

恐らく貴プロジェクトではこれがiniに追記されていると思われます。間違いないかご確認ください。

​

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 14, 2026, 8:54am UTC](https://forums.unrealengine.com/t/nanite-foliage-voxel/2856137/8 "2026-10-14T08:54:58Z")

</div>

解析ありがとうございます。

はい r.VelocityOutputPass=1 を記述しています。

これは r.VelocityOutputPass=0 の状態で Velocity Pass の負荷が大きく問題になったため設定しました。

MRT 枚数が増えていることや今回の問題の発生源になっているとのこと、もし非推奨の設定でしたら別の設定を検討しようと思います。

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![Takashi.Suzuki](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Takashi.Suzuki](https://forums.unrealengine.com/u/Takashi.Suzuki)\
**Post date:** [October 16, 2026, 6:47am UTC](https://forums.unrealengine.com/t/nanite-foliage-voxel/2856137/9 "2026-10-16T06:47:27Z")

</div>

ご確認ありがとうございます。完全な再現手順が得られたので UE-403591 Nanite Voxel material with Static Lighting fails shader compile when r.VelocityOutputPass=1 としてバグ登録しました。

VelocityOutputPassが引き金にはなっておりますが、この設定自体は非推奨ではありません。ワークアラウンドを適用してご利用ください。

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 1, 2026, 9:17am UTC](https://forums.unrealengine.com/t/nanite-foliage-voxel/2856137/10 "2026-10-01T09:17:21Z")

</div>

ご確認ありがとうございます。

おっしゃる通りバニラの 5.8.3 で新規作成プロジェクトでエラーが出ないことを確認しました。

当プロジェクトでは 5.8.0 を使用しており、現在 5.8.3 へのアップデート作業を進めているところです。

アップデートができましたらまたご報告いたします。

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 5, 2026, 6:36am UTC](https://forums.unrealengine.com/t/nanite-foliage-voxel/2856137/11 "2026-10-05T06:36:51Z")

</div>

プロジェクトの 5.8.3 アップデートがまだ先になりそうですので

一旦 ShaderDebugInfo フォルダをアップロードいたします。

フルのエラーメッセージ (パスだけ消しています)​ も貼っておきます。

​

```auto
[SM6] Internal Error!
	M_NaniteTest_ddf30f9d4d1a18d3/Default/FNaniteVertexFactory/TBasePassCSTDistanceFieldShadowsAndLightMapPolicyHQVoxel/1:/Engine/Private/BasePassPixelShader.usf|MainCS VF 'FNaniteVertexFactory' Type 'TBasePassCSTDistanceFieldShadowsAndLightMapPolicyHQVoxel' '/Engine/Private/BasePassPixelShader.usf' Entry 'MainCS' Permutation 1 
[SM6] Shader debug info dumped to: "\\Saved\ShaderDebugInfo\PCD3D_SM6\M_NaniteTest_ddf30f9d4d1a18d3\Default\FNaniteVertexFactory\TBasePassCSTDistanceFieldShadowsAndLightMapPolicyHQVoxel\0_4cf29a9f43014024"
 
\Engine\Binaries\Win64\BasePassPixelShader.dxil(6104,37): Shader TBasePassCSTDistanceFieldShadowsAndLightMapPolicyHQVoxel, Permutation 0, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6104:37: error: Instructions must be of an allowed type.
note: at '%1151 = insertelement <3 x float> undef, float %1142, i32 0' in block '#32' of function 'MainCS'.
[SM6] \Engine\Binaries\Win64\BasePassPixelShader.dxil(6171,49): Shader TBasePassCSTDistanceFieldShadowsAndLightMapPolicyHQVoxel, Permutation 0, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6171:49: error: Instructions must be of an allowed type.
note: at '%1154 = insertelement <3 x float> undef, float %868, i64 0' in block '#32' of function 'MainCS'.
[SM6] \Engine\Binaries\Win64\BasePassPixelShader.dxil(6182,37): Shader TBasePassCSTDistanceFieldShadowsAndLightMapPolicyHQVoxel, Permutation 0, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6182:37: error: Instructions must be of an allowed type.
note: at '%1212 = insertelement <3 x float> undef, float %1209, i32 0' in block '#33' of function 'MainCS'.
[SM6] \Engine\Binaries\Win64\BasePassPixelShader.dxil(6183,28): Shader TBasePassCSTDistanceFieldShadowsAndLightMapPolicyHQVoxel, Permutation 0, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6183:28: error: Instructions must be of an allowed type.
note: at '%1218 = insertelement <3 x float> undef, float %1215, i32 0' in block '#33' of function 'MainCS'.
[SM6] \Engine\Binaries\Win64\BasePassPixelShader.dxil(6129,19): Shader TBasePassCSTDistanceFieldShadowsAndLightMapPolicyHQVoxel, Permutation 0, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6129:19: error: Instructions must be of an allowed type.
note: at '%1224 = extractelement <3 x float> %1222, i64 0' in block '#34' of function 'MainCS'.
[SM6] \Engine\Binaries\Win64\BasePassPixelShader.dxil(6348,43): Shader TBasePassCSTDistanceFieldShadowsAndLightMapPolicyHQVoxel, Permutation 0, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6348:43: error: Instructions must be of an allowed type.
note: at '%1231 = extractelement <3 x float> %1223, i64 0' in block '#34' of function 'MainCS'.
Validation failed.
[SM6] Internal Error!
	M_NaniteTest_ddf30f9d4d1a18d3/Default/FNaniteVertexFactory/TBasePassCSTLightMapPolicyLQVoxel/0:/Engine/Private/BasePassPixelShader.usf|MainCS VF 'FNaniteVertexFactory' Type 'TBasePassCSTLightMapPolicyLQVoxel' '/Engine/Private/BasePassPixelShader.usf' Entry 'MainCS' Permutation 0 
[SM6] Shader debug info dumped to: "\\Saved\ShaderDebugInfo\PCD3D_SM6\M_NaniteTest_ddf30f9d4d1a18d3\Default\FNaniteVertexFactory\TBasePassCSTLightMapPolicyLQVoxel\1_4cf29a9f43014024"
 
\Engine\Binaries\Win64\BasePassPixelShader.dxil(6090,37): Shader TBasePassCSTLightMapPolicyLQVoxel, Permutation 1, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6090:37: error: Instructions must be of an allowed type.
note: at '%1145 = insertelement <3 x float> undef, float %1136, i32 0' in block '#32' of function 'MainCS'.
[SM6] \Engine\Binaries\Win64\BasePassPixelShader.dxil(6157,49): Shader TBasePassCSTLightMapPolicyLQVoxel, Permutation 1, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6157:49: error: Instructions must be of an allowed type.
note: at '%1148 = insertelement <3 x float> undef, float %862, i64 0' in block '#32' of function 'MainCS'.
[SM6] \Engine\Binaries\Win64\BasePassPixelShader.dxil(6168,37): Shader TBasePassCSTLightMapPolicyLQVoxel, Permutation 1, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6168:37: error: Instructions must be of an allowed type.
note: at '%1206 = insertelement <3 x float> undef, float %1203, i32 0' in block '#33' of function 'MainCS'.
[SM6] \Engine\Binaries\Win64\BasePassPixelShader.dxil(6169,28): Shader TBasePassCSTLightMapPolicyLQVoxel, Permutation 1, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6169:28: error: Instructions must be of an allowed type.
note: at '%1212 = insertelement <3 x float> undef, float %1209, i32 0' in block '#33' of function 'MainCS'.
[SM6] \Engine\Binaries\Win64\BasePassPixelShader.dxil(6115,19): Shader TBasePassCSTLightMapPolicyLQVoxel, Permutation 1, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6115:19: error: Instructions must be of an allowed type.
note: at '%1218 = extractelement <3 x float> %1216, i64 0' in block '#34' of function 'MainCS'.
[SM6] \Engine\Binaries\Win64\BasePassPixelShader.dxil(6334,43): Shader TBasePassCSTLightMapPolicyLQVoxel, Permutation 1, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6334:43: error: Instructions must be of an allowed type.
note: at '%1225 = extractelement <3 x float> %1217, i64 0' in block '#34' of function 'MainCS'.
Validation failed.
[SM6] Internal Error!
	M_NaniteTest_ddf30f9d4d1a18d3/Default/FNaniteVertexFactory/TBasePassCSTLightMapPolicyHQVoxel/1:/Engine/Private/BasePassPixelShader.usf|MainCS VF 'FNaniteVertexFactory' Type 'TBasePassCSTLightMapPolicyHQVoxel' '/Engine/Private/BasePassPixelShader.usf' Entry 'MainCS' Permutation 1 
[SM6] Shader debug info dumped to: "\\Saved\ShaderDebugInfo\PCD3D_SM6\M_NaniteTest_ddf30f9d4d1a18d3\Default\FNaniteVertexFactory\TBasePassCSTLightMapPolicyHQVoxel\0_4cf29a9f43014024"
 
\Engine\Binaries\Win64\BasePassPixelShader.dxil(6091,37): Shader TBasePassCSTLightMapPolicyHQVoxel, Permutation 0, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6091:37: error: Instructions must be of an allowed type.
note: at '%1146 = insertelement <3 x float> undef, float %1137, i32 0' in block '#32' of function 'MainCS'.
[SM6] \Engine\Binaries\Win64\BasePassPixelShader.dxil(6158,49): Shader TBasePassCSTLightMapPolicyHQVoxel, Permutation 0, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6158:49: error: Instructions must be of an allowed type.
note: at '%1149 = insertelement <3 x float> undef, float %863, i64 0' in block '#32' of function 'MainCS'.
[SM6] \Engine\Binaries\Win64\BasePassPixelShader.dxil(6169,37): Shader TBasePassCSTLightMapPolicyHQVoxel, Permutation 0, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6169:37: error: Instructions must be of an allowed type.
note: at '%1207 = insertelement <3 x float> undef, float %1204, i32 0' in block '#33' of function 'MainCS'.
[SM6] \Engine\Binaries\Win64\BasePassPixelShader.dxil(6170,28): Shader TBasePassCSTLightMapPolicyHQVoxel, Permutation 0, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6170:28: error: Instructions must be of an allowed type.
note: at '%1213 = insertelement <3 x float> undef, float %1210, i32 0' in block '#33' of function 'MainCS'.
[SM6] \Engine\Binaries\Win64\BasePassPixelShader.dxil(6116,19): Shader TBasePassCSTLightMapPolicyHQVoxel, Permutation 0, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6116:19: error: Instructions must be of an allowed type.
note: at '%1219 = extractelement <3 x float> %1217, i64 0' in block '#34' of function 'MainCS'.
[SM6] \Engine\Binaries\Win64\BasePassPixelShader.dxil(6335,43): Shader TBasePassCSTLightMapPolicyHQVoxel, Permutation 0, VF FNaniteVertexFactory:
	BasePassPixelShader.dxil:6335:43: error: Instructions must be of an allowed type.
note: at '%1226 = extractelement <3 x float> %1218, i64 0' in block '#34' of function 'MainCS'.
Validation failed.

```

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 6, 2026, 6:15am UTC](https://forums.unrealengine.com/t/nanite-foliage-voxel/2856137/12 "2026-10-06T06:15:13Z")

</div>

迅速なご対応ありがとうございます。

r.Shaders.Optimize=1 になっておりますが、該当マテリアルの Apply を押しているうちに添付画像のダイアログが表示され Continue を押すことで以降エラーが出続けます。

おっしゃる通りシェーダー組合せ数増大の観点から不必要な組合せは避けるべきかとは思いますが

- 親マテリアルが Uber なマテリアルで子供が直接メッシュアセットの MI となっているため別々の設定をするには MI 数が多すぎること
- 一つのメッシュアセットに Voxel にしたいメッシュと Voxel にしなくて良いがライトマップ対象にしたいメッシュが入っていること

といった理由から親マテリアルに双方のフラグを立ててしまいたいところです。

もし良い方法がございましたらご教示いただけますと幸いです。

[Attachment Removed]

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 16, 2026, 9:14am UTC](https://forums.unrealengine.com/t/nanite-foliage-voxel/2856137/13 "2026-10-16T09:14:45Z")

</div>

バグトラッカー登録ありがとうございます。

VelocityOutputPassについてもありがとうございます。

本件クローズいただいて構いません。

今後ともよろしくお願いいたします。

[Attachment Removed]
