I want to write some C# code which runs in a server. No UI or web page involved.
public static void ExportScreenshots(string babylonFilePath, string screenshotsOutputFolderPath)
//Load .babylon file.
// render the scene
//take screenshot from each camera and save the image in the output folder.
One thing I could think of is, Implement C# code to:
- Read Vertices, Indices, Normals, UVs etc. from the file.
- Render them using DirectX/SharpDX to a a WARP device.
this.device3d = new SharpDX.Direct3D11.Device(SharpDX.Direct3D.DriverType.Warp,
3. Export images from the underlying 2dTexture of this 3d device.
The problem with this is, I will end up implementing all the logic of babylon.js.
Can you please suggest a better approach?
@Deltakosh, I came across your JsBridge/ChakraBridge. It is a nice implementation.
Can I use this bridge to use babylon.js and other babylon’s .js files to load the scene and take screenshots?
Thanks in advance.