This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
当我创建 FBO 时、请使用 glBindTexture、使用哪个枚举?GL_Texture_2D 或 GL_纹 理_external_OES?
如果我使用 GL_Texture_2D,则创建 FBO 将成功,但在运行应用程序时,将报告 PVR 错误:(1002) PVR:(Error):IsTextureCon坚持:IMGEGLImage 不一致[:0 ];
如果我使用 GL_纹 理_external_OES,创建 FBO 将失败,glGetError()返回 GL_invalid_enum;
我该怎么做?
------------------------------------------------------
GlGenTextures (1、&_uiColorBuffer1);
glBindTexture (GL_torture_2D、_uiColorBuffer1);
glTextImage2D (GL_Texture_2D、0、GL_RGB、/* SingleViewParamter::_width*/458、SingleViewParamter::_height, 0、GL_RGB、GL_unsigned_byte、NULL);
GlTextParameteri (GL_turete_2D、GL_turete_min_filter、GL_linear);
GlTextParameteri (GL_turete_2D、GL_turete_mag_filter、GL_linear);
glFramebufferTexture2D (GL_framebuffer、GL_Color_ATTACHMENT0、GL_torture_2D、_uiColorBuffer1、0);
if (glCheckFramebufferStatus (GL_framebuffer)!= GL_framebuffer_complete)
{
printf ("[HCL]-- glCheckFramebufferStatus colorbuffer 1 error!\n"\};
}
------------------------------------------------------
GlGenTextures (1、&_uiColorBuffer1);
glBindTexture (GL_torture_external_OES、_uiColorBuffer1);
glTextImage2D (GL_Texture_external_OES、0、GL_RGB、/* SingleViewParamter::_width*/458、SingleViewParamter::_height, 0、GL_RGB、GL_unsigned_byte、NULL);
GlTextParameteri (GL_turete_external_OES、GL_turete_min_filter、GL_linear_linear);
GlTextParameteri (GL_turete_external_OES、GL_turete_mag_filter、GL_linear);
glFramebufferTexture2D (GL_framebuffer、GL_Color_ATTACHMENT0、GL_Texture_external_OES、_uiColorBuffer1、0);
if (glCheckFramebufferStatus (GL_framebuffer)!= GL_framebuffer_complete)
{
printf ("[HCL]-- glCheckFramebufferStatus colorbuffer 1 error!\n"\};
}
您好吗?
是否有任何更新?
大家好、我创建了 FBO 成功。
但如何使用纹理附件?
当我使用 GL_Texture_external_OES 对其进行绑定时、 glDrawElements 失败、glerror 返回1282;
当我使用 GL_Texture_2D 绑定它时、GlDrawElements 成功、但未显示任何内容、也存在 PVR 错误;
如何使用纹理附件?
此致。
您好!
以下两项对我来说是可行的:
glGetIntegerv (gL_framebuffer_binding、&curry_FBO);
glActiveTexture (GL_TEXTURE15);
格栅纹理(1、offscreen_FBO_turTure);
glBindTexture (GL_tuture_2D、offscreen_FBO_tuture);
GlTextParameteri (GL_turete_2D、GL_turete_mag_filter、GL_Nearest);
GlTextParameteri (GL_turete_2D、GL_turete_min_filter、GL_Nearest);
GlTextParameteri (GL_turete_2D、GL_turete_wrap_S、GL_Clamp 到_edge);
GlTextParameteri (GL_turete_2D、GL_turete_wrap_T、GL_Clamp 到_edge);
glTextImage2D (GL_Texture_2D、0、GL_RGBA、宽度、高度、 0、GL_RGBA、GL_unsigned_byte、NULL);
glActiveTexture (GL_TEXTURE0);
glBindTexture (GL_Texture_2D、0);
/*深度缓冲器*/
glGenRenderbuffers (1、Offscreen_FBO_DEPTH);
glBindRenderBuffer (GL_RENDERBUFFER、offscreen_FBO_DEPTH);
glRenderBufferStorage (GL_RENDERBUFFER、GL_DEPTY_COMPONENT16、宽度、高度);
glBindRenderbuffer (GL_RENDERBUFFER、0);
/*帧缓冲区*/
glGenFramebuffers (1、offscreen_FBO);
glBindFramebuffer (gL_framebuffer、offscreen_FBO);
glFramebufferTexture2D (GL_framebuffer、GL_color_ATTACHENT0、GL_tuthere_2D、offscreen_FBO_tuture、0);
glFramebufferRenderbuffer (gL_framebuffer、gL_depte_attachment、gL_RENDERBUFFER、offscreen_FBO_depth);
if (glCheckFramebufferStatus (gL_framebuffer)!= gL_framebuffer_complete){
//错误
}
glBindFrameBuffer (GL_Framebuffer、CURRENT_FBO);
此致
Hemant
Hemant 您好:
感谢您的回复。
我知道这是创建 FBO 的方法、我已经在 Windows 上完成了、它工作正常。
我的问题是如何在 TDA4上使用它。
在 TDA4上:
我创建纹理附件并将其附加到我的 FBO。
并使用 glEGLImageTargetTexture2DOES 而不是 glTextImage2D、
这种方式可以创建 FBO 成功并展示出来。
但是、当我使用纹理附件时、发生了错误。
1.当我使用 GL_Texture_external_OES 来绑定纹理附件时,glBindTexture 错误,glGetError 返回 GL_INVALID_OPERATION;
当我使用 GL_t纹 理_2D 来绑定纹理附件时、glBindTexture 成功、但出现 PVR 错误、未显示任何内容。
如何使用 TDA4上的纹理附件?
此致。
您好!
对延迟答复表示歉意。 您是否仍面临此问题? 如果是、您能否指定您要实现的目标。 对于纹理_external_OES 的使用方式、可能会有一些限制。
此致
Hemant