Search Unity

Render to the Editor window camera from native rendering plugin?

Discussion in 'General Graphics' started by techmage, Jan 9, 2022.

  1. techmage

    techmage

    Joined:
    Oct 31, 2009
    Posts:
    2,133
    I am somewhat familiar with the native rendering plugin and using it in runtime builds. But I have a scenario where I need to render something into the editor from a native plugin and I need it to show through the scene view, but I can't get it to work.

    I tried adding a CommandBuffer to the SceneView Camera that calls the RenderFunction with IssuePluginEvent:

    Code (CSharp):
    1.        
    2. m_CB.IssuePluginEvent(GetRenderEventFunc(), 1);
    3. SceneView.lastActiveSceneView.camera.AddCommandBuffer(CameraEvent.AfterEverything, m_CB);
    4.  
    This works for getting the plugin to render through different cameras just fine. But it does not work for the scene view camera.

    Anyone know of anything else I need to do or try?