Open ResourceHog opened 3 months ago
Right now, the renderer module is macOS-only. There hasn't been anybody on Linux/Windows interested in the project yet. My current suggestion is to export static XYZ files to an alternative renderer, like VMD or SAMSON.
I have a discrete GPU that I just got running under Windows 10. I'm serializing simulation frames and sending them to my Mac for rendering right now. It would be possible to eventually create a native Windows app for rendering.
What's the serialized format?
What do you think it would take to instead use a cross platform hardware acceleration library like Vulkan or OpenGL ?
I suppose there would also be a need for a cross platform alternative to swiftUI.
What's the serialized format?
Uncompressed raw binary data. A 16-byte word containing:
x coordinate (Float32, 4 bytes)
y coordinate (Float32, 4 bytes)
z coordinate (Float32, 4 bytes)
atomic number (UInt8, 1 byte)
3 bytes padding
This is how the HDL stores stuff in memory. Encoding and decoding should be very easy in languages with pointer arithmetic (C, Rust, Swift, etc.). I once used a text format with lossless compression, but learned that's way too much work for the small benefit it provides.
I also have a 128 GB USB stick with ~500 MB/s bandwidth, so large file transfers can happen fast.
I suppose there would also be a need for a cross platform alternative to swiftUI.
We just need a proper effort to use the native Windows APIs for UI/UX. There's a Swift toolchain that can use native Windows APIs, even demoing a DirectX 3D renderer. A challenging task is hacking into the Vsync API, to perfectly synchronize the renderer's frame counter with the screen refresh rate. That necessitates direct usage of the lowest-level native APIs, as opposed to a game engine that abstracts this from the developer.
What do you think it would take to instead use a cross platform hardware acceleration library like Vulcan or OpenGL
Vulkan, but with Microsoft HLSL compiled into SPIR-V. The other shading languages don't have sufficiently advanced syntax. Then, one would need to hook it up to AMD FidelityFX upscaling, enabling high-quality ray tracing.
https://github.com/philipturner/molecular-renderer/tree/main/Sources/MolecularRenderer
A start would be a minimal Windows C++/D3D app that intersects each pixel ray with every sphere in the scene. Figure out how to synchronize with integer multiples of the frame refresh period. Then, create an interface with Swift code and consider high-quality ray tracing effects.
When building on windows I get this error:
Nanosystems\molecular-renderer\Sources\MolecularRenderer\MRAccelBuilder+Build.swift:8:8: error: no such module 'Metal' import Metal
Any idea where I can find this dependency?