how to update a part of scene without recreating the whole scene again and again?

I am using OptiX to accomplish a realtime electromagnetic field prediction.But since the scene is so huge that every time I update a part of the scene,it takes so much time to initialize the scene.HOW should I do?could someone help me?

Welcome @zengp,

Can you tell us more about what your problem is, and what you hope and expect to happen? It will also help to know which version of OptiX you’re using, and what your system profile looks like (GPU, driver, OS, etc.)


David.

I want to use OptiX5.1 to accelerate SBR.And my OS is windows 10,my GPU is GTX 1080Ti.Now one problem occurs.Scene in my project is huge,and it takes about 5 seconds when I run the initScene().My original purpose is to make it in realtime once the whole scene has been built,but a small part of scene may change in realtime,now I have tried my best to reduce the time to about 2.2 senconds each time when I change the small part of the whole scene .I think the point is the acceleration setting in geometry group and root group,but I don’t know how to do.
thank you!

Sorry,1277471029 is still me.

So what exactly are you updating every frame? By “the point is the acceleration setting” do you mean you are adding objects to the scene and building new acceleration structures? Are you updating variables or transforms? Which API calls are you using, and how many of them are you using, when you make an update to the scene for 1 frame?

Older versions of OptiX aren’t well set up for dynamic environments, in the past it was engineered more for high quality rendering of static scenes. OptiX 6 has a few improvements over OptiX 5, and OptiX 7 removes all barriers and fully allows fast dynamic updates.

The most likely cause of your long update times in OptiX 5.1 are due to copying memory from your host to your GPU. Some update operations will trigger full copies of your scene hierarchy data. There are some older threads here about this problem. I recommend reading this thread: https://devtalk.nvidia.com/default/topic/1055077/optix/optix-bad-performance-with-dynamic-objects/

If this is an ongoing project, you may want to consider moving to OptiX 7. That will give you explicit control over your GPU memory management and host-to-GPU copies so that if you only have a small amount of memory on the GPU that needs to be updated every frame, you will be able to completely control it.


David.

Hi David,
To update a dynamic geometry group every frame is what I want to do now.By setting the root group(the top hierarchy ) with no accelerating,result shows that the update scene time is reduced from 4.5s to 2.2s.And with your valuable information,I kind of know the reason.
And I also want to know how much time will it take to grasp the OptiX 7,because my project almost the deadline.THANK YOU SO MUCH!

If you are close to a deadline, less than 1 or 2 months away, then I recommend NOT switching to OptiX 7. Switching to OptiX 7 could mean a large refactor and a complete re-write of the host side OptiX part of your application code. You’ll have to design your own way to manage GPU memory and dynamic updates. It’s not a small task, it will take more than a few days.

If you have more than 2 or 3 months, then switching might be worth the extra effort. You will be able to overcome this problem with dynamic updates.

You might be able to upgrade to OptiX 6.5 with small or no changes to your code. OptiX 6.5 has some fixes that you read about in the thread I linked to, it allows a small number of dynamic updates to happen each frame without triggering a large buffer copy.

OptiX 6.5 removed selector nodes, so if you are using selector nodes, upgrading to OptiX 6.5 would mean using visibility masks or some other mechanism to achieve the same functionality as selector nodes. If you aren’t using selector nodes, I guess the upgrade should be pretty easy.


David.