Skip to content

if EGLAutomaticStereoRenderingProperty=true , then glCompileShader failed #121

Description

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);
}
`

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions