나는 정점 셰이더 컴파일하려면이OpenGL은 GLSL Shader를 컴파일하지 않습니다. 누락 된 확장 프로그램은 무엇입니까?
pShader.ID = glCreateShader(GL_VERTEX_SHADER);
std::ifstream shaderFile;
shaderFile.open(pShader.path);
if (shaderFile.fail()) {
printf("!!!\nCannot open Shader File %s ! Shader compilation cancelled!", pShader.path.c_str());
}
else {
std::string line;
while (getline(shaderFile, line)) {
pShader.content += line + '\n';
++pShader.lines;
}
const char* shaderContent = pShader.content.c_str();
glShaderSource(pShader.ID, 1, &shaderContent, &pShader.lines);
glCompileShader(pShader.ID);
GLint success = 0;
glGetShaderiv(pShader.ID, GL_COMPILE_STATUS, &success);
if (success == GL_FALSE) {
//errror checking
}
같은
#version 430
layout(location = 0)in vec3 vertexPosition;
layout(location = 1)in vec3 vertexNormal;
layout(location = 2)in vec2 vertexUV;
out Vertex{
vec2 uv;
vec4 normal;
}vertexOut;
void main(){
gl_Position = vec4(
vertexPosition.x,
vertexPosition.y,
vertexPosition.z,
1.0f);
vertexOut.uv = vertexUV;
vertexOut.normal = vec4(vertexNormal, 0.0f);
}
을하지만 난 또한 무엇입니까 내 프래그먼트 쉐이더에서 컴파일 오류
Vertex Shader failed to compile with the following errors:
ERROR: 0:3: error(#132) Syntax error "layou" parse error
ERROR: errror(#273) 1 compilation errors. No code generated
를 받고 오전 "/"구문 분석 오류가 있지만 찾을 수 있습니다.
저는 입력 내용과 문맥에 gllew를 사용하고 있습니다. 내가없는 것으로 표시된 일부 확장이있는 glewinfo.exe을 실행,하지만 내 AMD 라데온 HD 7800 드라이버가 최신 때 에 .. 문제가 무엇이며 어떻게 내가 어떻게해야 하죠? 당신이 glShaderSource
에 잘못된 길이를 전달하는 것으로, http://m.uploadedit.com/ba3s/148318971635.txt
체크 ['glShaderSource'] (http://docs.gl/gl4/glShaderSource)는 특히'length' 매개 변수는 – PeterT