Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Greyscaling an image in GLES 1.x

  1. #1
    Junior Member Regular Contributor Lucretia's Avatar
    Join Date
    Mar 2000
    Location
    Leeds, West Yorkshire, England
    Posts
    117

    Greyscaling an image in GLES 1.x

    Hi,

    I have a need to make parts of an image dynamically greyscale.

    I was thinking about using a small quad with a grey texture or just grey vertex colours and then blending that with the colour image in some way, but I don't know which blend function to use for this, could someone point me in the right direction?

    Thanks,
    Luke.
    Luke A. Guest

  2. #2
    Intern Contributor uruk's Avatar
    Join Date
    Dec 2004
    Location
    acasa :) sau la munca :(
    Posts
    66

    Re: Greyscaling an image in GLES 1.x

    A simple method is (R,G,B) dot3 (0.3,0.3,0.3).
    Stat rosa pristina nomine, nomina nuda tenemus.

  3. #3
    Junior Member Regular Contributor Lucretia's Avatar
    Join Date
    Mar 2000
    Location
    Leeds, West Yorkshire, England
    Posts
    117

    Re: Greyscaling an image in GLES 1.x

    aparently, that doesn't work under Android...I have had a play and it made no difference.
    Luke A. Guest

  4. #4
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,171

    Re: Greyscaling an image in GLES 1.x

    Can you not modulate the texture with a grey-scale texture?

    Failing that there are options depending what's supported:
    glTexEnv
    You may be able to use DOT3 if you have support for it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •