1
私はLWJGLといくつかのグラフィックカード(AMD Radeonシリーズ)でアプリケーションを作成しています。何か問題が起き、大きな三角形しか画面に表示されないため、頂点シェーダでノーマルの名前を変更できません。LWJGLシェーダノーマルのエイリアス
#version 150
//our attributes
in vec3 a_position;
in vec2 a_textureCoords;
in vec3 normal;
//send the color out to the fragment shader
out vec2 vTextureCoords;
void main(void)
{
normal;
gl_Position = vec4(a_position, 1.0);
vTextureCoords = a_textureCoords;
}
すべてが正常に動作し、それがあるべきようメッシュが表示されます。私はこれにシェーダを変更した場合
#version 150
//our attributes
in vec3 a_position;
in vec2 a_textureCoords;
in vec3 a_normal; //Here is an error
//send the color out to the fragment shader
out vec2 vTextureCoords;
void main(void)
{
a_normal;
gl_Position = vec4(a_position, 1.0);
vTextureCoords = a_textureCoords;
}
:ここに私のコードです。それは普通ですか? そして、私のbind属性機能:
//Before
GL20.glBindAttribLocation(s_programID, 2, "a_normal");
//After
GL20.glBindAttribLocation(s_programID, 2, "normal");
編集
は、シェーダ内の場所を属性:
//Before
a_normal 0
a_position 1
a_textureCoords 2
//After
a_position 0
a_textureCoords 1
normal 2
which opengl vあなたは少なくとも目標を設定していますか? – elect
私の最小はOpenGL 3.2です – Dragomirus2