0

I'm pretty new to OpenGL:

In our (iOS) project we are rendering Textures with the following Methods:

    self.effect.texture2d0.name = self.textureInfo.name;
    self.effect.texture2d0.enabled = YES;

    self.effect.transform.modelviewMatrix = self.modelMatrix;


    self.effect.useConstantColor = YES;
    self.effect.constantColor = GLKVector4Make(1, 1, 1, self.alphaValue);

    [self.effect prepareToDraw];

    glEnableVertexAttribArray(GLKVertexAttribPosition);
    glEnableVertexAttribArray(GLKVertexAttribTexCoord0);

    long offset = (long)&_quad;
    glVertexAttribPointer(GLKVertexAttribPosition, 2, GL_FLOAT, GL_FALSE, sizeof(TexturedVertex), (void *) (offset + offsetof(TexturedVertex, geometryVertex)));
    glVertexAttribPointer(GLKVertexAttribTexCoord0, 2, GL_FLOAT, GL_FALSE, sizeof(TexturedVertex), (void *) (offset + offsetof(TexturedVertex, textureVertex)));

    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

I'm now trying to change the brightness of the Texture used in the GLKBaseEffect object. Is there an easy way to accomplish this? I have been searching for documentation for a couple of hours, but can't find a solution to that.

Thanks for your help.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
dominik
  • 1,319
  • 13
  • 23
  • 1
    I'm not as familiar with GLKit, but couldn't you just use a constant color with intensity less than (1,1,1)? I think the texture color should be modulated by the vertex color, but I'm not sure how glkit does things internally. – Tim Sep 28 '12 at 22:48
  • Well I'm already using that to set the transparency (alpha Value) but what if I want to use a brightness greater than 1? This will not work.. – dominik Oct 01 '12 at 07:09

0 Answers0