Viewing result without s@instancefile is super fast, why?

   338   11   1
User Avatar
Member
1280 posts
Joined: April 2017
Offline
Hi!

I'm working with whe Arnold renderer and instances. The s@instancefile is used to tell each point what .ass file to use.

My HDA is to control a scatter with a paint sop just above. When I view my scatter1 HDA while painting, I get about 3 fps but if I do the exact same thing while viewing the attribdelete (removing the instancefile attrib), I get 120 fps!!!

I don't understand how it can be faster since I'm adding one more calculation with the attribdelete... The slowdown seems to only get affected by that attribute.

My scatter is only 600 points... nothing crazy.

EDIT: To clarify, I'm talking about viewport fps, not the render view.
Edited by olivierth - yesterday 15:32:31

Attachments:
Houdini_Slow_with_instancefile_01.jpg (56.8 KB)

-Olivier
User Avatar
Member
1280 posts
Joined: April 2017
Offline
...I'm getting the same fps increase when I rename s@instancefile to s@instancefileZ !

Attachments:
Houdini_Slow_with_instancefile_02.jpg (56.4 KB)

-Olivier
User Avatar
Staff
5342 posts
Joined: July 2005
Online
`instanceFile` is a special attribute that the viewport recognizes to do instancing. It loads whatever file that attribute is pointing to and draws it instead of the point markers. It'll be naturally slower if the geometry in the file is anything more that a few polygons. It shouldn't be super slow unless the file is millions of polygons, though.
User Avatar
Member
1280 posts
Joined: April 2017
Offline
I see. Since I only need those .ass files at render time, is there a setting I can change so Houdini doesn't constantly try to access those files while I'm working? It's making my HDA nearly unusable.
-Olivier
User Avatar
Member
9752 posts
Joined: July 2007
Offline
olivierth
is there a setting ...
Display Options/Geometry/Instancing/Point Instancing
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
1280 posts
Joined: April 2017
Offline
I just tried turning off Point Instancing in the display options but it's still slow when I paint.
-Olivier
User Avatar
Staff
5342 posts
Joined: July 2005
Online
In SOPs, the display and render flags can be on different nodes. You could try setting the attribute "file" and do your scattering, and display that. Then put the render flag on an AttribRename SOP connected to the display SOP that renames file to instancefile. The viewport won't see the instancing but renderers will.

If you'd like to submit a bug with your HDA and sample hip file, we can take a look and determine why exactly it's slow. 3fps seems a bit excessive even for instancing.
User Avatar
Member
9752 posts
Joined: July 2007
Offline
If you go with Display/Render flag make sure you test it thoroughly

I remember having issues when using Arnold that sometimes the geo that got to renderer was in the display flag stream, it was never when the Disp/Render flags were directly one level under the object being rendered, but when a Subnet or HDA internally had Display/Render stream and the geo was further Object merged to a different place etc, Mantra was fine however

And while Id expect it to work regardless of the renderer as I assume Houdini is the one that reaolves which streams to cook before it hands over the geo to renderer it simply was not working in those specific cases with Arnold so keep that in mind if you start seeing similar behavior
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
1280 posts
Joined: April 2017
Offline
malexander: Thanks, this actually sounds like a great workaround. I'll test it out!

tamte: I'm very aware of that problem. In my case, its nothing to be worried about. I won't render my HDA directly.
-Olivier
User Avatar
Member
1280 posts
Joined: April 2017
Offline
Arg! I misunderstood what you were explaining. It doesn't work in my case.

The thing about my HDA, its super important that it outputs the s@instancefile to the next node. My HDA is made to be placed in a daisy chain. If I loose the s@instancefile along the way, I'm screwed.

If only there was a way that the display flag on my HDA would not have the s@instancefile BUT, the output would have the s@instancefile... I'm starting to think I'll need to have 2 outputs:

output 0: No s@instancefile (the displayed one)
output 1: with s@instancefile

...and I'll have to be careful to always use the second output to continue de daisy chain.
Edited by olivierth - today 14:39:06
-Olivier
User Avatar
Staff
468 posts
Joined: Feb. 2008
Offline
Add an output node with a negative index (-1) so the output doesn't appear on your HDA node unnecessarily. Pipe the geo with the instancefile attrib deleted into this output and in your HDA add onCreated and onLoaded scripts set to python with
kwargs["node"].setOutputForViewFlag(-1)
User Avatar
Member
9752 posts
Joined: July 2007
Offline
olivierth
If only there was a way that the display flag on my HDA would not have the s@instancefile BUT, the output would have the s@instancefile..
that's what Display/Render flags on the nodes inside of your HDAs are for (but you can't have any Output SOPs in there in that case)
your HDA will output Display stream during interactive cooking and Render stream during caching/rendering, with that caveat that Arnold sometimes seemed to force the display stream within submets or through object merges
however if you always cache your points using Houdin's file cache that should properly trigger Render streams within HDAs/submets/.. etc and if not it'd or sure be a Houdini bug so it's easier to report and actually have it resolved
Edited by tamte - today 15:48:08
Tomas Slancik
CG Supervisor
Framestore, NY
  • Quick Links