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 connect to a remote MySQL DB without webservices... ?

Hi Kumar

I don think google will let people lay any other .jar file , unless you 
rebuild the source code of android.

/////////////////////////////////////////////////////////////////////////////

i will try using sqldroid library to my needs, i will try to connect
to a remote mysql dabatabase, not sqlite and not local

but im having some problems, plz can someone help me?

- how can i add  sqldroid-0.1.jar  to my project (sorry but i am
newbie and i can't find nothing about adding this to a project)

- where i have to put these two lines?
Class.forName("SQLite.JDBCDriver");
DriverManager.getConnection("jdbc:sqlite:/data/data/your-package/
db.sqlite");

- in the connection code, wich lines i have to change to connect to my
remote database? my database is on 81.111.190.170:3306

thanks











> > > > 

2. Very Slow SDcard IO on Froyo emulator on a 64 bit Ubuntu machine

Hi,

I am running some tests on a Froyo emulator on a Ubuntu 64 bit
machine.
The adb push on to sd card on emulator is very slow when compared to a
32bit machine.

I tried running some file write tests and observed the following:
-In comparison to 32 bit machines the file writes in 64 bit machine
are very slow when the target file is on sdcard.
-On 64 bit Machine when the target file is in Internal memory the file
write is much faster when compared to a scenario where target file is
on sdcard (about 40% faster)
 - Repeated writes on sdcard degrade the performance even further (eg
For same file write first time the time taken is 42secs the next time
its 48secs )

Please share If anyone has found any similar issue or if there is any
known patch for it .

Regards,
Harsha

-- 

3. android emulator proxy - not all internet-sites available

4. Amazon Web Services (AWS) from Android - AGAIN

5. Android OS on Toshiba G900

6. Mobile development survey - free gift

7. Nested layout problem