Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if EGLAutomaticStereoRenderingProperty=true , then glCompileShader failed #121

Open
vd3d opened this issue May 3, 2017 · 4 comments
Open

Comments

@vd3d
Copy link

vd3d commented May 3, 2017

Hi,

I have an existing application and a shader, everything works fine until I set : EGLAutomaticStereoRenderingProperty = true

I got the following error message (looks like an unexpectederror):

Info log:
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍýýýýÝ�

Here is my shader code:

`
#version 100

// We use highp to avoid problems with mobile devices

// highp is always available in vertex shaders
precision highp float;
precision highp int;

// automatic uniforms
uniform vec3 render_camera_pos_low;
uniform vec3 render_camera_pos_high;
uniform mat4 render_mvp_rel_camera;
uniform mat4 render_mv_rel_camera;
uniform mat4 render_mvp;
uniform mat4 render_mv;
uniform mat4 render_projection;
uniform vec3 render_forward;
uniform vec4 render_viewport;
uniform vec2 render_pixelscale;

// Returns the position, relative to the camera (e.g. world space, but relative to the camera)
vec3 getRelativePosition(vec3 posLow, vec3 posHigh) {
vec3 lowDifference = posLow - render_camera_pos_low;
vec3 highDifference = posHigh - render_camera_pos_high;
return lowDifference + highDifference;
}

// Returns the position, relative to the camera (e.g. world space, but relative to the camera)
vec3 getRelativePosition(vec3 posLow, vec3 posHigh, vec3 cameraPosLow, vec3 cameraPosHigh) {
vec3 lowDifference = posLow - cameraPosLow;
vec3 highDifference = posHigh - cameraPosHigh;
return lowDifference + highDifference;
}

// Transforms from world to camera coordinates
vec3 relPositionToCamera(vec3 relPos) {
return (render_mv_rel_camera * vec4(relPos, 1.0)).xyz;
}

// Projects a relative position (relative to the camera). The result is a homogenous view position (e.g. in clip space).
vec4 projectRelPosition(vec3 relPos) {
return render_mvp_rel_camera * vec4(relPos, 1.0);
}

// Projects from camera coordinates (e.g. camera space). The result is a homogenous view position (e.g. in clip space).
vec4 projectCameraPosition(vec3 relPos) {
return render_projection * vec4(relPos, 1.0);
}

// Projects a position, encoded as a double-float. The result is a homogenous view position (e.g. in clip space).
vec4 projectPosition(vec3 posLow, vec3 posHigh) {
return render_mvp_rel_camera * vec4(getRelativePosition(posLow, posHigh), 1.0);
}

// Projects a position, with custom parameters. Used mainly for draping.
vec4 projectPosition(vec3 posLow, vec3 posHigh, mat4 transformation, vec3 cameraPosLow, vec3 cameraPosHigh) {
vec3 lowDifference = posLow - cameraPosLow;
vec3 highDifference = posHigh - cameraPosHigh;
return transformation * vec4(lowDifference + highDifference, 1.0);
}

// Projects an absolute position, encoded as a float. The result is a homogenous view position (e.g. in clip space).
vec4 projectPosition(vec3 pos) {
return render_mvp * vec4(pos, 1.0);
}

vec4 projectDirectionVector(vec3 vector) {
return render_mvp * vec4(vector, 0.0);
}

vec2 ndcToPixel(vec2 ndcPt) {
return (ndcPt + 1.0) * render_pixelscale;
}

vec2 pixelToNdc(vec2 pixelPt) {
return pixelPt / render_pixelscale - 1.0;
}

// Indicates if a position is invalid (see GeometryPool invalid vertex)
bool isPositionInvalid(vec3 posLow, vec3 posHigh) {
/**

  • GeometryPool uses FLOAT_MAX. Here we require < 1M km for just the low part. That should safely
  • cover all abnormal values.
    */
    return !(posLow.x < 1e9);
    }

// Position as defined relative to uLocalOrigin
attribute vec3 aPosition;
// Texture uv coordinates
attribute vec2 aUV;
// Geocentric normal
attribute vec3 aGeocentricNormal;
// World normal
attribute vec3 aNormal;
// Elevation above ellipsoid
attribute float aElevation;

// The local origin
uniform vec3 uLocalOrigin;

// Terrain texture coordinates
varying vec2 vTextureUVTerrain;
// The point of the vertex on the ellipsoid, in world reference
varying vec4 vZeroElevationWorldPoint;
// Normal on the terrain in world coordinates
varying vec3 vNormal;
// Normal on the ellipsoid
varying vec3 vGeocentricNormal;

void main() {
vTextureUVTerrain = aUV;
vZeroElevationWorldPoint = vec4(aPosition.xyz - aElevation * aGeocentricNormal, 0.0);
vNormal = aNormal;
vGeocentricNormal = aGeocentricNormal;

gl_Position = projectPosition(aPosition, uLocalOrigin);
}
`

@austinkinross
Copy link
Member

@MikeRiches, do you know what might be causing this?

@MikeRiches
Copy link
Member

Try converting the shader to #version 300.

@MikeRiches
Copy link
Member

You may also need to make sure that your EGL_CONTEXT_CLIENT_VERSION is set to 3.

@vd3d
Copy link
Author

vd3d commented May 4, 2017

Thanks,

EGL_CONTEXT_CLIENT_VERSION is set to 3

The shader version is set to 100, but I have see some code inside ANGLE that "try" convert the shader to version 300. Not sure it really work and it is really related !

I have see some cases that are not well handled, by example:

  • you add "#version 300" but you don't remove the current version command
  • you add "precision" but you don't remove the one in the shader

I have to debug more to see what is missing, can you help please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants