1

I can't figure out what's wrong with this shader. It's correct, compiles, and links, but simply won't run on my hardware (MacBook pro w/NVidia GeForce 9400, nothing special). It seems totally GLSL 1.2 compliant

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();

}

Does anything in here seem amiss to anyone? Thanks for any suggestions/advice.

Joshua Noble
  • 830
  • 2
  • 12
  • 26
  • 1
    What means won't run? Nothing drawn or what? – Christian Rau Jun 11 '11 at 15:56
  • Sorry, it's just nothing drawn and no error returned from the hardware either. However, running it in ShaderBuilder (sucky, I know), it wont' render it with the hardware and reverts to the Software renderer. I suspect it's something incompatible w/the Nvidia 9400m, but I'd like to know what if possible. – Joshua Noble Jun 12 '11 at 22:05
  • 1
    I've noticed automatic switching to software renderer when some GLSL functions aren't implemented correctly in hardware/drivers (for example noise() functions does that trick). So, just my guess - try to remove ftransform() from shader and see if it switches back to hardware renderer. – Agnius Vasiliauskas Jun 16 '11 at 18:48
  • What OS version? Cursory ShaderBuilder test works for me on 10.6.7, 9600. Have you tried it with the 'high performance'/9600 graphics enabled? – bosmacs Jun 21 '11 at 19:01
  • Actually, this is a fragment shader – Nektarios Aug 08 '11 at 18:40
  • pretty sure that this is not a fragment shader. switched to the 9600 and this worked fine – Joshua Noble Dec 16 '11 at 22:23

0 Answers0