Yeah, could already do this:
https://youtu.be/21io4lhxii0?t=9m35sThat's the ending of the game Inside.
I remember this as a really jaw dropping moment - very hard to achieve by a game nowadays.
Maybe the best game of the year.
Julio Jerez wrote:I believe the reason is that, this particular mesh I have to use system memory vertex buffers,
while all other meshes are optimized which put vertex buffers in GPU memory.
that one compelling reason right there to implement the whole thing in GPU.
Keep in mind that what you do may serve only as a template to must of us.
Probably we need to port your work to the API of choice.
Of course we can share our implementations and you can include them as examples.
I see two ways to do it:
Keep sim on CPU, upload only the hull vertices, implement blending / skinning on GPU.
Upload surrounding or all geometry, sim on GPU, download reaction forces to surroundings.
I think the first is better: No two ways communication required, constant transfer workload (surrounding geometry may a single static polygon in one frame, but dozens of bodies in the next).
The second would become attractive only if the simulation itself becomes a performance problem on CPU.
One technical detail:
AMD GPUs have some RAM (i think 256MB) that is both host and client visible (probably no cache on host).
You only need to map, copy your stuff, unmap. No need to upload.
Vulkan exposes things like that. Not sure about OpenGL, but i guess uniform buffers goes there.
I did not use this yet, but it seems very good for this purpose.
Actually i can calculate infinite bounce diffuse GI in 1.1ms, but i need a whole second to upload / download the data
(i don't need transfer when i'm done, so don't try to improve this)
EDIT:
I'm not a experienced graphics engine developer, but there are some on the forum.
Maybe you should start a new threat with a proper topic title to discuss this.