O'Reilly logo

OpenGL ES 2 for Android by Kevin Brothaler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding Point Lights

We’re now ready to add some point lights to our scene so we can make our particle fountains glow. We won’t be able to see this too well with a bright backdrop, so the first thing we’ll do is switch over to a night skybox. You can download the night skybox from the website and place it in your project’s /res/drawable-nodpi folder.[63]

To switch to the night skybox, let’s return to ParticlesRenderer and update the assignment to skyboxTexture as follows:

Lighting/src/com/particles/android/ParticlesRenderer.java
 
skyboxTexture = TextureHelper.loadCubeMap(context,
 
new​ ​int​​[]​ { R.drawable.night_left, R.drawable.night_right,
 
R.drawable.night_bottom, R.drawable.night_top,
 
R.drawable.night_front, R.drawable.night_back}); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required