use debugview switch to enable depth test shader

This commit is contained in:
Hannes Janetzek 2013-01-12 13:39:14 +01:00
parent 2148e7564c
commit dcb6e11ee8
2 changed files with 8 additions and 7 deletions

View File

@ -609,7 +609,7 @@ public class GLRenderer implements GLSurfaceView.Renderer {
private boolean mNewSurface; private boolean mNewSurface;
private static final boolean debugView = false; public static final boolean debugView = false;
void clearBuffer() { void clearBuffer() {
mNewSurface = true; mNewSurface = true;

View File

@ -69,11 +69,13 @@ public final class PolygonRenderer {
static boolean init() { static boolean init() {
// Set up the program for rendering polygons // Set up the program for rendering polygons
// polygonProgram = GlUtils.createProgram(polygonVertexShaderZ, if (GLRenderer.debugView) {
// polygonFragmentShaderZ); polygonProgram = GlUtils.createProgram(polygonVertexShaderZ,
polygonProgram = GlUtils.createProgram(polygonVertexShader, polygonFragmentShaderZ);
polygonFragmentShader); } else {
polygonProgram = GlUtils.createProgram(polygonVertexShader,
polygonFragmentShader);
}
if (polygonProgram == 0) { if (polygonProgram == 0) {
// Log.e(TAG, "Could not create polygon program."); // Log.e(TAG, "Could not create polygon program.");
return false; return false;
@ -352,7 +354,6 @@ public final class PolygonRenderer {
+ "void main() {" + "void main() {"
+ " gl_FragColor = u_color;" + " gl_FragColor = u_color;"
+ "}"; + "}";
private final static String polygonVertexShaderZ = "" private final static String polygonVertexShaderZ = ""
+ "precision highp float;" + "precision highp float;"
+ "uniform mat4 u_mvp;" + "uniform mat4 u_mvp;"