顶点着色器是正确的,但不会在我的硬件上运行?

时间:2011-06-09 19:24:37

标签: macos glsl nvidia vertex-shader

我无法弄清楚这个着色器有什么问题。这是正确的,编译和链接,但根本不会在我的硬件上运行(MacBook pro w / NVidia GeForce 9400,没什么特别的)。它似乎完全符合GLSL 1.2

vec4 position;
vec4 new_position;

varying vec3 lightV;
varying vec3 eyeV;
varying vec3 normalV;
varying vec4 ambient;

uniform float angle;
uniform int sens;
uniform vec3 lightSource;

void main(){

    //ambient = gl_FrontMaterial.ambient * gl_LightSource[0].ambient ;
    ambient.x = 1.0;
    ambient.y = 1.0;
    ambient.z = 1.0;
    ambient.w = 1.0;

    //from vertex to light
    //lightV = gl_LightSource[0].position.xyz;
    lightV = lightSource;

    // vertex position in eye space
    vec3 vVertex = vec3(gl_ModelViewMatrix * gl_Vertex);

    //from vertex to eye
    eyeV =  - vVertex;
    //normal
    normalV = gl_NormalMatrix * vec3(0.0,1.0,0.0);

    gl_FrontColor = gl_Color;
    gl_TexCoord[0] = gl_MultiTexCoord0;
    gl_Position = ftransform();

}

这里的任何事都对任何人都不妥吗?感谢您的任何建议/意见。

0 个答案:

没有答案