AB4D Forum

Full Version: Update to new version
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I've tried updating from version 4.2.7655 to version 4.4.7848 and I've observed issues while having 1 main and 3 child DXViewportViews. I have this setup:
1. Each DXViewportView has a Viewport3D for camera.
2. Main DXViewportView has lighting and wire grid in Viewport3D.
3. Child viewport uses master rendering steps.
4. Non-helper objects is rendered using SceneNodes.

The issues I've discovered are:
1. When I toggle visibility on a SceneNode objects in child node are no longer refreshed. The visibility of the node is set as following (and works for 4.2.7655)
sceneNode.IsVisible = visible;
2. Toggling wireframe was done by setting rasterizer state
DXScene.DefaultRenderObjectsRenderingStep.OverrideRasterizerState = DXScene.DXDevice.CommonStates.WireframeCullNone;
This now crashes with an exception - The previous thread has not finished.
3. Setting visibility on ContentVisual3D (the visual that contains wire grid) does not correctly update in child views.

Most of the issues are resolved, when I move camera in each view (it looks to me like directx stops rendering for inactive viewports and uses some stored backbuffer). 

Is this intended behavior and am I just wrongly setting flags?

Janovsky Roman
I've tried to collect a bit more information about the thread exception:

2021-07-07 14:03:38.374 DXEngine Fatal:    Unhandled exception in RenderScene: Still waiting for previous thread to finish rendering
    Still waiting for previous thread to finish rendering
      at Ab3d.DirectX.CompleteRenderingStep.OnRun(RenderingContext renderingContext)
      at Ab3d.DirectX.RenderingStepBase.Run(RenderingContext renderingContext)
      at Ab3d.DirectX.DXScene.al(RenderingContext a)
      at Ab3d.DirectX.DXScene.ak(RenderingContext a, Boolean b, Boolean c, DXScene d)
      at Ab3d.DirectX.DXScene.RenderScene(DXScene childDXScene, Boolean forceRender, Boolean forceUpdate)
      at Ab3d.DirectX.Controls.DXView.RenderScene(Boolean forceRender, Boolean forceUpdate)
      at Ab3d.DirectX.Controls.DXView.RenderScene(Boolean forceRender, Boolean forceUpdate)
      at Ab3d.DirectX.Controls.DXView.j(Object a, EventArgs b)

It happens, when I change selection (outline), animate the object (transformation). Both happen in a locked access from DXViewportView.SceneUpdating. There I run my own update of my data and also update (if needed) of SceneNodes (selection, animation, visibility, rendering queues). The SceneNodes are modified and Notify* is called.
When using multiple child DXViewportView that use RenderingSteps from master DXViewportView (useMasterRenderingSteps constructor parameter is true) then using the new background waiting for rendering to be completed (a feature introduced in v4.4) may throw an exception with the message: "Still waiting for previous thread to finish rendering".

A new fixed version will be provided in the following days.

Until then in case of this exception, a workaround is to disable background waiting for rendering to be completed - this is done by setting the DXViewportView.IsWaitingInBackgroundUntilRendered to false.
A new version 4.4.7874 has been published and it fixes the problems described in this post. If you are using multiple DXViewportViews then it is recommended to upgrade to this version because also a few other related issues are fixed.