Skip to content

Commit

Permalink
ReStir (#662)
Browse files Browse the repository at this point in the history
* restir

* hide unused options
  • Loading branch information
VGorash authored May 5, 2023
1 parent 7e7576c commit 370c9f9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
12 changes: 12 additions & 0 deletions pxr/imaging/plugin/hdRpr/python/generateRenderSettingFiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,15 @@ def houdini_parm_name(name):
'houdini': {
'hidewhen': hidewhen_hybrid
}
},
{
'name': 'quality:enableReStir',
'ui_name': 'Enable ReStir',
'help': 'Enable ReStir (HybridPro only)',
'defaultValue': True,
'houdini': {
'hidewhen': lambda settings: hidewhen_render_quality('!=', 'HybridPro', settings)
}
}
]
},
Expand Down Expand Up @@ -448,6 +457,9 @@ def houdini_parm_name(name):
'ui_name': 'Downscale Resolution When Interactive',
'help': 'Controls whether in interactive mode resolution should be downscaled or no.',
'defaultValue': True,
'houdini': {
'hidewhen': hidewhen_not_northstar
}
}
]
},
Expand Down
10 changes: 10 additions & 0 deletions pxr/imaging/plugin/hdRpr/rprApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2076,6 +2076,16 @@ class HdRprApiImpl {
auto radianceClamp = preferences.GetQualityRadianceClamping() == 0 ? std::numeric_limits<float>::max() : preferences.GetQualityRadianceClamping();
RPR_ERROR_CHECK(m_rprContext->SetParameter(RPR_CONTEXT_RADIANCE_CLAMP, radianceClamp), "Failed to set radiance clamp");

if (preferences.GetQualityEnableReStir()) {
RPR_ERROR_CHECK(m_rprContext->SetParameter(rpr::ContextInfo(RPR_CONTEXT_RESERVOIR_SAMPLING), 2), "Failed to set ReStir reservoir sampling");
RPR_ERROR_CHECK(m_rprContext->SetParameter(rpr::ContextInfo(RPR_CONTEXT_RESTIR_SPATIAL_RESAMPLE_ITERATIONS), 3), "Failed to set ReStir resample iterations");
RPR_ERROR_CHECK(m_rprContext->SetParameter(rpr::ContextInfo(RPR_CONTEXT_RESTIR_MAX_RESERVOIRS_PER_CELL), 128), "Failed to set ReStir max reservoirs");
}
else {
RPR_ERROR_CHECK(m_rprContext->SetParameter(rpr::ContextInfo(RPR_CONTEXT_RESERVOIR_SAMPLING), 0), "Failed to set ReStir reservoir sampling");
}


m_dirtyFlags |= ChangeTracker::DirtyScene;
}

Expand Down
9 changes: 7 additions & 2 deletions pxr/imaging/rprUsd/schema.usda
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ class "RprRendererSettingsAPI" (
rprMaxValue = 1.0
)

# not for hybrid
uniform int rpr:quality:rayDepth = 3 (
displayName = "Max Ray Depth"
displayGroup = "Quality"
Expand Down Expand Up @@ -299,6 +298,12 @@ class "RprRendererSettingsAPI" (
rprMinValue = 0.0
rprMaxValue = 5.0
)

# HybridPro only
uniform bool rpr:quality:enableReStir = true (
displayName = "Enable ReStir (HybridPro only)"
displayGroup = "General"
)

# not for hybrid
uniform int rpr:quality:interactive:rayDepth = 2 (
Expand All @@ -316,7 +321,7 @@ class "RprRendererSettingsAPI" (
rprMinValue = 0
rprMaxValue = 10
)
# tahoe only
# northstar only
uniform bool rpr:quality:interactive:enableDownscale = true (
displayName = "Enable Downscale"
displayGroup = "Quality|Interactive"
Expand Down

0 comments on commit 370c9f9

Please sign in to comment.