External trigger for rendering
By default, UE is rendering frames at fixed interval. I want to disable this and programatically decide when the rendering will occur. Ideally, I would like to make a Component that would listen to an external signal and render only upon receiving the signal?
How would I go about doing this?
asked Jul 18 '18 at 05:16 PM in C++ Programming
The short answer is "You don't."
You would probably want to reconsider your desire to render on demand. Just pause your gameplay and let the GPU render as it would normally do. Make sure your scene and camera are not moving and it should look like a static render. You can even draw a black rectangle on the screen to cover the view and simulate the illusion that the image is not yet rendered.
I'll try to explain why you wouldn't want to do that:
UE is rendering frames at VARIABLE intervals. Unless you have capped the frame rate which is not the default on Windows. That is the reason you FPS counter it is likely to fluctuate. The rendering itself handled by OpenGL/DirectX/Vulcan and done on the GPU.
Although it is theoretically possible to stall the GPU and issue a render on demand it will require a tremendous amount of effort, coding and expertise (which I don't have). The GPU is not intended to work this way, neither is UE4. There are various synchronization steps that are taken by the hardware, drivers and applications and enormous amount of optimization put in there.
If you give more specific context maybe it will turn out that you don't actually need to render this way.
answered Jul 19 '18 at 03:03 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here