June 2013
Intermediate to advanced
346 pages
8h 42m
English
We’ll also need to update our color shader. We defined our puck and mallet with a per-vertex position but not with a per-vertex color. Instead we’ll have to pass in the color as a uniform. The first thing we’ll do to make these changes is add a new constant to ShaderProgram:
| AirHockeyWithImprovedMallets/src/com/airhockey/android/programs/ShaderProgram.java | |
| | protected static final String U_COLOR = "u_Color"; |
The next step is to update ColorShaderProgram. Go ahead and remove all references to aColorLocation, including getColorAttributeLocation, and then add the following uniform location definition:
| AirHockeyWithImprovedMallets/src/com/airhockey/android/programs/ColorShaderProgram.java | |
| | private final int uColorLocation; ... |
Read now
Unlock full access