PRoblem :)

I have function in my class:


void CShader::sendToShader(char *varname,GLint v0)

    int loc = glGetUniformLocationARB(my_program, varname);
    glUniform1iARB(loc, v0);


And i have fragment program:


uniform sampler2D basetex;
uniform sampler2D bumptex;
varying vec3 eyeVec;

void main()
    vec2 texUV, srcUV = gl_TexCoord[0].xy;
    float height = texture2D(bumptex, srcUV).r;
    float v = height * 0.04 - 0.02;
    vec3 eye = normalize(eyeVec);
    texUV = srcUV + (eye.xy * v);     
    vec3 rgb = texture2D(basetex, texUV).rgb;
     gl_FragColor = vec4(vec3(rgb), 1.0);
   // gl_FragColor = vec4(vec3(rgb)*height, 1.0);


in my engin code:

And when i run this i have error “memory can’t be read”

What is wrong?

Sounds like a pointer problem to me. You’re probably trying to read a pointer that has already been freed or something like that.

ok i know what is wrong. I Was forget about define this extanasion(glUniform1iARB)

Sorry and thanks!

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.