Search Unity

Question NativeRenderingPlugin GLES How to get GLuint from UnityRenderBuffer?

Discussion in 'General Graphics' started by yemi_unity, Jun 1, 2021.

  1. yemi_unity

    yemi_unity

    Joined:
    Jan 21, 2021
    Posts:
    1
    I'm working on implementing `CommandBuffer.IssuePluginCustomBlit` on Android GLES platform. On D3D11 everything works well, unity offer the helper function for fetching native resources ptr from UnityRenderBuffer. But for GLES API, no helper function providede.

    So how to get GLESObject id of RenderBuffer/FrameBuffer/Texture from UnityRenderBuffer

    Code (C++):
    1. void RenderAPI_GLES::CustomBlit(void* data) {
    2.  
    3.     UnityRenderingExtCustomBlitParams* blitParam = (UnityRenderingExtCustomBlitParams*)data;
    4.     UnityRenderBuffer renderbuffer = blitParam->destination;
    5.  
    6.     GLuint fbID; //????
    7.     glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbID);
    8.  
    9. }