Skip to content

Commit

Permalink
Proper support of arnold:visibility primvar in hydra #1610 (#2022)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienblor authored Jul 23, 2024
1 parent 29fb545 commit a33145a
Show file tree
Hide file tree
Showing 6 changed files with 360 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## Pending next bugfix release
- [usd#1989](https://github.com/Autodesk/arnold-usd/issues/1989) - Support mixed half/float channels when using the render delegate in batch mode with husk.

- [usd#1610](https://github.com/Autodesk/arnold-usd/issues/1610) - Proper support of arnold:visibility primvar in hydra

## Pending feature release

Expand Down
7 changes: 2 additions & 5 deletions libs/render_delegate/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,7 @@ bool ConvertPrimvarToRayFlag(AtNode* node, const TfToken& name, const VtValue& v
// that doesn't have any visibility attribute (e.g. a light), so we need to check
// the HdArnoldRayFlags pointer exists (see #1535)
if (visibility && name == _tokens->arnoldVisibility) {
uint8_t visibilityValue = 0;
if (value.IsHolding<int>()) {
visibilityValue = value.Get<int>();
}
uint8_t visibilityValue = VtValueGetInt(value);
AiNodeSetByte(node, str::visibility, visibilityValue);
// In this case we want to force the visibility to be this current value.
// So we first need to remove any visibility flag, and then we set the new one
Expand Down Expand Up @@ -342,7 +339,7 @@ bool ConvertPrimvarToBuiltinParameter(
// we also want to support arnold:visibility as this is what the arnold-usd writer
// will author
if (visibility && name == _tokens->arnoldVisibility) {
uint8_t visibilityValue = value.Get<int>();
uint8_t visibilityValue = VtValueGetInt(value);
AiNodeSetByte(node, str::visibility, visibilityValue);
// In this case we want to force the visibility to be this current value.
// So we first need to remove any visibility flag, and then we set the new one
Expand Down
7 changes: 7 additions & 0 deletions testsuite/test_1610/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Proper support of arnold:visibility in hydra

See #1610

author: sebastien.ortega

PARAMS: {'scene': 'test.usda'}
140 changes: 140 additions & 0 deletions testsuite/test_1610/data/test.usda

Large diffs are not rendered by default.

210 changes: 210 additions & 0 deletions testsuite/test_1610/ref/reference.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
00:00:00 92MB | log started Mon Jul 22 18:16:45 2024
00:00:00 92MB | Arnold 7.3.3.0 [321d3b3a] windows x86_64 clang-15.0.7 oiio-2.4.1 osl-1.13.0 vdb-11.0.0 adlsdk-8.0.7.50 clmhub-3.1.1.43 rlm-14.2.5 optix-8.0.0 2024/07/08 17:34:38
00:00:00 92MB | running on REMS4QL1726, pid=14516
00:00:00 92MB | 2 x Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz (32 cores, 64 logical) with 65154MB
00:00:00 106MB | NVIDIA driver version 551.23
00:00:00 106MB | GPU 0: Quadro RTX 4000 @ 1545MHz (compute 7.5) with 8191MB (3930MB available) (NVLink:0)
00:00:00 106MB | Windows 10 (version 10.0, build 19045)
00:00:00 106MB | soft limit for open files is set at 2048
00:00:00 106MB |
00:00:00 106MB | Installing system handler with mask 255
00:00:00 117MB | loading plugins from C:\arnold\arnold-usd\build\windows_x86_64\msvc_opt\usd-0.23.11_arnold-7.3.3.0\plugins\procedural ...
00:00:00 126MB | usd_proc.dll: usd uses Arnold 7.3.3.0
00:00:00 126MB | loaded 1 plugins from 1 lib(s) in 0:00.11
00:00:00 126MB | loading plugins from C:\arnold\sdk\latest\bin\..\plugins ...
00:00:00 126MB | alembic_proc.dll: alembic uses Arnold 7.3.3.0
00:00:00 126MB | cryptomatte.dll: cryptomatte uses Arnold 7.3.3.0
00:00:00 127MB | cryptomatte.dll: cryptomatte_filter uses Arnold 7.3.3.0
00:00:00 127MB | cryptomatte.dll: cryptomatte_manifest_driver uses Arnold 7.3.3.0
00:00:00 127MB | skipping already loaded plugin: C:\arnold\sdk\latest\bin\..\plugins\usd_proc.dll ...
00:00:00 127MB | loaded 4 plugins from 2 lib(s) in 0:00.00
00:00:00 131MB | [kick] command: C:\arnold\sdk\latest\bin\kick test.usda -dw -r 160 120 -sm lambert -bs 16 -sl -o testrender.tif -set driver_tiff.dither false -nocrashpopup -dp -v 6
00:00:00 131MB | loading plugins from . ...
00:00:00 132MB | no plugins loaded
00:00:00 132MB | ARNOLD_ADP_DISABLE envar passed in -- ADP is disabled for this session
00:00:00 170MB | [kick] applying 2 attr value overrides
00:00:00 170MB |
00:00:00 170MB WARNING | rendering with watermarks because the skip_license_check option was enabled
00:00:00 170MB |
00:00:00 171MB | [color_manager] using color manager ai_default_color_manager_ocio of type "color_manager_ocio"
00:00:00 172MB | [color_manager_ocio] ai_default_color_manager_ocio : using builtin OCIO configuration file C:\arnold\sdk\latest\bin\../ocio/configs/arnold/config.ocio
00:00:00 172MB | [color_manager] rendering color space is "ACEScg"
00:00:00 227MB |
00:00:00 227MB | there are 1 light and 2 objects:
00:00:00 227MB | 1 persp_camera
00:00:00 227MB | 1 distant_light
00:00:00 227MB | 2 utility
00:00:00 227MB | 1 standard_surface
00:00:00 227MB | 1 driver_tiff
00:00:00 227MB | 2 box_filter
00:00:00 227MB | 1 gaussian_filter
00:00:00 227MB | 1 polymesh
00:00:00 227MB | 2 list_aggregate
00:00:00 227MB | 2 color_manager_ocio
00:00:00 227MB |
00:00:00 227MB | rendering image at 160 x 120, 3 AA samples
00:00:00 227MB | AA samples max <disabled>
00:00:00 227MB | AA sample clamp <disabled>
00:00:00 227MB | diffuse samples 2 / depth 1
00:00:00 227MB | specular samples 2 / depth 1
00:00:00 227MB | transmission samples 2 / depth 8
00:00:00 227MB | volume indirect <disabled by depth>
00:00:00 227MB | total depth 10
00:00:00 227MB | bssrdf samples 2
00:00:00 227MB | light <using per light samples>
00:00:00 227MB | transparency depth 10
00:00:00 227MB | Full scene init/update requested for final render pass
00:00:00 227MB | full scene initialize (11 nodes)
00:00:00 228MB | creating root object list ...
00:00:00 228MB | full scene initialize done in 0:00.00 (multithreaded)
00:00:00 228MB | full scene update (12 nodes)
00:00:00 229MB | /directionalLight1/directionalLightShape1: distant_light using 1 sample, 2 volume samples
00:00:00 229MB | [color_manager_ocio] ai_default_color_manager_ocio : using builtin OCIO configuration file C:\arnold\sdk\latest\bin\../ocio/configs/arnold/config.ocio
00:00:00 229MB | scene bounds: (-1.00000012 -1 -0.951056719) -> (1 1 0.9510566)
00:00:00 229MB | full scene update done in 0:00.00 (multithreaded)
00:00:00 229MB | [light_sampler] Group 0: Total number of lights 1, sampled lights 0, fixed lights 1
00:00:00 229MB | [light_sampler] Group 0: Took 0.000000 ms to build the tree
00:00:00 229MB | [aov] parsing 1 output statements ...
00:00:00 229MB | [aov] registered driver: "kick_driver" (driver_tiff)
00:00:00 229MB | [aov] * "RGBA" of type RGBA filtered by "kick_filter" (gaussian_filter)
00:00:00 229MB | [aov] done preparing 2 AOVs for 1 output to 1 driver (0 deep AOVs)
00:00:00 230MB | starting 64 bucket workers of size 16x16 ...
00:00:00 234MB | [accel] polymesh bvh4 done - 0:00.00 (wall time) - 100 prims, 1 key
00:00:00 243MB | 1% done - 98 rays/pixel
00:00:00 247MB | 5% done - 23 rays/pixel
00:00:00 247MB | 10% done - 29 rays/pixel
00:00:00 247MB | 15% done - 12 rays/pixel
00:00:00 249MB | 20% done - 37 rays/pixel
00:00:00 250MB | 25% done - 34 rays/pixel
00:00:00 250MB | 30% done - 7 rays/pixel
00:00:00 250MB | 35% done - 13 rays/pixel
00:00:00 250MB | 40% done - 23 rays/pixel
00:00:00 250MB | 45% done - 11 rays/pixel
00:00:00 250MB | 50% done - 3 rays/pixel
00:00:00 252MB | 55% done - 19 rays/pixel
00:00:00 252MB | 60% done - 8 rays/pixel
00:00:00 253MB | 65% done - 10 rays/pixel
00:00:00 254MB | 70% done - 6 rays/pixel
00:00:00 256MB | 75% done - 12 rays/pixel
00:00:00 257MB | 80% done - 13 rays/pixel
00:00:00 258MB | 85% done - 5 rays/pixel
00:00:00 260MB | 90% done - 11 rays/pixel
00:00:00 260MB | 95% done - 5 rays/pixel
00:00:00 260MB | 100% done - 5 rays/pixel
00:00:00 260MB | render done in 0:00.061
00:00:00 260MB | [driver_tiff] writing file `testrender.tif'
00:00:00 261MB | render done
00:00:00 261MB |
00:00:00 261MB | -----------------------------------------------------------------------------------
00:00:00 261MB | scene creation time 0:00.30 machine utilization (0.40%)
00:00:00 261MB | unaccounted 0:00.30
00:00:00 261MB | -----------------------------------------------------------------------------------
00:00:00 261MB | frame time 0:00.13 machine utilization (5.81%)
00:00:00 261MB | driver init/close 0:00.01
00:00:00 261MB | rendering 0:00.06
00:00:00 261MB | pixel rendering 0:00.06
00:00:00 261MB | unaccounted 0:00.06
00:00:00 261MB | -----------------------------------------------------------------------------------
00:00:00 261MB | top session self-times by category
00:00:00 261MB | accumulateBucketSamples 0:00.00 (18.66%)
00:00:00 261MB | sampleNextBatch 0:00.00 (15.90%)
00:00:00 261MB | Plugin loader 0:00.00 (12.51%)
00:00:00 261MB | AiSceneLoad 0:00.00 ( 9.38%)
00:00:00 261MB | TraceCameraRay 0:00.00 ( 9.29%)
00:00:00 261MB | ray traversal+intersection 0:00.00 ( 6.40%)
00:00:00 261MB | ADP 0:00.00 ( 6.30%)
00:00:00 261MB | surface closure (/mtl/standardSurface1/standardSurface1) 0:00.00 ( 4.70%)
00:00:00 261MB | AtRenderSession::Setup 0:00.00 ( 3.10%)
00:00:00 261MB | AiMalloc 0:00.00 ( 3.09%)
00:00:00 261MB | polymesh::intersect (/pSphere1/pSphereShape1) 0:00.00 ( 3.09%)
00:00:00 261MB | standard_surface (/mtl/standardSurface1/standardSurface1) 0:00.00 ( 2.99%)
00:00:00 261MB | -----------------------------------------------------------------------------------
00:00:00 261MB | top session self-times by node
00:00:00 261MB | accumulateBucketSamples 0:00.00 (18.66%)
00:00:00 261MB | sampleNextBatch 0:00.00 (15.90%)
00:00:00 261MB | Plugin loader 0:00.00 (12.51%)
00:00:00 261MB | standard_surface:/mtl/standardSurface1/standardSurface1 0:00.00 (10.88%)
00:00:00 261MB | surface closure 0:00.00 ( 4.70%)
00:00:00 261MB | ray traversal+intersection 0:00.00 ( 3.19%)
00:00:00 261MB | AiSceneLoad 0:00.00 ( 9.38%)
00:00:00 261MB | TraceCameraRay 0:00.00 ( 9.29%)
00:00:00 261MB | ADP 0:00.00 ( 6.30%)
00:00:00 261MB | polymesh:/pSphere1/pSphereShape1 0:00.00 ( 4.59%)
00:00:00 261MB | polymesh::intersect 0:00.00 ( 3.09%)
00:00:00 261MB | BVH::intersect 0:00.00 ( 1.50%)
00:00:00 261MB | ray traversal+intersection 0:00.00 ( 3.20%)
00:00:00 261MB | AtRenderSession::Setup 0:00.00 ( 3.10%)
00:00:00 261MB | AiMalloc 0:00.00 ( 3.09%)
00:00:00 261MB | -----------------------------------------------------------------------------------
00:00:00 261MB | peak CPU memory used 261.70MB
00:00:00 261MB | at startup 76.86MB
00:00:00 261MB | plugins 0.06MB
00:00:00 261MB | AOV samples 0.17MB
00:00:00 261MB | output buffers 0.14MB
00:00:00 261MB | framebuffers 0.31MB
00:00:00 261MB | node overhead 0.00MB
00:00:00 261MB | message passing 0.04MB
00:00:00 261MB | memory pools 15.51MB
00:00:00 261MB | geometry 0.01MB
00:00:00 261MB | polymesh 0.01MB
00:00:00 261MB | vertices 0.00MB
00:00:00 261MB | vertex indices 0.00MB
00:00:00 261MB | packed normals 0.00MB
00:00:00 261MB | normal indices 0.00MB
00:00:00 261MB | uv coords 0.00MB
00:00:00 261MB | uv coords idxs 0.00MB
00:00:00 261MB | uniform indices 0.00MB
00:00:00 261MB | userdata 0.01MB
00:00:00 262MB | accel structs 0.01MB
00:00:00 262MB | strings 24.50MB
00:00:00 262MB | profiler 0.00MB
00:00:00 262MB | backtrace handler 29.85MB
00:00:00 262MB | unaccounted 114.24MB
00:00:00 262MB | -----------------------------------------------------------------------------------
00:00:00 262MB | ray counts ( /pixel, /sample) (% total) (avg. hits) (max hits)
00:00:00 262MB | camera 195440 ( 10.18, 1.00) ( 66.90%) ( 0.06) ( 1)
00:00:00 262MB | shadow 9539 ( 0.50, 0.05) ( 3.27%) ( 0.00) ( 0)
00:00:00 262MB | diffuse_reflect 45016 ( 2.34, 0.23) ( 15.41%) ( 0.00) ( 0)
00:00:00 262MB | specular_reflect 42153 ( 2.20, 0.22) ( 14.43%) ( 0.00) ( 0)
00:00:00 262MB | total 292148 ( 15.22, 1.49) (100.00%) ( 0.04) ( 1)
00:00:00 262MB | by ray depth: 0 1
00:00:00 262MB | total 70.2% 29.8%
00:00:00 262MB | -----------------------------------------------------------------------------------
00:00:00 262MB | shader calls ( /pixel, /sample) (% total)
00:00:00 262MB | primary 11254 ( 0.59, 0.06) (100.00%)
00:00:00 262MB | total 11254 ( 0.59, 0.06) (100.00%)
00:00:00 262MB | by ray depth: 0 1
00:00:00 262MB | total 100.0% 0.0%
00:00:00 262MB | -----------------------------------------------------------------------------------
00:00:00 262MB | geometry (% hit ) (instances) ( init mem, final mem)
00:00:00 262MB | lists 1 (100.0%) ( 0) ( 0.00, 0.00)
00:00:00 262MB | polymeshes 1 (100.0%) ( 0) ( 0.01, 0.01)
00:00:00 262MB | -----------------------------------------------------------------------------------
00:00:00 262MB | geometric elements ( min) ( avg.) ( max)
00:00:00 262MB | polygons 100 ( 100) ( 100.0) ( 100)
00:00:00 262MB | -----------------------------------------------------------------------------------
00:00:00 262MB | triangle tessellation ( min) ( avg.) ( max) (/ element) (% total)
00:00:00 262MB | polymeshes 180 ( 180) ( 180.0) ( 180) ( 1.80) (100.00%)
00:00:00 262MB | unique triangles 180
00:00:00 262MB | largest polymeshes by triangle count
00:00:00 262MB | 180 tris -- /pSphere1/pSphereShape1
00:00:00 262MB | -----------------------------------------------------------------------------------
00:00:00 262MB | acceleration structures: (% total)
00:00:00 262MB | list 1 ( 50.00%)
00:00:00 262MB | bvh 1 ( 50.00%)
00:00:00 262MB | total 2 (100.00%)
00:00:00 262MB | -----------------------------------------------------------------------------------
00:00:00 262MB | number of warnings, warning type:
00:00:00 262MB | 1: rendering with watermarks because the skip_license_check option was enabled
00:00:00 262MB | -----------------------------------------------------------------------------------
00:00:00 262MB |
00:00:00 262MB | releasing resources
00:00:00 191MB |
00:00:00 191MB | releasing resources
00:00:00 177MB | unloading 3 plugins
00:00:00 177MB | closing usd_proc.dll ...
00:00:00 177MB | closing alembic_proc.dll ...
00:00:00 177MB | closing cryptomatte.dll ...
00:00:00 177MB | unloading plugins done
00:00:00 177MB | Arnold shutdown
00:00:00 163MB | Installing system handler with mask 0
Binary file added testsuite/test_1610/ref/reference.tif
Binary file not shown.

0 comments on commit a33145a

Please sign in to comment.