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. How to broadcast an intent?

Hi,all

Anybody can tell me how to broadcast an intent?

Thanks in advance!

Pierre
--~--~---------~--~----~------------~-------~--~----~

2. porting Android on iPhone/creating iPhone emulator on Android

Hi Guys,

What do you think about subject? I guess both options are quite
possible with certain of invested money and efforts. I think that this
type of work can really shake the market and put competition to the
next step. Anyway, Android is just a software, while iPhone is just a
hardware... Apple won't be really happy with that, of course, however,
taking into consideration the amount of "hacked" unofficial iPhones it
might be not their call at all ;)

What do you think?

Regards,
Alex


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

3. Text to speech library on Android...

4. Input textbox with canvas view... how???

5. Contents a web site and like the picture partially in the screen real-time display.

6. Your killer application ideas for Android?

7. multi-user sms on adroid