OverviewFilesCommitsIssuesDocsReleasesPeers

nvidia-rtx-godot commits / 3bb2c02

RT: hoist orm out of the rt_full_detail branch so debug variants compile
Every RT debug vis mode was broken on the default hit group. `orm` was declared inside `if (rt_full_detail) { ... }` but debug_visualize() reads it afterwards, so the RT_DEBUG_ENABLED variant died with: 0:3527: 'orm' : undeclared identifier That failure takes down the whole base compile context ("Failed to build base compile context for variant 0x40400009"), the renderer falls back, and the frame time collapses -- 104ms in the run that surfaced this, versus 24ms for the same scene with vis mode 0. The custom-hit-group branch builds vec3(1.0, roughness, metalness) for the same argument, so that is the default here when there is no ORM texture to sample. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
3bb2c0245d54ffd9df283123d64802418be73c5b
by plankatron <fleeky@gmail.com> · 2026-07-31T19:23:49.000Z

Changed files (1) +8 -1

servers/rendering/renderer_rd/shaders/raytracing/scene_raytracing_raygen.glsl +8 -1
……@@ -416,8 +416,15 @@ void main() {
416416 vec3 albedo = albedo_tex.rgb * mat.albedo_color.rgb;
417417 float roughness = saturate(mat.roughness);
418418 float metalness = saturate(mat.metallic);
419 // Declared outside the branch because debug_visualize() below reads it. Scoped
420 // inside, the RT_DEBUG_ENABLED variant failed to compile with "'orm': undeclared
421 // identifier", which took the whole base compile context down and left the
422 // renderer on a fallback path -- so every vis mode was broken on the default hit
423 // group. The default mirrors what the custom-hit-group branch builds for the same
424 // argument when there is no ORM texture to sample.
425 vec3 orm = vec3(1.0, roughness, metalness);
419426 if (rt_full_detail) {
420 vec3 orm = sample_material_texture(mat.orm_texture_idx, uv, mat.flags).rgb;
427 orm = sample_material_texture(mat.orm_texture_idx, uv, mat.flags).rgb;
421428 roughness = saturate(orm.g * mat.roughness);
422429 metalness = saturate(orm.b * mat.metallic);
423430 }