why is the switch lop so slow?

   1431   3   1
User Avatar
Member
341 posts
Joined: Feb. 2017
Offline
I'm still on 19.0.622 so maybe this has been addressed, but the switch lop is very slow for what it's doing. I'm just using it to switch cameras, basically I have a bunch of cameras plugged into a switch and am using a rendersettings lop after to set the camera to
/cameras/*
so that just grabs whatever camera the switch is set to. this helps me a lot on a big project im doing where i am trying to quickly audition cameras/edits in a large scene with lots of mocap performances.

i have all the characters cached out to usd, the enviornment, and the props. and it plays back realtime when cached. but then when im using the switch node its incredible slow. it would be great to not have to cache the switch node since im changing things so frequently. just curious if there's something i may be doing wrong or if the switch node just really eats performance, and if so why that may be?
http://www.christophers.website
User Avatar
Member
8525 posts
Joined: July 2007
Online
I don't have the answer as I barely understand what's going on in LOPs

but one thing I noticed is:
Lets say I have a scene loaded into stage which plays ~20.5 fps then:

A: I branch 3 alternative cameras from the last LOP and plug them into animated switcher
- scene plays ~20 fps seemingly the same speed

B: I create switch with 3 alternative cameras as a separate stream and Sublayer LOP or Reference LOP into the main stage
- scene plays ~15 fps a bit slower

C: I create switch with 3 alternative cameras as a separate stream and Merge LOP into the main stage
- scene plays ~4.5 fps terribly slow
- however changing mode to Separate Layers seems to jump to ~15 so on par with B

so from the quick test I'd blame layering and especially Merge LOP in default mode instead of Switch LOP itself
Edited by tamte - Aug. 2, 2022 00:44:09
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Staff
4435 posts
Joined: July 2005
Offline
The switch LOP is not slow. But the performance of your whole network can depend drastically on how any animated/modified LOP node interacts with the rest of the network (just like any other network type in Houdini). So it's really not possible to answer your question without seeing how the Switch LOP integrates with the rest of your network. As tamte points out, maybe it's the Merge LOP (if you're using a Merge LOP). Maybe it's the graft branches (if you're using a Graft Branches). Maybe it's the fact that the camera switch happens before the sublayer/reference LOPs that load the rest of your scene.

One thing you may want to consider to sidestep this whole question is having all the cameras in your scene all the time to avoid any LOP node cooking at all when switching between cameras. Just use the Render Settings camera menu (or USD Render ROP, or the viewport menu) to choose your camera at the very end of your network.
User Avatar
Member
341 posts
Joined: Feb. 2017
Offline
Nice thanks! Yeah am semi aware of some of these performance things, like ther merge being kind of slow or wiring things the wrong way. The switch is nice because i can just simply tick the next thing when im ready to switch cameras. What i was doing was at the end of my chain sublayering in the rendersettings with /cameras/* and the switch.

You are right that just keyframing the cameras on already merged in cams on the rendersettings lop works too, i wouldn't have thought to keyframe that!

Sounds like a good move here might just be to do the switching at the end of the chain. Just a little annoying that the rest of the scene has to be linked in with the rest of the cameras.
http://www.christophers.website
  • Quick Links