DrawOverride compared to GeometryOverride very much slower.

DrawOverride compared to GeometryOverride very much slower.

haggi_master
Advocate Advocate
960 Views
9 Replies
Message 1 of 10

DrawOverride compared to GeometryOverride very much slower.

haggi_master
Advocate
Advocate

Hi,

I finally tried to draw my locators with a drawOverride and it is possible to disable the drawing per viewport what seems not to be possible with geometryOverride.

In geometryOverride and drawOverride I only use the addUIDrawables() method, not the populateGeometry or any draw methods, with exact the same calculations, but the drawOverride seems to be very much slower than the geometryOverride. Is this an expected behaviour?

0 Likes
Accepted solutions (1)
961 Views
9 Replies
Replies (9)
Message 2 of 10

haggi_master
Advocate
Advocate

The reason is the parameter isAlwaysDirty which is true by default. If I turn it off, it is fast again, but.... the my locator node disappears in all viewports if I do this:

	MUint64 excludeTypes = frameContext.objectTypeExclusions();
	if (excludeTypes > 0)
	{
		if ((excludeTypes & MHWRender::MFrameContext::kExcludeNurbsCurves))
			return;
	}

I'd prefer it it only disappears in the current viewport. I ask myself how this is done internally with all other nodes. They are fast and they only disappear in the current viewport if I turn off the corresponding visibility.

0 Likes
Message 3 of 10

BurkhardRammner
Collaborator
Collaborator

Haagggggiiiiiii....

 

so, nobody could help?

Okay, I don`t understand whats going on. You query the 'kExcludeNurbsCurves' exclude status and the result is that your locator hides in all viewports?

0 Likes
Message 4 of 10

haggi_master
Advocate
Advocate

Yepp... that's exactly what happens. I query the status and then I return without drawing the locator if nurbs curves are excluded. If I create the drawOverride with the isAlwaysDirty argument set to true, it works as expected what means that the locator is invisible only in the current viewport. If I  set the argument to false the locator disappears in all viewports. The problem with isAlwaysDirty set to true is that it slows down the VP2. I made a test with 2500 locators in my scene and with isAlwaysDirty turned off I get an framerate of 23 fps with turned on, the framerate drops to 1 or 2 fps.

0 Likes
Message 5 of 10

BurkhardRammner
Collaborator
Collaborator

Yes, I realized that you have to set the argument to 'false', too ( some years ago ).  Its nearly impossible to work without that (default should be 'false', not 'true').

However, what you say looks like its a bug, doesn`t it?

0 Likes
Message 6 of 10

haggi_master
Advocate
Advocate

To me it looks more like an performance thing. The uiDrawables method is only called if necessary if isAlwaysDirty is off, not separately for every viewport.

0 Likes
Message 7 of 10

BurkhardRammner
Collaborator
Collaborator

...mmmhh....

So, just to clarify that we are talking about the same issue:

 

You say:


my locator node disappears in all viewports if I do this:

if ((excludeTypes & MHWRender::MFrameContext::kExcludeNurbsCurves))

you don`t say:

if ((excludeTypes & MHWRender::MFrameContext::kExcludeLocators))


right?

 

Maybe I just don`t get it : )

 

 

 

 

0 Likes
Message 8 of 10

haggi_master
Advocate
Advocate

Yes, our animators want to hide the controls with the nurbsCurves visibility. The kExcludeLocators would make no sense because we can use the locators default behaviour which hides the plugin locator if if the locators are made invisible. But the animators explicitly don't want to hide our own control locators with all other locators.... we now think about converting the locators into shapes and hide them with the "pluginShapes" option.

0 Likes
Message 9 of 10

BurkhardRammner
Collaborator
Collaborator

ah...so then this behavior is obviously by design, yes  : /

0 Likes
Message 10 of 10

haggi_master
Advocate
Advocate
Accepted solution

Okay, it seems I'm quite stuipd. There is a simple solution. I registered a DisplayFilter in  and now it works as expected. Fast locators which disappear only in one viewport if I turn my new display filter off.