OpenGL Ambient Lighting

by Patrick » Sat, 07 Feb 2009 02:17:25 GMT


Sponsored Links
 I'm getting some strange results when enabling ambient lights in
openGL. After some experiments, I determined that for some reason, the
ambient light color is multiplied by 0.2f. That is, setting an ambient
light of color ( 5.0f, 0.0f, 0.0f, 1.0f ) is needed to get a pure red
ambient, not the expected ( 1.0f, 0.0f, 0.0f, 1.0f ), which yields a
dark red ambient.

I even tried setting the ambient light model :

        float full[] = { 1.0f, 1.0f, 1.0f, 1.0f };
        gl.glLightModelfv(GL10.GL_LIGHT_MODEL_AMBIENT, full, 0);

But that makes no difference.

Note that the diffuse component does not suffer from this 0.2f factor,
only the ambient.

Notice that all the default values in openGL for ambient-related stuff
is 0.2f, so I don't think this is a coincidence. Is there another
openGL function I should be calling to set a global factor ?

Thanks,

Patrick.

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. MMS receiving/sending

Is there an API to send and receive MMS from an application?

Similar to that of SMS? In SMS one can send SMSs by using
SMSManager.sendTextMessage() and receive them by registering for the
broadcast message.

-- 

2. Join Thailand Forums Thailand Message Boards Living, Work and Play in Thailand ...X.

Join Thailand Forums
Thailand Message Boards Living, Work and Play in Thailand 
http://www.poetak.blogspot.com


-- 

3. Join Thailand Forums Thailand Message Boards Living, Work and Play in Thailand ...W.

4. AutoText di Android (bahasa Indonesia)

5. Dev Phone 1 suddenly died -- will not charge, completely dark

6. TEST from my 1st N1

7. OOT Nx1 2nd