Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 418167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:39:08+00:00 2026-05-12T18:39:08+00:00

I’m developing a simple 2D-game in OpenGL ES for the iPhone. My problem is

  • 0

I’m developing a simple 2D-game in OpenGL ES for the iPhone. My problem is that I want to render a texture using different hues. Basically I want to change the hue of the colors in the texture that i render. Simply changing the glColor will not do since it also affects the parts of the image without color. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T18:39:08+00:00Added an answer on May 12, 2026 at 6:39 pm

    Thanks for the clarification, it was far from my initial understanding. Note that the texture you supply to OpenGL ES already has a hue, so what you’re asking for is changing the existing hue.

    First, let me answer the question as stated:

    Let’s start with what needs to happen to the texels. Since OpenGL textures are stored as RGB, to transform the hue of a texel, you need to go RGB->HSL->apply new hue->RGB.
    You can find the actual math to do the RGB->HSL and back conversion here. How you want to select the new hue, I suppose you’ll have to fill that out.

    The biggest question is when should the transformation happen. Well, the OpenGL pipeline won’t let you do that complex a transformation on reading a texture (not in ES 1.1 anyways -ES 2.0 fragment shaders would help, but at a high cost). So you’ll have to do all the transformations outside of the GL ES texturing pipeline. Depending on how often you need to change the hues, my advice is to either do it offline (and store various themed textures), or compute new textures for the new hues on demand just before loading them to OpenGL ES.

    As far as I know, GL ES 1.1 does not have any in-built facility to help do this directly.

    Now, taking a step back, I’m not sure what’s prevent you from separating out in 2 textures, if you can live with the 2 textures to apply at runtime. The math I pointed to does separate saturation from lightness no matter how the texture was generated (and in theory, hue should be constant, if I understand your case correctly). Doing the computation offline should be fairly easy on any input texture ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.