OGLESShaderRenderer now only force mediump precision for float in the fragment shader.

Default precision for the vertex shader for float is highp.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10422 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 12 years ago
parent c8446baa77
commit bc62609746
  1. 16
      engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java

@ -783,12 +783,22 @@ public class OGLESShaderRenderer implements Renderer {
id, source.getDefines()
+ source.getSource());
} else {
String precision ="";
if (source.getType() == ShaderType.Fragment) {
precision = "precision mediump float;\n";
}
GLES20.glShaderSource(
id,
"precision mediump float;\n"
+ source.getDefines()
id,
precision
+source.getDefines()
+ source.getSource());
}
// int range[] = new int[2];
// int precision[] = new int[1];
// GLES20.glGetShaderPrecisionFormat(GLES20.GL_VERTEX_SHADER, GLES20.GL_HIGH_FLOAT, range, 0, precision, 0);
// System.out.println("PRECISION HIGH FLOAT VERTEX");
// System.out.println("range "+range[0]+"," +range[1]);
// System.out.println("precision "+precision[0]);
GLES20.glCompileShader(id);
GLES20.glGetShaderiv(id, GLES20.GL_COMPILE_STATUS, intBuf1);

Loading…
Cancel
Save