June 2013
Intermediate to advanced
346 pages
8h 42m
English
Now that we have the cube model and shader code written up, let’s add the skybox to our scene. Open up ParticlesRenderer, and add the following members to the top of the class:
| Skybox/src/com/particles/android/ParticlesRenderer.java | |
| | private SkyboxShaderProgram skyboxProgram; |
| | private Skybox skybox; |
| | private int skyboxTexture; |
At the same time, rename the existing texture member variable from the last chapter to particleTexture. Bring in any missing imports, and then we’ll initialize these new variables in onSurfaceCreated with the following code:
| Skybox/src/com/particles/android/ParticlesRenderer.java | |
| | skyboxProgram = new SkyboxShaderProgram(context); |
| | skybox = new Skybox(); |
| | skyboxTexture = TextureHelper.loadCubeMap(context, ... |
Read now
Unlock full access