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

  • SEARCH
  • Home
  • 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 775475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:17:44+00:00 2026-05-14T19:17:44+00:00

It appears that glColorMaterial() is absent from OpenGL ES . According to this post

  • 0

It appears that glColorMaterial() is absent from OpenGL ES. According to this post (for iPhone), you may still enable GL_COLOR_MATERIAL in OpenGL ES 1.x, but you’re stuck with the default settings of GL_FRONT_AND_BACK and GL_AMBIENT_AND_DIFFUSE that you would otherwise set with glColorMaterial(). I would be OK with this, but the diffuse lighting is not working correctly.

I set up my scene and tested it with one light, setting glMaterialfv() for GL_AMBIENT and GL_DIFFUSE once in the initialization. The normals have been set correctly, and lighting works the way it’s supposed to. I see the Gouraud shading.

With GL_LIGHTING disabled, the flat colors I have set with glColor4f() appear on the various objects in the scene. This also functions as expected. However, when glEnable(GL_COLOR_MATERIAL) is called, the flat colors remain. I would expect to see the lighting effects.

glColorMaterial() is also mentioned on anddev.org, but I’m not sure if the information there is accurate.

I’m testing this on an Android 2.1 handset (Motorola Droid).

Edit: It works properly on my 1.6 handset (ADP1). I’ve filed Issue 8015.
It does not work with the emulator for Android 1.6 or 2.1.

Here is a minimal testcase to reproduce the problem.

Screenshot on Android 1.6 (ADP1):

alt text

Screenshot of same code running on Android 2.1 (Motorola Droid):

alt text

Screenshot on Android 1.6 (Emulator):

alt text

  • 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-14T19:17:44+00:00Added an answer on May 14, 2026 at 7:17 pm

    This was a silly mistake on my part. Given a 32-bit integer Android color, I had forgotten to scale the color components to floats in the range [0, 1]:

        gl.glColor4f(Color.red(color), Color.green(color), Color.blue(color), Color.alpha(color));
    

    It should have bee like this:

        gl.glColor4f(Color.red(color)/(float) 0xFF, Color.green(color)/(float) 0xFF, Color.blue(color)/(float) 0xFF, Color.alpha(color)/(float) 0xFF);
    

    I’m not sure why the first way still worked on my G1.

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

Sidebar

Related Questions

it appears that $(html).find('*').index('#theID'); yields -1 whereas $(html).find('*').each(function(ind){if(this.id=='theID') alert('found! @'+ind) } ); does work
It appears that that you can generate a standard documentation website (like this one
It appears that the php command line is using a different php.ini from the
It appears that the Blur event stops the click event handler from working? I
It appears that my song file that I am trying to grab from the
It appears that according to ISO 14882 2003 (aka the Holy Standard of C++)
It appears that my script does not want to wait for the $.post call
It appears that not all Xml-Commenting shows up in Intellisense, but perhaps I am
It appears that I can no longer step into run time library calls. This
It appears that post-update hooks apply to the entire SVN setup on a machine,

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.