My goal is to insert a native plugin, which does image processing on Unity created render texture, into a custom pipeline. The code is like this:
m_CommandBuffer.GetTemporaryRT(GSRenderBase.Props.GaussianSplatRT, -1, -1, 0, FilterMode.Point, GraphicsFormat.R16G16B16A16_SFloat);
m_CommandBuffer.GetTemporaryRT(GSRenderBase.Props.GaussianSplatRT2, -1, -1, 0, FilterMode.Point, GraphicsFormat.R16G16B16A16_SFloat);
m_CommandBuffer.GetTemporaryRT(GSRenderBase.Props.GaussianSplatRT3, -1, -1, 0, FilterMode.Point, GraphicsFormat.R16G16B16A16_SFloat);
renderTargetBuffer = new RenderTargetIdentifier[] { GSRenderBase.Props.GaussianSplatRT, GSRenderBase.Props.GaussianSplatRT2, GSRenderBase.Props.GaussianSplatRT3 };
m_CommandBuffer.SetRenderTarget(renderTargetBuffer, BuiltinRenderTextureType.CurrentActive);
m_CommandBuffer.ClearRenderTarget(RTClearFlags.Color, new Color(0, 0, 0, 0), 0, 0);
Material matComposite = SortAndRenderSplats(cam, m_CommandBuffer);
my_inserted_native_plugin_code(render_texture_to_pass);
RenderGSToScreen(matComposite);
In the code above, my_inserted_native_plugin_code takes a RenderTexture object as input. Here I want it to be the one created by m_CommandBuffer.GetTemporaryRT(nameID …) (first line). Problem is, I don’t know how to get the RenderTexture object from nameID.
Any advice is appreciated. Thank you.