Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiples SceneView for one node
#1
Hi,

I would like to display 4 views of 1 GroupNode on one window. 
To do so, I would like to create the groupNode in a Scene and after using the Scene for the others views.
I'm working with avalonia and I'm using SharpEngineSceneView to display the node.

I did not achieve to do it, because Scene is a read only property of SharpEngineSceneView.

Could someone help me with this issue ?

Tell me if you need more information.

Thanks in advance
#2
It is currently not possible to share the same Scene object (or GroupNode) with multiple SharpEngineSceneView objects. This is planned for the next version that will be released in Q1 2025.

Currently, it is possible to share textures (GpuImage objects) and meshes (Mesh objects) with multiple SharpEngineSceneView objects. To do that, all SharpEngineSceneView objects need to use the same VulkanDevice.

This can be done by first creating the main SharpEngineSceneView and call the Initialize method. This will create the VulkanDevice. Then create other SharpEngineSceneView objects and call Initialize method and pass the created VulkanDevice, for example:

Code:
var mainSharpEngineSceneView = new SharpEngineSceneView("MainSharpEngineSceneView");

// Create VulkanDevice
mainSharpEngineSceneView.Initialize();

if (mainSharpEngineSceneView.GpuDevice != null)
{
    var childSharpEngineSceneView = new SharpEngineSceneView("ChildSharpEngineSceneView");
    childSharpEngineSceneView.Initialize(mainSharpEngineSceneView.GpuDevice);
}

See also the new "AntiAliasingSample" that was published with v2.1.9118-beta2 - AntiAliasingSample.xaml.cs


After that you can create a texture (GpuImage) with TextureLoader and use that in all SharpEngineSceneView.Scene objects.

With the new SharpEngine v2.1.9118-beta2, it is also possible to create one Mesh object (for example GeometryMesh or StandardMesh), call InitializeSceneResources method and then use the created VertexBuffer and IndexBuffer on another Mesh object that is used on another Scene - to do that call SetCustomVertexBuffer and SetCustomIndexBuffer methods on the other Mesh object.

I know that this is complicated because you need to have multiple Scene objects. If you are not in a hurry, then I would advise you to wait for the next version because then this will be much easier because you will be able to share the same Scene.
Andrej Benedik
#3
I would like to inform you that the new Ab4d.SharpEngine v3.0 RC supports showing one Scene object with multiple SharpEngineSceneView objects. What is more, you can also customize how each SharpEngineSceneView renders the scene - you can render it as a wireframe or render only some of the objects.

See the screenshot from the new sample:
   

The new samples can be downloaded from:
https://github.com/ab4d/Ab4d.SharpEngine...s/releases
Andrej Benedik
  


Forum Jump:


Users browsing this thread:
1 Guest(s)