D3D12LookDevPT
August 8, 2026 · View on GitHub
ドキュメント: English / 日本語
D3D12LookDevPT は、Direct3D 12 / DXR ベースの LookDev 用パストレーシング環境です。ラスタライズは swapchain への表示コピーと ImGui UI に限定しています。Interactive profile は時間再構成を含む DXR pipeline でシーンを描画し、reference_still を選択すると clamp しない高 SPP の Baseline MIS progressive path が別系統として設定されます。
本プロジェクトは、OpenAI Codex および GPT-5.6 Sol を活用して開発を進めています。
プレビュー


上の screenshot は local test asset として配置した Bistro Exterior / Bistro Interior scene を使っています。大きな scene asset は repository に含めない方針です。配置方法は アセットの配置 を参照してください。
主な機能
- Direct3D 12 Agility SDK と DXC を NuGet から利用。
- 内蔵インポーターによる PBRT v4 と、Assimp による static mesh の glTF / GLB / FBX / OBJ 読み込み。
- DirectXTex による PNG / JPEG / BMP / TGA / DDS / HDR テクスチャ読み込み。
- base color、normal、roughness、metallic、occlusion、emissive、alpha mask を扱う PBR material と texture override、material variant、preset。
- DXR BLAS / TLAS、shader table、reference 用 progressive accumulation、SurfaceGuides、lobe 別 lighting signal、debug view、HDR TAA、contrast-adaptive sharpen。
- optional NVIDIA NRD REBLUR / RELAX backend。NRD static library と shader を source build し、Diffuse / Specular radiance と hit distance、validation view、D3D12 dispatch を統合しています。SDK または runtime evaluation が利用できない場合は internal denoiser へ fallback します。
- optional NVIDIA RTXDI v3.0.0 ReSTIR DI / GI / checkerboard PT backend。公式 packed reservoir ABI、検証付き temporal / spatial reuse、current surface での最終 visibility / shading を実装しています。
- optional NVIDIA Streamline / DLSS Ray Reconstruction backend。render/output 解像度の分離、frame ごとの constant/resource tag、command list 内 evaluation、native reconstruction fallback を実装しています。production evaluation には NVIDIA が発行した NGX application ID が必要です。
.lookdevpt.jsonによる project 保存。- UI と同じ action layer を使う localhost MCP server。
レンダリング pipeline と backend の実装状況
通常の Interactive Beauty は次の順序で処理します。
DXR primary/direct path + SurfaceGuides
-> 利用可能かつ選択時は RTXDI ReSTIR DI
-> 選択時は RTXDI ReSTIR GI または checkerboard PT
-> Diffuse / Specular / Emission-Sky signal
-> NRD REBLUR / RELAX、internal fallback、Off、または DLSS Ray Reconstruction
-> HDR TAA/TAAU + sharpen(DLSS-RR 成功時は bypass)
-> tone map
各段階が必要な理由、1 pixel の ray 経路、Surface Guides と history の流れ、実装コードの読み方は レンダリングパイプライン学習ガイド で図解しています。
reference_still を選択すると、Baseline MIS、Russian roulette、clamp しない float32 accumulation、tone mapping が設定されます。最終出力には RTXDI、contribution compression、denoiser、Final TAA を適用しません。
保存済み project との互換性のため 4 つの render mode 名を維持していますが、現在の実効処理は次のとおりです。
| Render mode | RTXDI DI が利用可能な場合の実効処理 | RTXDI なし |
|---|---|---|
Baseline PT | Baseline の direct / indirect MIS | 同じ |
ReSTIR DI | RTXDI DI + Baseline indirect | Baseline PT fallback |
ReSTIR GI | Baseline one-light direct + RTXDI GI | Baseline PT fallback |
ReSTIR GI + DI | RTXDI DI + RTXDI GI | Baseline PT fallback |
ReSTIR PT | Baseline one-light direct + checkerboard RTXDI PT | Baseline PT fallback |
ReSTIR PT + DI | RTXDI DI + checkerboard RTXDI PT | Baseline PT fallback |
現在版には、安定性と性能のために以下を実装しています。
FrameStateの revision と history domain 別 invalidation。通常の camera 移動では再投影 history を維持し、camera cut、projection / resize、geometry 変更では影響する domain だけを reset します。- SurfaceGuide 3 枚と identity の固定 A/B descriptor table。frame parity で current / previous resource を切り替え、frame 終端の 4 枚分の history copy を行いません。
- ReSTIR DI を 2 dispatch に融合。Pass A は candidate generation と temporal reuse を scratch への 1 回の書き込みにまとめ、Pass B は適応 spatial reuse、visibility、shading、次 frame history の直接書き込みを行います。物理 reservoir は 2 本で、frame ごとの reservoir publish copy はありません。
- ReSTIR GI / PT は initial pass と reuse/final-shading の fused pass を持ちます。GI は公式 32-byte reservoir ABI、PT は parity-swapped checkerboard 64-byte reservoir を使い、GI 品質 gate と分離しています。
- DI scratch と current parity の GI/PT resource、Final TAA output と次の A/B history を placed-resource alias し、通常の fused NRD/TAA path は
postDenoiseHdrを 1x1 placeholder にします。interval-aware allocator が lifetime の非重複を検証します。1080p GI+DI の実測 frame/history は 493.44 MiB です。 - static BLAS は compaction size を取得し、compact copy 完了後に元 BLAS/scratch を解放してから TLAS を構築します。
- path payload は 32 byte、shadow payload は別の 12 byte です。material shading は RayGen 側で行い、material feature bit により存在しない texture sample を省略し、packed ORM は 1 回だけ sample します。非 alpha の BLAS geometry は opaque として AnyHit を回避します。
- dimension を固定した Owen-scrambled Sobol、ray cone による texture LOD、Diffuse / Specular / Emission の信号分離、denoiser 用 secondary hit distance。
- 3 個の FrameContext。CPU wait は in-flight context の再利用時と明示同期時だけ行い、benchmark では fence による throttling と renderer-active CPU 時間を分けて記録します。
- 通常の NRD Beauty path では Final HDR TAA が NRD の Diffuse / Specular 出力から直接 HDR を再構築し、独立した全画面 NRD Composite dispatch を省略します。debug view、quality 計測、TAA OFF では検証可能な従来 Composite path を維持します。
- DXR 1.1 の Interactive Baseline/DI は、独立 Primary Visibility、pixel SPP の prefix scan、pixel/sample 順
SecondaryTasklist、1DExecuteIndirect、競合のない pixel resolve を使用できます。Reference Still、RTXDI GI/PT、DXR 1.0、quality diagnostics は従来 full-dispatch megakernel を維持します。 native/ fixed-scale / dynamic render resolution を display resolution から分離しています。非 DLSS 経路は NRD を render 解像度で実行して TAAU し、dynamic scale は settle hysteresis 後に 1/16 刻みで変化します。- DLSS-RR は HDR color、linear depth、motion、packed normal/roughness、albedo、specular albedo、exposure、jitter、reset を tag します。成功時は NRD/Internal/Final TAA を bypass し、失敗時は feature 出力を破棄して同じ frame を native 再構成し、次 frame の native resource rebuild を要求します。
compact secondary task は現在、保存した primary intersection から再開せず task ごとに camera sample 全体を再 trace するため、work scheduling と正しさの実装であり高速化達成を主張するものではありません。Full Sample 相当の完全な PT hybrid-shift replay も残っています。quality run は primary、secondary、shadow、DI/GI/PT visibility、AnyHit の shader-side invocation を記録し、hardware BVH node traversal とは表記しません。
Quality profile と project schema
Project schema v2 は renderer policy を quality に保存します。同じ object を MCP の lookdevpt.set_quality に渡せます。現時点では、これらの profile 設定専用の ImGui editor はありません。
{
"schemaVersion": 2,
"mode": "ReSTIR GI + DI",
"quality": {
"qualityProfile": "interactive_game",
"restirBackend": "rtxdi",
"secondaryShadingRate": "auto",
"resolutionMode": "native",
"fixedRenderScale": 1.0,
"minRenderScale": 0.5,
"maxRenderScale": 1.0,
"rayBudget": {
"movingSpp": 1,
"movingBounces": 2,
"staticBaseSpp": 1,
"staticMaxSpp": 2,
"staticBounces": 4,
"settleFrames": 8,
"targetGpuMs": 14.5
},
"finalTaa": true,
"sharpenStrength": 0.0,
"referenceSpp": 4096
}
}
interactive_game: REBLUR、時間再構成、adaptive sampling、moving / static ray budget を使用します。sharp_preview: RELAX を選択し、secondary transport は常に full-rate です。reference_still: 選択時に Baseline PT、denoiser Off、Final TAA Off、full-rate secondary transport、referenceSppまでの蓄積を設定します。path-tracing control は選択後も編集できるため、その後に変更した場合は reference capture 前に profile を選び直すか設定を確認してください。secondaryShadingRate:auto、full、adaptive_halfを受理します。Interactive のautoは budget 超過が続いた場合、追加 sample quota、bounce budget の順に削減してから checkerboard secondary transport を有効にします。history 不正 / disocclusion、alpha / coverage、低 roughness、reactive pixel は full-rate へ昇格します。Interactive 以外はfullに強制されます。resolutionMode:native、fixed、dynamicを受理します。この member がない旧 project はnativeとして読み込みます。fixed/dynamic scale は設定範囲へ clamp し、1/16 刻みに量子化します。
未指定の quality member は既定値を維持するため、旧 project も読み込めます。Schema v1 の denoise.spatialIterations は 1 回の移行期間だけ受理して atrousPasses へ変換し、新しく保存する schema v2 project は atrousPasses だけを書き込みます。Interactive / Reference の例は projects/ にあります。
Interactive の sharpen は opt-in(既定値 sharpenStrength: 0)です。0 より大きい値は temporal reconstruction 後に残る Monte Carlo 分散を増幅する場合があるため、対象 scene と sampling budget で検証した場合だけ有効にしてください。
セットアップ
この repository では ThirdParty を submodule として管理しています。clone 後に submodule を初期化してください。
git clone https://github.com/shaderjp/D3D12LookDevPT.git
cd D3D12LookDevPT
git submodule update --init --recursive --depth 1
local setup の不足確認には setup checker を使えます。
.\Scripts\CheckSetup.ps1
DLSS を厳密に確認する場合は .\Scripts\CheckSetup.ps1 -CheckDLSS、NRD は -CheckNRD、RTXDI は -CheckRTXDI を使います。NRD と DLSS は build 時に既定で有効ですが、/p:EnableNRD=false と /p:EnableDLSS=false で外せます。RTXDI は既定で無効で、ReSTIR DI/GI/PT を有効にする場合は MSBuild へ /p:EnableRTXDI=true を渡します。固定 SDK がない場合は warning を出して Baseline PT fallback を build します。詳細は RTXDI optional ReSTIR、NRD backend、DLSS Ray Reconstruction を参照してください。
ThirdParty の実体は repository 本体には含めません。必要な依存は以下です。
ThirdParty/imgui: ImGui docking branchThirdParty/assimp: AssimpThirdParty/DirectXTex: DirectXTexThirdParty/Streamline: NVIDIA Streamline SDK。DLSS を使わない build では/p:EnableDLSS=falseで不要化できます。ThirdParty/DLSS: NVIDIA DLSS SDK。DLSS runtime の扱いは Optional DLSS Ray Reconstruction を参照してください。ThirdParty/NRD: NVIDIA Real-Time Denoisers。NRD を使わない build では/p:EnableNRD=falseで不要化できます。詳細は Optional NVIDIA NRD Backend を参照してください。ThirdParty/RTXDI: NVIDIA RTXDI SDK v3.0.0(commit274141af082050c9d0ad6e01a2e591d0d66b7955)。nestedLibraries/Rtxdiruntimeを含めてrecursiveに初期化します。
大きなアセット
Bistro などの大きなテストアセットは repository で管理しません。容量が大きく、通常の GitHub repository には向かないため、利用者側で別途ダウンロードして配置してください。詳しくは アセットの配置 を参照してください。
例:
D3D12LookDevPT/
Bistro_v5_2/
BistroExterior.fbx
Textures/
Bistro_v5_2/ は .gitignore 済みです。
ビルド
Visual Studio 2022:
& "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\MSBuild.exe" .\D3D12LookDevPT.sln /m /p:Configuration=Debug /p:Platform=x64
Visual Studio 2026 Insiders:
& "C:\Program Files\Microsoft Visual Studio\18\Insiders\MSBuild\Current\Bin\amd64\MSBuild.exe" .\D3D12LookDevPT.sln /m /p:Configuration=Debug /p:Platform=x64
project は VS 2026 では v145、それ以外では v143 を選ぶ設定です。Assimp、DirectXTex、NRD 有効時の NRD static library は BuildThirdParty.ps1 からビルドされます。
この checkout で確認済み:
- VS 2026
v145: Debug x64 / Release x64(optional NVIDIA integration 無効) - VS 2022
v143: Debug x64 / Release x64 - MCP socket test: stateless discovery / routing / cache / error、legacy initialize / session / DELETE 互換、subscription acknowledgment / filter / coalescing / graceful shutdown
@modelcontextprotocol/conformance@0.2.0-alpha.10の2026-07-28server suite。固定名 fixture content と今回対象外の MRTR feature family は strict baseline で管理
起動
何も読み込まない場合は preview cube で起動します。
.\Bin\x64\Debug\D3D12LookDevPT.exe
起動時に scene や environment を指定できます。
.\Bin\x64\Debug\D3D12LookDevPT.exe --scene .\Bistro_v5_2\BistroExterior.fbx
.\Bin\x64\Debug\D3D12LookDevPT.exe --environment .\Bistro_v5_2\san_giuseppe_bridge_4k.hdr
毎回同じ scene を読み込む場合は、初期シーン設定を使えます。Project > Save Startup Settings を実行すると %APPDATA%\D3D12LookDevPT\startup.json に現在の project / scene / environment が保存され、次回起動時に自動で読み込まれます。無効化する場合は Project > Clear Startup Settings を使います。
手で書く場合の例:
{
"version": 1,
"enabled": true,
"baseDirectory": "C:/Projects/D3D12LookDevPT",
"projectPath": "",
"scenePath": "Bistro_v5_2/BistroExterior.fbx",
"environmentPath": "Bistro_v5_2/san_giuseppe_bridge_4k.hdr",
"environmentEnabled": true
}
projectPath がある場合は project を優先し、失敗した場合だけ scenePath を fallback として使います。相対パスは baseDirectory から解決され、baseDirectory が空なら startup JSON の場所から解決されます。別の設定ファイルを使う場合は --startup-config path、一時的に上書きする場合は --project / --scene / --environment を指定できます。
load diagnostics は %TEMP%\D3D12LookDevPT.log に追記されます。
PBRT v4 scene
.pbrt は内蔵の PBRT v4 lexer / importer で読み込むため、外部の pbrt 実行ファイルは不要です。v1 は相対 Include、静的 transform / attribute scope、座標系の保存と復元、nested ObjectBegin / ObjectInstance、trianglemesh、Assimp 経由の plymesh、perspective camera、image / constant / 単純な scale・mix texture、named / inline material、cutout alpha、infinite / point / spot / distant / diffuse-area light に対応します。PBRT の左手 +Z forward と camera/world transform 規則を直接解釈し、PBRT v4 の equal-area environment map と完全な light transform を維持します。既存の glTF / GLB / FBX / OBJ は従来どおり Assimp 経路です。
PBRT material は既存 metal-rough model へ決定的に近似します。diffuse、coated diffuse、conductor、coated conductor、dielectric、thin dielectric、diffuse transmission には個別の変換規則があり、評価できない graph は診断を出して gray / rough material へ fallback します。PNG / JPEG / TGA / HDR / EXR を読み込めます。EXR は固定した TinyEXR v3 submodule で RGB(A) または Y、half / float を有限な linear RGBA32F へ変換します。他の依存と一緒に初期化してください。
git submodule update --init --recursive
pbrt-v4-scenes 本体と大きな asset は repository に含めません。この repository の横へ clone し、元の相対 asset 配置を維持したまま、UI、drag & drop、CLI、または MCP の scenePath から読み込みます。
pbrt-v4-scenes のサンプルデータ
公式の mmp/pbrt-v4-scenes は pbrt-v4 用のサンプルscene集です。各sceneの由来とライセンスは同一ではないため、利用・再配布時は公式READMEと各assetの条件を確認してください。本rendererで主に検証しているsceneについて、公式説明の要点は次のとおりです。
- Barcelona Pavilion は Mies van der Rohe の建築を再現したモデルで、昼と夜の設定があります。昼はHDR environment mapの現実的なskyから照明され、夜は暗いskyと複数のarea lightを使います。夜景はglassを通る長いlight pathが多い難しいsceneです。Hamza Cheggourによるモデルで、CC BY 2.0です。
- Bistro は Parisの街路を詳細に再現したAmazon Lumberyardのモデルです。NVIDIA Open Research Content Archive経由で提供され、CC BY 4.0です。
- BMW M6 は Blend Swapの tyrant monkey による車両モデルで、CC0 / Public Domainです。
- Contemporary Bathroom は Blend Swapの Mareckによる現代的なbathroomモデルで、CC0 / Public Domainです。
- Villa は Florent Boyer提供のmodern indoor environmentです。上流READMEには個別ライセンスが明記されていないため、利用・再配布前に上流の最新条件を確認してください。
scene folder内のtop-level .pbrt を開いてください。geometry.pbrt、materials.pbrt、PLY、EXR、image textureはtop-level sceneから相対参照されるため、folder構成を変更しないでください。大規模なPLYを多数含むので、実地確認にはRelease buildを推奨します。
git clone --depth 1 https://github.com/mmp/pbrt-v4-scenes.git ..\pbrt-v4-scenes
.\Bin\x64\Release\D3D12LookDevPT.exe --scene ..\pbrt-v4-scenes\bistro\bistro_cafe.pbrt
.\Bin\x64\Release\D3D12LookDevPT.exe --scene ..\pbrt-v4-scenes\contemporary-bathroom\contemporary-bathroom.pbrt
.\Bin\x64\Release\D3D12LookDevPT.exe --scene ..\pbrt-v4-scenes\barcelona-pavilion\pavilion-day.pbrt
.\Bin\x64\Release\D3D12LookDevPT.exe --scene ..\pbrt-v4-scenes\barcelona-pavilion\pavilion-night.pbrt
.\Bin\x64\Release\D3D12LookDevPT.exe --scene ..\pbrt-v4-scenes\bmw-m6\bmw-m6.pbrt
.\Bin\x64\Release\D3D12LookDevPT.exe --scene ..\pbrt-v4-scenes\villa\villa-daylight.pbrt
.\Bin\x64\Release\D3D12LookDevPT.exe --scene ..\pbrt-v4-scenes\villa\villa-lights-on.pbrt
load 中は Parsing、LoadingAssets、BuildingBLAS、BuildingTLAS を表示し、Cancel しても以前の scene を維持します。Include と必須 PLY の欠落は transaction 全体を失敗させ、optional texture の欠落は fallback します。Diagnostics / Stats には category 別件数と最大8件の代表 file / material 名を集約表示します。
dielectric は界面の表裏とIORから正確な非偏光Fresnel反射率を求め、全反射を含むSnell屈折または鏡面反射をサンプリングします。thindielectric は2界面分のFresnelを考慮した鏡面反射/直進透過です。BMW M6のwindow / windscreenとVillaのglassに適用されます。shadowとRTXDIのinline visibilityはcausticsを生成せずglassを透過する近似です。diskはtriangle fanへ変換し、Villa lights-onのcamera fill area lightを発光triangleとして扱います。imagemapの単純なuscale / vscale / udelta / vdeltaもmaterial samplingへ反映します。
volume / medium、hair / curve、subdivision、motion blur、disk以外の解析形状、non-perspective camera、.ply.gz、displacement、完全な spectrum、rough dielectric、色付き吸収、屈折caustics、複雑な procedural textureはv1対象外です。roughness付きdielectricと色付きtransmittanceはdiagnosticsを出してsmooth/scalarへ近似します。
再現可能なベンチマーク
固定 1/60 秒 timestep、camera path、seed を使い、pass 別 GPU/CPU 時間と再現可能な frame artifact を出力できます。
.\Bin\x64\Release\D3D12LookDevPT.exe --project .\projects\benchmark_interactive.lookdevpt.json --benchmark --benchmark-kind performance --camera-path .\benchmarks\bistro_exterior_stability.camera.json --frames 300 --warmup 120 --seed 1 --output .\benchmark-output\performance
--benchmark-kind は performance、quality、combined(互換性のための既定値)を受理します。
performance: 全解像度の quality-counter pass を省き、公式 frame-time gate の対象になる唯一の kind です。quality: tile 単位の history rejection、contribution energy、disocclusion、TAA acceptance、finite-value 診断を有効にします。combined: 従来の一体型出力を維持しますが、診断処理を含むため分離した performance gate には不適格です。
--capture-every N を追加すると計測 frame の LDR / HDR 連番を保存し、さらに --capture-aovs を付けると SurfaceGuides と lighting signal も保存します。--capture-aovs は --capture-every と組み合わせる必要があります。出力 directory には frames.csv、summary.json、artifacts.json、quality_analysis.json、最終または指定間隔の image artifact が生成されます。
GPU timestamp は Path Trace、ReSTIR DI、GI/PT initial / fused、denoise、Final TAA、quality counter、history publish、copy、UI に分割しています。CPU は update、MCP、UI 構築、command recording、Present、NRD recording、benchmark 集計、fence wait を分離します。performance run は ray budget 推定を維持し、quality run は primary / secondary / shadow / DI・GI・PT visibility / AnyHit の shader 実測値も出力します。これは BVH node traversal 数とは表記しません。
公式 gate は RTX 4070、1920 x 1080、warmup 120 frame 以上、計測 300 frame 以上の独立した performance run を対象とし、遅延 GPU timestamp の submission 対応、Interactive Beauty、規定 ray budget、active NRD REBLUR、active RTXDI GI + DI、GPU p95 16.7 ms 以下、p99 20 ms 以下、renderer-active CPU p95 4 ms 以下、frame / history resource 512 MiB 以下を要求します。DI/GI backend と memory の eligibility は実動作から判定します。この checkout では、最終 reconstruction clamp 後も warmup 120 + 計測 300 の正式 3-run performance window に合格しました。median-p95 run は GPU p95 9.919 ms、p99 10.157 ms、CPU-active p95 1.809 ms、frame/history 493.44 MiB で、全 run の NRD REBLUR / RTXDI GI+DI が active、non-finite pixel は 0 です。Bistro Exterior の長時間静止32-frame HDRでは surface luminance CV median 0.197%、p95 1.430%、NaN/Inf 0で1% / 3%条件に合格しました。全 scene のreference energy / edge-width acceptanceは別途残っています。
UI
初期解像度は 1920 x 1080 です。ImGui docking を有効にしており、初回フレームで以下の panel を配置します。
ViewportSceneMaterialLightingPath TracingReSTIRDenoiseDiagnostics / StatsMCP Server
UI は 18 px の default font と拡大済み spacing を使います。Material panel は Properties、Textures、Variants、Presets の tab 構成で、PBR factor、texture slot override、A/B 比較 snapshot、user preset、material focus 表示を操作できます。表示解像度を変更すると、DXGI swapchain、RTV、DXR output、accumulation、reservoir、denoise resource をまとめて resize します。
Window menu では各 panel を個別に ON / OFF でき、Show All Panels ですべて再表示、Reset Default Layout で全 panel の再表示と既定 docking 配置の再構築を行えます。Render Only Mode または F10 を使うと ImGui の menu / panel と GPU UI draw を停止し、DXR 出力を client area 全体へ表示します。もう一度 F10 を押すと UI に戻ります。
Diagnostics / Stats は Path Trace、ReSTIR、Denoise、Copy、UI の集約 GPU 時間、frame / history VRAM、active denoiser、history 状態、実効 secondary shading rate を表示します。閉じた panel の内容は構築せず、scene / material usage count は毎 frame 再走査せず cache します。詳細な stage 別時間は benchmark output に記録されます。
WASD / QE / Shift による camera 移動は、D3D12LookDevPT の window が foreground のときだけ有効です。XInput 対応 gamepad も自動検出され、Render Only Mode を含めて左 stick で移動、右 stick で視点操作、LT / RT で下降 / 上昇、左 stick 押し込みまたは RB で高速移動できます。接続直後から標準の zero-centered XInput range と radial deadzone で操作できます。Scene panel には接続状態、有効化、視点速度、Y 軸反転、Recalibrate Gamepad Neutral、Use Standard Center を表示します。標準 deadzone を超える特殊な drift がある場合のみ、両 stick を離して再 calibration してください。誤った位置を中心として登録した場合は Use Standard Center で解除できます。trigger には threshold を適用し、keyboard / mouse と併用できます。
MCP Server
MCP Server panel から localhost MCP endpoint を起動できます。server は default disabled です。
- Endpoint:
http://127.0.0.1:<port>/mcp - Default port:
8777 - Token:
%APPDATA%\D3D12LookDevPT\settings.jsonに保存 - Access mode:
Read Only、Confirm Mutations、Allow Mutations - Protocol: stateless
2026-07-28と session-based2025-11-25/2025-06-18を同じ endpoint で提供
MCP request は server thread から D3D12 / ImGui state に直接触れません。mutation は main thread queue に積まれ、OnUpdate() の安全なタイミングで実行されます。
MCP では project save/load、camera fitting、display resolution 変更、quality profile、reset tools、debug-view capture pack、material texture / variant / color management 操作、capture resources、prompts も使えます。modern client は server/discover で capability を取得し、subscriptions/listen で coalesce 済み resource update を受信できます。server 停止中は snapshot を再生成せず、起動中は動的 state を最大 30 Hz、stats を 10 Hz、material / project catalog を revision 変更時だけ更新します。VS Code / LocalMCPChatClient 設定、modern / legacy JSON-RPC 例、tools/resources/prompts、subscription、MCP 経由の camera / denoise 操作 screenshot、troubleshooting は MCP サーバー詳細 を参照してください。LocalMCPChatClient には config/LocalMCPChatClient.mcp.json をインポートでき、Scripts/TestLocalMcpChatClientIntegration.ps1 で両実装をまとめて検証できます。
起動時に MCP server を明示的に start することもできます。
.\Bin\x64\Debug\D3D12LookDevPT.exe --mcp-server --mcp-port 8777 --mcp-token <token> --mcp-access confirm_mutations
主な MCP tools:
lookdevpt.get_statslookdevpt.get_statelookdevpt.list_materialslookdevpt.list_debug_viewslookdevpt.list_render_modeslookdevpt.get_diagnosticslookdevpt.capture_viewportlookdevpt.capture_debug_packlookdevpt.validate_actionlookdevpt.run_actionslookdevpt.fit_camera_to_scenelookdevpt.set_display_resolutionlookdevpt.load_projectlookdevpt.save_project_aslookdevpt.set_scenelookdevpt.set_cameralookdevpt.set_qualitylookdevpt.set_materiallookdevpt.set_material_texturelookdevpt.reset_materiallookdevpt.save_material_variantlookdevpt.apply_material_variantlookdevpt.delete_material_variantlookdevpt.set_material_viewlookdevpt.set_color_managementlookdevpt.set_lightinglookdevpt.set_path_tracinglookdevpt.set_restirlookdevpt.set_denoiselookdevpt.set_view
Action Layer
UI と MCP は同じ action layer を通します。
D3D12PathTracingBackend::ApplyAction(method, params, diagnostics, validateOnly)
対応 action:
set_sceneset_cameraset_qualityset_materialset_material_texturereset_materialsave_material_variantapply_material_variantdelete_material_variantset_material_viewset_color_managementset_lightingset_path_tracingset_restirset_denoiseset_view
validateOnly=true の場合は状態を変更せず validation だけ行います。MCP の Confirm Mutations mode では、mutation request が ImGui の MCP Server panel に承認待ちとして表示されます。
現在の制限
- v1 は static mesh 向けです。animation、skinning、morph target は対象外です。
- compact secondary work list は task ごとに primary path を再 trace するため、primary intersection から直接継続する最適化は未実装です。
- ReSTIR PT は checkerboard reservoir と reconnection target shift までで、Full Sample 相当の完全な hybrid-shift path replay は未実装です。
- DLSS Ray Reconstruction の active evaluation には NVIDIA 発行の NGX application ID、対応 GPU/driver/runtime DLL が必要です。欠ける場合は native reconstruction に fallback します。
- shader editing、procedural scene editing、remote MCP bind、TLS、OAuth は未実装です。
- 大きな scene asset は repository に含めません。
- FBX material は Assimp から取得できる範囲で PBR / legacy 値を best effort 変換します。
メモ
最初は preview cube で renderer を確認できます。PBRT / glTF / GLB / FBX / OBJ scene を読み込む場合は Project > Open Scene...、HDRI / environment texture を読み込む場合は Project > Open Environment... を使ってください。scene dialog には全対応形式のfilterに加えて、専用の PBRT v4 Scene (*.pbrt) filterがあります。