this.program.loadColor(this.color);
@Override public void draw(DrawContext dc) { if (this.program == null || !this.program.useProgram(dc)) { return; // program unspecified or failed to build } // Configure the program to draw the specified color. this.program.enableTexture(false); this.program.loadColor(this.color); for (int idx = 0, len = dc.getDrawableTerrainCount(); idx < len; idx++) { // Get the drawable terrain associated with the draw context. DrawableTerrain terrain = dc.getDrawableTerrain(idx); // Use the terrain's vertex point attribute. if (!terrain.useVertexPointAttrib(dc, 0 /*vertexPoint*/)) { continue; // vertex buffer failed to bind } // Use the draw context's modelview projection matrix, transformed to terrain local coordinates. Vec3 terrainOrigin = terrain.getVertexOrigin(); this.mvpMatrix.set(dc.modelviewProjection); this.mvpMatrix.multiplyByTranslation(terrainOrigin.x, terrainOrigin.y, terrainOrigin.z); this.program.loadModelviewProjection(this.mvpMatrix); // Draw the terrain as triangles. terrain.drawTriangles(dc); } } }
protected void doDraw(DrawContext dc, DrawableScreenTexture drawable) { // Use the drawable's color. drawable.program.loadColor(drawable.color); // Attempt to bind the drawable's texture, configuring the shader program appropriately if there is no texture // or if the texture failed to bind. if (drawable.texture != null && drawable.texture.bindTexture(dc)) { drawable.program.enableTexture(true); drawable.program.loadTexCoordMatrix(drawable.texture.getTexCoordTransform()); } else { drawable.program.enableTexture(false); } // Use a modelview-projection matrix that transforms the unit square to screen coordinates. drawable.mvpMatrix.setToMultiply(dc.screenProjection, drawable.unitSquareTransform); drawable.program.loadModelviewProjection(drawable.mvpMatrix); // Disable depth testing if requested. if (!drawable.enableDepthTest) { GLES20.glDisable(GLES20.GL_DEPTH_TEST); } // Draw the unit square as triangles. GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4); // Restore the default WorldWind OpenGL state. if (!drawable.enableDepthTest) { GLES20.glEnable(GLES20.GL_DEPTH_TEST); } }
this.drawState.program.enableTexture(true); this.drawState.program.loadTexCoordMatrix(this.identityMatrix3); this.drawState.program.loadColor(this.color);
this.program.loadColor(this.color);
this.drawState.program.loadColor(prim.color);
this.drawState.program.loadColor(prim.color);