Forum Discussion
ckoeber
11 years agoHonored Guest
Materials with OpenGL and Oculus Rift SDK with F.Buffers .
Hello, So I have this weird issue with rendering to OpenGL and the Oculus Rift's SDK. I can render fine without the Rift but with the Rift I get a blank black screen. Now before, without mate...
vrdaveb
11 years agoOculus Staff
Have you checked the GL error state? It's possible the new material code is causing an error that doesn't break anything but the Rift distortion code. I would recommend running your app with gDEBugger or apitrace and telling them to break/report on any error. You can also call glGetError() after each GL call.
One thing that jumps out is the internal format of your texture. Should glTexImage2D(..) be referencing iInternalFormat instead of GL_RGB in the following code?
One thing that jumps out is the internal format of your texture. Should glTexImage2D(..) be referencing iInternalFormat instead of GL_RGB in the following code?
"ckoeber" wrote:
glGenTextures(1, &TextureObject_ID); // section being edited by CKoeber to pull in material files
glBindTexture(GL_TEXTURE_2D, TextureObject_ID);
setFiltering(TEXTURE_FILTER_MAG_BILINEAR, TEXTURE_FILTER_MIN_BILINEAR_MIPMAP);
GLsizei iFormat = BytesPerPixel == 24 ? GL_BGR : BytesPerPixel == 8 ? GL_LUMINANCE : 0;
GLsizei iInternalFormat = BytesPerPixel == 24 ? GL_RGB : GL_DEPTH_COMPONENT;
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
WidthOfTexture, HeightOfTexture, 0, iFormat,
GL_UNSIGNED_BYTE, bytesDataPointer);
glGenerateMipmap(GL_TEXTURE_2D);
FreeImage_Unload(loadedImage);
glGenSamplers(1, &TextureSamplerObject_ID);
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device