English 中文(简体)
开放式GL Vertex Shader Runtime Issues(不使用VBO或文本)
原标题:OpenGL Vertex Shader Runtime Issues (not using VBOs or textures)

我有以下阴道:

uniform mat4 uMVP;
attribute vec4 aPosition;
attribute vec4 aNormal;
attribute vec2 aTexCoord;
varying vec2 vTexCoord;
varying vec4 vPrimaryColor;
void main() {
  gl_Position = uMVP * aPosition;
  vPrimaryColor = vec4(1.0, 1.0, 1.0, 1.0);
  vTexCoord = aTexCoord;
}

并且:

uniform sampler2D sTex;
varying vec2 vTexCoord;
varying vec4 vPrimaryColor;
void main() {
  gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
}

请注意,虽然我有 v和 v,但两者都没有用于碎块。 (他们之所以如此是因为最终会这样做。)

现在,我还把“uMVP”确定为目前的身份矩阵,并利用以下代码:

// Load the matrix
glUniformMatrix4fv(gvMVPHandle, 1, false, &mvPMatrix.matrix[0][0]);

// Draw the square to be textured
glVertexAttribPointer(gvPositionHandle, 2, GL_FLOAT, GL_FALSE, 0, gFullScreenQuad);
glEnableVertexAttribArray(gvPositionHandle);
glVertexAttribPointer(gvTexCoordHandle, 2, GL_FLOAT, GL_FALSE, 0, gFullScreenQuad);
glDrawArrays(GL_QUADS, 0, 4);

面积为:

const GLfloat PlotWidget::gFullScreenQuad[] = { -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f};

因此,当我管理这一方案时,我会受到黑色检查。 似乎与你一样。 然而,当我改变方向时:

vTexCoord = aTexCoord;

To

vTexCoord = vec2(1.0, 1.0);

它完美运作。 因此,我会认为,该法典的问题符合这一法典,但我想到的是会引发这种情况的任何事情。 另外,利用Qt进行这一项目的Im正在使用QGLWidget。 我从未有过公开的GES2.0。

Any suggestions?

I m sorry for the vague title, but I don t even know what class of problem this would be.

最佳回答

Are you checking glGetShaderInfoLog and glGetProgramInfoLog during your shader compilation? If not then I would recommend that as the first port of call.

接下来要检查的是你对文本坐标具有约束力。 是否正确地确立属性? 数据是否有效?

最后,从您的法典开始,自由喷洒。 这几乎肯定会失败了赢得大 t帮助的冰川,但通常在为我开脱par的时候。

<>>>>

http://www.gremedy.com/“rel=“nofollow”>gDEBugger/a。 我主要利用它来寻找瓶颈,确保我能够适当释放开放的利比里亚资源,这样就能够为gger人vo,但值得一枪。

问题回答

很明显,您需要实际使用整个使用<条码>。 如果它被冲入碎块。 但我对此没有想法。 但将绘画法改为:

glVertexAttribPointer(gvPositionHandle, 2, GL_FLOAT, GL_FALSE, 0, gFullScreenQuad);
glEnableVertexAttribArray(gvPositionHandle);
glVertexAttribPointer(gvTexCoordHandle, 2, GL_FLOAT, GL_FALSE, 0, gFullScreenQuad);
glEnableVertexAttribArray(gvTexCoordHandle);
glDrawArrays(GL_QUADS, 0, 4);

使之发挥作用。

萨米问题,原因不同。

对一些装置而言,光线Program的自动互换互联并不如具体。

确保按以下顺序做事:

  1. 冰川融化方案

  2. 2. 冰川融化 两部沙德尔

  3. all all

  4. glLinkProgram

第3步可以在任何时间重复,将变数重新归为不同的缓冲位置,不过,只有在再一次呼吁冰川链路后,变化才会生效。

简而言之,每当你打电话一线Bi光灯,就可以确保发出一只冰川链路。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签