I intend to re-map a optix TextureSampler to another OpenGl texture. but I do not know how to do it. I would like to know how can I do that.
I init a optix TextureSampler with code like this:
rtWorldSpaceTexture = rtContext->createTextureSamplerFromGLImage(currentGbuffer.getTexture(0), RT_TARGET_GL_TEXTURE_2D);
I intend to use another OpenGl texture as the resource of “rtWorldSpaceTexture” but I failed.
I tried the methods like the following:
1.rtWorldSpaceTexture = rtContext->createTextureSamplerFromGLImage(anotherTex, RT_TARGET_GL_TEXTURE_2D);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F_ARB, traceWidth, traceHeight, 0, GL_RGBA, GL_FLOAT, NULL);
But it seems the mapping to a new texture sampler is wrong.
Is there anyone who is familiar with this issue?