How to run code each time a frame is rendered on the Render Thead ?

I am working on a plugin (I cannot edit the engine sources) where I need to update a view-dependant texture each frame (from a dll, done in CUDA), and use it in a material.

I use a UPrimitiveComponent to render a mesh, shaded with the view-dependant texture material on one particular camera, and shaded with a black material on other views. My idea was to store the Camera’s FSceneView I get from my proxy’s GetDynamicMeshElements() and use it later to update the texture, when the frame is actually rendered.

However I cannot find a way to sneak in the render thread to launch the update each time a frame is rendered.

ENQUEUE_UNIQUE_RENDER_COMMAND does not fit my needs because the commands are executed the sooner the thread can.

Can anyone give me a lead, or maybe another approach to reach my goal ? Thanks

I ran into a feature called Scene View Extensions, that allows users to hook into multiple stages of the render pipeline.

Here is a great article to present it.

GEngine->GetPreRenderDelegateEx()
GEngine->GetPostRenderDelegateEx()
?

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.