I am trying to get our plugin to accomodate changes in viewport resolution, but am having no luck so far. When our renderer is originally started up, we receive a RenderWindow, but in the resolution change call OnRenderSizeChanged we get only width and height, which I use to resize our buffer and restart our renderer.
Our logic for restarting the renderer currently relies on the RenderWindow to tell us the resolution, but this is apparently not updated, so on the next StartRender call we inadvertently resize to the old size.
How is this meant to be handled? The plugin sample we got from Andy does not handle this, and the code I have for the Cycles renderer is incomplete, so I cannot see how it is handled there either.
I can see how that could give us the new resolution, but if the RenderWindow still has the old resolution, then when I get the RenderWindow.Channel from it, to copy our buffer to, then there would still be a problem. Is there some other way for us to do things?
At the moment I am doing things very similarly to the MyRealtimeRenderer sample we got from Andy, i.e. looping in a render thread, copying the buffer to the Channel and calling SignalRedraw.
If I override RealtimeDisplayMode::OnRenderSizeChange, I do get size updates. Is this less reliable than ApplyViewChange? The Cycles sample makes it look like you recreate the renderer each time there is a resolution (or any other viewport) update, which isn’t so great for us.
You’re welcome. I’ll still finish writing about my implementation of a realtime render integration, though. We’re still in flux here, but I’ll try keeping it up-to-date.