02-06-2018, 12:46 AM
Hm, you always mention FrustumCullingSample - does this problem occur only for this sample or also for other samples.
With software rendering, I meant that you only try to reproduce the problem without using the graphics card - do this test only once and see if the problem still occurs.
Because resizing still rendered the image, this means that when the RenderTragets (buffers that store the rendered image) are recreated they are shown, but when they are only updated, the image disappears. Maybe there are some problems with "sending" the DirectX rendering to WPF.
To get more info, I would ask you to test the following:
First, add the following code to FrustumCullingSample.xaml.cs after InitializeComponent:
MainDXViewportView.DXSceneDeviceCreated += delegate(object sender, EventArgs args)
{
if (MainDXViewportView.DXScene != null)
MainDXViewportView.DXScene.UseSharedWpfTexture = true;
};
This will use a different method (slower) to "send" DirectX 11 rendering to WPF - it will copy the rendered image to main CPU memory and there update a standard WPF bitmap that will be then shown by WPF (instead of using D3DImage that reuses the rendered image by WPF so that the rendered image can stay in the GPU memory).
Start the samples and check if the problem still exists.
The other test is to to open FrustumCullingSample.xaml and change line 23 from
PresentationType="DirectXImage"
to
PresentationType="DirectXOverlay"
This use completely different method of showing the 3D scene - it has a better performance but prevents adding WPF 3D objects on top of 3D scene (or behind the scene).
I would like to know if any of those two methods solve the problem.
With software rendering, I meant that you only try to reproduce the problem without using the graphics card - do this test only once and see if the problem still occurs.
Because resizing still rendered the image, this means that when the RenderTragets (buffers that store the rendered image) are recreated they are shown, but when they are only updated, the image disappears. Maybe there are some problems with "sending" the DirectX rendering to WPF.
To get more info, I would ask you to test the following:
First, add the following code to FrustumCullingSample.xaml.cs after InitializeComponent:
MainDXViewportView.DXSceneDeviceCreated += delegate(object sender, EventArgs args)
{
if (MainDXViewportView.DXScene != null)
MainDXViewportView.DXScene.UseSharedWpfTexture = true;
};
This will use a different method (slower) to "send" DirectX 11 rendering to WPF - it will copy the rendered image to main CPU memory and there update a standard WPF bitmap that will be then shown by WPF (instead of using D3DImage that reuses the rendered image by WPF so that the rendered image can stay in the GPU memory).
Start the samples and check if the problem still exists.
The other test is to to open FrustumCullingSample.xaml and change line 23 from
PresentationType="DirectXImage"
to
PresentationType="DirectXOverlay"
This use completely different method of showing the 3D scene - it has a better performance but prevents adding WPF 3D objects on top of 3D scene (or behind the scene).
I would like to know if any of those two methods solve the problem.
Andrej Benedik

