09-09-2019 12:13 AM
[dllImport"mylib"]
static extern void ModifyMyShader(int shaderId)
// get shader id though api in unity
void func(){
uint shaderId = createOverlayProgram(string vertexShader, string fragShader);// not unity shader, we use gles native shade here
// pass it into native libary which share opengl context, so we can modify it
ModifyMyShader(shaderid)
}
// modify shader though shader id in c++
void func_native(int id){
GL_CHECK(glUseProgram(id));
texY = GL_CHECK(glGetUniformLocation(id, "TextureY"));
if (texY != -1)
GL_CHECK(glUniform1i(texY, 0));
}
10-25-2019 02:36 PM
08-29-2020 12:57 AM