Skip to content

Commit a33145a

Browse files
Proper support of arnold:visibility primvar in hydra #1610 (#2022)
1 parent 29fb545 commit a33145a

File tree

6 files changed

+360
-6
lines changed

6 files changed

+360
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Pending next bugfix release
55
- [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.
6-
6+
- [usd#1610](https://github.com/Autodesk/arnold-usd/issues/1610) - Proper support of arnold:visibility primvar in hydra
77

88
## Pending feature release
99

libs/render_delegate/utils.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,7 @@ bool ConvertPrimvarToRayFlag(AtNode* node, const TfToken& name, const VtValue& v
295295
// that doesn't have any visibility attribute (e.g. a light), so we need to check
296296
// the HdArnoldRayFlags pointer exists (see #1535)
297297
if (visibility && name == _tokens->arnoldVisibility) {
298-
uint8_t visibilityValue = 0;
299-
if (value.IsHolding<int>()) {
300-
visibilityValue = value.Get<int>();
301-
}
298+
uint8_t visibilityValue = VtValueGetInt(value);
302299
AiNodeSetByte(node, str::visibility, visibilityValue);
303300
// In this case we want to force the visibility to be this current value.
304301
// So we first need to remove any visibility flag, and then we set the new one
@@ -342,7 +339,7 @@ bool ConvertPrimvarToBuiltinParameter(
342339
// we also want to support arnold:visibility as this is what the arnold-usd writer
343340
// will author
344341
if (visibility && name == _tokens->arnoldVisibility) {
345-
uint8_t visibilityValue = value.Get<int>();
342+
uint8_t visibilityValue = VtValueGetInt(value);
346343
AiNodeSetByte(node, str::visibility, visibilityValue);
347344
// In this case we want to force the visibility to be this current value.
348345
// So we first need to remove any visibility flag, and then we set the new one

testsuite/test_1610/README

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Proper support of arnold:visibility in hydra
2+
3+
See #1610
4+
5+
author: sebastien.ortega
6+
7+
PARAMS: {'scene': 'test.usda'}

testsuite/test_1610/data/test.usda

Lines changed: 140 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
00:00:00 92MB | log started Mon Jul 22 18:16:45 2024
2+
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
3+
00:00:00 92MB | running on REMS4QL1726, pid=14516
4+
00:00:00 92MB | 2 x Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz (32 cores, 64 logical) with 65154MB
5+
00:00:00 106MB | NVIDIA driver version 551.23
6+
00:00:00 106MB | GPU 0: Quadro RTX 4000 @ 1545MHz (compute 7.5) with 8191MB (3930MB available) (NVLink:0)
7+
00:00:00 106MB | Windows 10 (version 10.0, build 19045)
8+
00:00:00 106MB | soft limit for open files is set at 2048
9+
00:00:00 106MB |
10+
00:00:00 106MB | Installing system handler with mask 255
11+
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 ...
12+
00:00:00 126MB | usd_proc.dll: usd uses Arnold 7.3.3.0
13+
00:00:00 126MB | loaded 1 plugins from 1 lib(s) in 0:00.11
14+
00:00:00 126MB | loading plugins from C:\arnold\sdk\latest\bin\..\plugins ...
15+
00:00:00 126MB | alembic_proc.dll: alembic uses Arnold 7.3.3.0
16+
00:00:00 126MB | cryptomatte.dll: cryptomatte uses Arnold 7.3.3.0
17+
00:00:00 127MB | cryptomatte.dll: cryptomatte_filter uses Arnold 7.3.3.0
18+
00:00:00 127MB | cryptomatte.dll: cryptomatte_manifest_driver uses Arnold 7.3.3.0
19+
00:00:00 127MB | skipping already loaded plugin: C:\arnold\sdk\latest\bin\..\plugins\usd_proc.dll ...
20+
00:00:00 127MB | loaded 4 plugins from 2 lib(s) in 0:00.00
21+
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
22+
00:00:00 131MB | loading plugins from . ...
23+
00:00:00 132MB | no plugins loaded
24+
00:00:00 132MB | ARNOLD_ADP_DISABLE envar passed in -- ADP is disabled for this session
25+
00:00:00 170MB | [kick] applying 2 attr value overrides
26+
00:00:00 170MB |
27+
00:00:00 170MB WARNING | rendering with watermarks because the skip_license_check option was enabled
28+
00:00:00 170MB |
29+
00:00:00 171MB | [color_manager] using color manager ai_default_color_manager_ocio of type "color_manager_ocio"
30+
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
31+
00:00:00 172MB | [color_manager] rendering color space is "ACEScg"
32+
00:00:00 227MB |
33+
00:00:00 227MB | there are 1 light and 2 objects:
34+
00:00:00 227MB | 1 persp_camera
35+
00:00:00 227MB | 1 distant_light
36+
00:00:00 227MB | 2 utility
37+
00:00:00 227MB | 1 standard_surface
38+
00:00:00 227MB | 1 driver_tiff
39+
00:00:00 227MB | 2 box_filter
40+
00:00:00 227MB | 1 gaussian_filter
41+
00:00:00 227MB | 1 polymesh
42+
00:00:00 227MB | 2 list_aggregate
43+
00:00:00 227MB | 2 color_manager_ocio
44+
00:00:00 227MB |
45+
00:00:00 227MB | rendering image at 160 x 120, 3 AA samples
46+
00:00:00 227MB | AA samples max <disabled>
47+
00:00:00 227MB | AA sample clamp <disabled>
48+
00:00:00 227MB | diffuse samples 2 / depth 1
49+
00:00:00 227MB | specular samples 2 / depth 1
50+
00:00:00 227MB | transmission samples 2 / depth 8
51+
00:00:00 227MB | volume indirect <disabled by depth>
52+
00:00:00 227MB | total depth 10
53+
00:00:00 227MB | bssrdf samples 2
54+
00:00:00 227MB | light <using per light samples>
55+
00:00:00 227MB | transparency depth 10
56+
00:00:00 227MB | Full scene init/update requested for final render pass
57+
00:00:00 227MB | full scene initialize (11 nodes)
58+
00:00:00 228MB | creating root object list ...
59+
00:00:00 228MB | full scene initialize done in 0:00.00 (multithreaded)
60+
00:00:00 228MB | full scene update (12 nodes)
61+
00:00:00 229MB | /directionalLight1/directionalLightShape1: distant_light using 1 sample, 2 volume samples
62+
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
63+
00:00:00 229MB | scene bounds: (-1.00000012 -1 -0.951056719) -> (1 1 0.9510566)
64+
00:00:00 229MB | full scene update done in 0:00.00 (multithreaded)
65+
00:00:00 229MB | [light_sampler] Group 0: Total number of lights 1, sampled lights 0, fixed lights 1
66+
00:00:00 229MB | [light_sampler] Group 0: Took 0.000000 ms to build the tree
67+
00:00:00 229MB | [aov] parsing 1 output statements ...
68+
00:00:00 229MB | [aov] registered driver: "kick_driver" (driver_tiff)
69+
00:00:00 229MB | [aov] * "RGBA" of type RGBA filtered by "kick_filter" (gaussian_filter)
70+
00:00:00 229MB | [aov] done preparing 2 AOVs for 1 output to 1 driver (0 deep AOVs)
71+
00:00:00 230MB | starting 64 bucket workers of size 16x16 ...
72+
00:00:00 234MB | [accel] polymesh bvh4 done - 0:00.00 (wall time) - 100 prims, 1 key
73+
00:00:00 243MB | 1% done - 98 rays/pixel
74+
00:00:00 247MB | 5% done - 23 rays/pixel
75+
00:00:00 247MB | 10% done - 29 rays/pixel
76+
00:00:00 247MB | 15% done - 12 rays/pixel
77+
00:00:00 249MB | 20% done - 37 rays/pixel
78+
00:00:00 250MB | 25% done - 34 rays/pixel
79+
00:00:00 250MB | 30% done - 7 rays/pixel
80+
00:00:00 250MB | 35% done - 13 rays/pixel
81+
00:00:00 250MB | 40% done - 23 rays/pixel
82+
00:00:00 250MB | 45% done - 11 rays/pixel
83+
00:00:00 250MB | 50% done - 3 rays/pixel
84+
00:00:00 252MB | 55% done - 19 rays/pixel
85+
00:00:00 252MB | 60% done - 8 rays/pixel
86+
00:00:00 253MB | 65% done - 10 rays/pixel
87+
00:00:00 254MB | 70% done - 6 rays/pixel
88+
00:00:00 256MB | 75% done - 12 rays/pixel
89+
00:00:00 257MB | 80% done - 13 rays/pixel
90+
00:00:00 258MB | 85% done - 5 rays/pixel
91+
00:00:00 260MB | 90% done - 11 rays/pixel
92+
00:00:00 260MB | 95% done - 5 rays/pixel
93+
00:00:00 260MB | 100% done - 5 rays/pixel
94+
00:00:00 260MB | render done in 0:00.061
95+
00:00:00 260MB | [driver_tiff] writing file `testrender.tif'
96+
00:00:00 261MB | render done
97+
00:00:00 261MB |
98+
00:00:00 261MB | -----------------------------------------------------------------------------------
99+
00:00:00 261MB | scene creation time 0:00.30 machine utilization (0.40%)
100+
00:00:00 261MB | unaccounted 0:00.30
101+
00:00:00 261MB | -----------------------------------------------------------------------------------
102+
00:00:00 261MB | frame time 0:00.13 machine utilization (5.81%)
103+
00:00:00 261MB | driver init/close 0:00.01
104+
00:00:00 261MB | rendering 0:00.06
105+
00:00:00 261MB | pixel rendering 0:00.06
106+
00:00:00 261MB | unaccounted 0:00.06
107+
00:00:00 261MB | -----------------------------------------------------------------------------------
108+
00:00:00 261MB | top session self-times by category
109+
00:00:00 261MB | accumulateBucketSamples 0:00.00 (18.66%)
110+
00:00:00 261MB | sampleNextBatch 0:00.00 (15.90%)
111+
00:00:00 261MB | Plugin loader 0:00.00 (12.51%)
112+
00:00:00 261MB | AiSceneLoad 0:00.00 ( 9.38%)
113+
00:00:00 261MB | TraceCameraRay 0:00.00 ( 9.29%)
114+
00:00:00 261MB | ray traversal+intersection 0:00.00 ( 6.40%)
115+
00:00:00 261MB | ADP 0:00.00 ( 6.30%)
116+
00:00:00 261MB | surface closure (/mtl/standardSurface1/standardSurface1) 0:00.00 ( 4.70%)
117+
00:00:00 261MB | AtRenderSession::Setup 0:00.00 ( 3.10%)
118+
00:00:00 261MB | AiMalloc 0:00.00 ( 3.09%)
119+
00:00:00 261MB | polymesh::intersect (/pSphere1/pSphereShape1) 0:00.00 ( 3.09%)
120+
00:00:00 261MB | standard_surface (/mtl/standardSurface1/standardSurface1) 0:00.00 ( 2.99%)
121+
00:00:00 261MB | -----------------------------------------------------------------------------------
122+
00:00:00 261MB | top session self-times by node
123+
00:00:00 261MB | accumulateBucketSamples 0:00.00 (18.66%)
124+
00:00:00 261MB | sampleNextBatch 0:00.00 (15.90%)
125+
00:00:00 261MB | Plugin loader 0:00.00 (12.51%)
126+
00:00:00 261MB | standard_surface:/mtl/standardSurface1/standardSurface1 0:00.00 (10.88%)
127+
00:00:00 261MB | surface closure 0:00.00 ( 4.70%)
128+
00:00:00 261MB | ray traversal+intersection 0:00.00 ( 3.19%)
129+
00:00:00 261MB | AiSceneLoad 0:00.00 ( 9.38%)
130+
00:00:00 261MB | TraceCameraRay 0:00.00 ( 9.29%)
131+
00:00:00 261MB | ADP 0:00.00 ( 6.30%)
132+
00:00:00 261MB | polymesh:/pSphere1/pSphereShape1 0:00.00 ( 4.59%)
133+
00:00:00 261MB | polymesh::intersect 0:00.00 ( 3.09%)
134+
00:00:00 261MB | BVH::intersect 0:00.00 ( 1.50%)
135+
00:00:00 261MB | ray traversal+intersection 0:00.00 ( 3.20%)
136+
00:00:00 261MB | AtRenderSession::Setup 0:00.00 ( 3.10%)
137+
00:00:00 261MB | AiMalloc 0:00.00 ( 3.09%)
138+
00:00:00 261MB | -----------------------------------------------------------------------------------
139+
00:00:00 261MB | peak CPU memory used 261.70MB
140+
00:00:00 261MB | at startup 76.86MB
141+
00:00:00 261MB | plugins 0.06MB
142+
00:00:00 261MB | AOV samples 0.17MB
143+
00:00:00 261MB | output buffers 0.14MB
144+
00:00:00 261MB | framebuffers 0.31MB
145+
00:00:00 261MB | node overhead 0.00MB
146+
00:00:00 261MB | message passing 0.04MB
147+
00:00:00 261MB | memory pools 15.51MB
148+
00:00:00 261MB | geometry 0.01MB
149+
00:00:00 261MB | polymesh 0.01MB
150+
00:00:00 261MB | vertices 0.00MB
151+
00:00:00 261MB | vertex indices 0.00MB
152+
00:00:00 261MB | packed normals 0.00MB
153+
00:00:00 261MB | normal indices 0.00MB
154+
00:00:00 261MB | uv coords 0.00MB
155+
00:00:00 261MB | uv coords idxs 0.00MB
156+
00:00:00 261MB | uniform indices 0.00MB
157+
00:00:00 261MB | userdata 0.01MB
158+
00:00:00 262MB | accel structs 0.01MB
159+
00:00:00 262MB | strings 24.50MB
160+
00:00:00 262MB | profiler 0.00MB
161+
00:00:00 262MB | backtrace handler 29.85MB
162+
00:00:00 262MB | unaccounted 114.24MB
163+
00:00:00 262MB | -----------------------------------------------------------------------------------
164+
00:00:00 262MB | ray counts ( /pixel, /sample) (% total) (avg. hits) (max hits)
165+
00:00:00 262MB | camera 195440 ( 10.18, 1.00) ( 66.90%) ( 0.06) ( 1)
166+
00:00:00 262MB | shadow 9539 ( 0.50, 0.05) ( 3.27%) ( 0.00) ( 0)
167+
00:00:00 262MB | diffuse_reflect 45016 ( 2.34, 0.23) ( 15.41%) ( 0.00) ( 0)
168+
00:00:00 262MB | specular_reflect 42153 ( 2.20, 0.22) ( 14.43%) ( 0.00) ( 0)
169+
00:00:00 262MB | total 292148 ( 15.22, 1.49) (100.00%) ( 0.04) ( 1)
170+
00:00:00 262MB | by ray depth: 0 1
171+
00:00:00 262MB | total 70.2% 29.8%
172+
00:00:00 262MB | -----------------------------------------------------------------------------------
173+
00:00:00 262MB | shader calls ( /pixel, /sample) (% total)
174+
00:00:00 262MB | primary 11254 ( 0.59, 0.06) (100.00%)
175+
00:00:00 262MB | total 11254 ( 0.59, 0.06) (100.00%)
176+
00:00:00 262MB | by ray depth: 0 1
177+
00:00:00 262MB | total 100.0% 0.0%
178+
00:00:00 262MB | -----------------------------------------------------------------------------------
179+
00:00:00 262MB | geometry (% hit ) (instances) ( init mem, final mem)
180+
00:00:00 262MB | lists 1 (100.0%) ( 0) ( 0.00, 0.00)
181+
00:00:00 262MB | polymeshes 1 (100.0%) ( 0) ( 0.01, 0.01)
182+
00:00:00 262MB | -----------------------------------------------------------------------------------
183+
00:00:00 262MB | geometric elements ( min) ( avg.) ( max)
184+
00:00:00 262MB | polygons 100 ( 100) ( 100.0) ( 100)
185+
00:00:00 262MB | -----------------------------------------------------------------------------------
186+
00:00:00 262MB | triangle tessellation ( min) ( avg.) ( max) (/ element) (% total)
187+
00:00:00 262MB | polymeshes 180 ( 180) ( 180.0) ( 180) ( 1.80) (100.00%)
188+
00:00:00 262MB | unique triangles 180
189+
00:00:00 262MB | largest polymeshes by triangle count
190+
00:00:00 262MB | 180 tris -- /pSphere1/pSphereShape1
191+
00:00:00 262MB | -----------------------------------------------------------------------------------
192+
00:00:00 262MB | acceleration structures: (% total)
193+
00:00:00 262MB | list 1 ( 50.00%)
194+
00:00:00 262MB | bvh 1 ( 50.00%)
195+
00:00:00 262MB | total 2 (100.00%)
196+
00:00:00 262MB | -----------------------------------------------------------------------------------
197+
00:00:00 262MB | number of warnings, warning type:
198+
00:00:00 262MB | 1: rendering with watermarks because the skip_license_check option was enabled
199+
00:00:00 262MB | -----------------------------------------------------------------------------------
200+
00:00:00 262MB |
201+
00:00:00 262MB | releasing resources
202+
00:00:00 191MB |
203+
00:00:00 191MB | releasing resources
204+
00:00:00 177MB | unloading 3 plugins
205+
00:00:00 177MB | closing usd_proc.dll ...
206+
00:00:00 177MB | closing alembic_proc.dll ...
207+
00:00:00 177MB | closing cryptomatte.dll ...
208+
00:00:00 177MB | unloading plugins done
209+
00:00:00 177MB | Arnold shutdown
210+
00:00:00 163MB | Installing system handler with mask 0
3.03 KB
Binary file not shown.

0 commit comments

Comments
 (0)