You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ports the path tracing pipeline from NVIDIA's Godot fork
(NVIDIA-RTX/godot, branch nvidia-pt-dlss-dev, merge base c3e6b2c).
It builds and runs, but the image is still black: see the status below.
The RenderingDevice raytracing API this depends on (acceleration structures,
raytracing pipelines, trace rays, the raygen/hit/miss shader stages) is already
in upstream Godot, so what is ported here is only NVIDIA's renderer on top of it:
- servers/rendering/renderer_rd/forward_clustered/render_raytracing.*, the
BLAS/TLAS builder and per-surface acceleration structure cache.
- scene_shader_raytracing.*, a second material shader system compiling materials
for the raytracing stages.
- render_forward_clustered_pt.*, a RenderForwardClustered subclass that replaces
the raster scene render when path tracing is on.
- shaders/raytracing/*, the raygen/closest hit/BRDF/light sampling shaders.
- RTProceduralInstance3D plus its gizmo, Environment path tracing properties,
bindless_block, and depth_reconstruct.
- Shader::set_code_rt so user shaders can carry raytracing code.
- The spirv-reflect patch adding SpvOpTypeHitObjectEXT, without which reflection
of the raygen stage fails outright.
Deliberately not taken from that branch, as none of it belongs to the path
tracer: Nsight Aftermath, error backtraces, PIX markers, the gizmo suppression
refactor, the Shape3D debug mesh cache, concurrent BVH building, and a second
Reflex ping path through a new display server window event.
Where NVIDIA's branch and ours had both grown a DLSS implementation, ours is
kept, including its corrections: the vertical FOV derivation, the clip space the
matrices handed to DLSS are built in, declaring the upscaled output read-write to
the render graph, and falling back to FSR2 when DLSS cannot service a
configuration. NVIDIA's _render_3d_upscaling refactor is adopted because the path
traced path needs it to pass DLSS Ray Reconstruction guide buffers, and those
fixes were reapplied on top of it.
Current state, measured on an RTX 4070 Laptop with Vulkan:
- The engine starts, path tracing enables, and 60 frames render with no errors.
- The TLAS receives every instance and the raster path correctly stands down.
- Ray traversal works. The UV, front/back face, geometry normal and final normal
debug views all resolve geometry.
- Every material derived value is zero: albedo, ORM and roughness debug views are
entirely black, and so is the final image.
So the remaining defect is isolated to material evaluation in the closest hit
path, not to the acceleration structures or vertex data. The material UBO pool
and the bindless texture binding are the places to look.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgxxgYZUnriDqgepZHiKpY
A scene node that represents procedural ray tracing geometry using axis-aligned bounding boxes (AABBs).
5
+
</brief_description>
6
+
<description>
7
+
[RTProceduralInstance3D] adds a set of axis-aligned bounding boxes (AABBs) to the Top-Level Acceleration Structure (TLAS) as procedural geometry. Unlike mesh-based instances, procedural instances do not have triangle geometry; instead, intersection is handled entirely by a custom intersection shader in the ray tracing pipeline.
8
+
Each entry in [member bounds] defines one primitive AABB visible to intersection shaders via [code]gl_PrimitiveID[/code]. If [member bounds] is empty the node falls back to a single primitive using [member size] as the bounding box centered at the origin.
9
+
A zero-surface [ArrayMesh] is attached internally so the renderer classifies this node as a mesh instance. No vertex or index data is submitted to the raster pipeline; the node is invisible outside of ray tracing.
10
+
[b]Note:[/b] Requires a GPU with hardware ray tracing support and path tracing enabled in the [Environment].
11
+
</description>
12
+
<tutorials>
13
+
</tutorials>
14
+
<methods>
15
+
<methodname="is_multi_aabb"qualifiers="const">
16
+
<returntype="bool" />
17
+
<description>
18
+
Returns [code]true[/code] if [member bounds] contains at least one entry, meaning the node uses per-primitive AABBs rather than the single [member size]-derived bounding box.
Array of per-primitive axis-aligned bounding boxes submitted to the ray tracer. Each entry corresponds to one procedural primitive accessible via [code]gl_PrimitiveID[/code] in the intersection shader. When this array is empty, a single primitive is created using [member size].
Optional override for the conservative bounding volume used to cull this instance in the TLAS. When set to a non-empty AABB (i.e., [method AABB.has_volume] returns [code]true[/code]), this value is used instead of the union of all [member bounds] entries. Useful when the logical extents of your procedural geometry exceed the individual AABBs.
If [code]true[/code], the per-primitive AABBs from [member bounds] are made accessible to hit shaders, allowing intersection shaders to skip redundant ray-AABB tests using precomputed results.
The size of the single fallback bounding box used when [member bounds] is empty. The box is centered at the node origin. Has no effect when [member bounds] contains at least one entry.
0 commit comments