Tabnine Logo
ShaderUtil.checkGLError
Code IndexAdd Tabnine to your IDE (free)

How to use
checkGLError
method
in
com.novoda.spikes.arcore.google.rendering.ShaderUtil

Best Java code snippets using com.novoda.spikes.arcore.google.rendering.ShaderUtil.checkGLError (Showing top 20 results out of 315)

origin: novoda/spikes

GLES20.glUseProgram(quadProgram);
ShaderUtil.checkGLError(TAG, "Program creation");
ShaderUtil.checkGLError(TAG, "Program parameters");
origin: novoda/spikes

GLES20.glUseProgram(quadProgram);
ShaderUtil.checkGLError(TAG, "Program creation");
ShaderUtil.checkGLError(TAG, "Program parameters");
origin: novoda/spikes

/**
 * Updates the OpenGL buffer contents to the provided point. Repeated calls with the same point
 * cloud will be ignored.
 */
public void update(PointCloud cloud) {
 if (lastPointCloud == cloud) {
  // Redundant call.
  return;
 }
 ShaderUtil.checkGLError(TAG, "before update");
 GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, vbo);
 lastPointCloud = cloud;
 // If the VBO is not large enough to fit the new point cloud, resize it.
 numPoints = lastPointCloud.getPoints().remaining() / FLOATS_PER_POINT;
 if (numPoints * BYTES_PER_POINT > vboSize) {
  while (numPoints * BYTES_PER_POINT > vboSize) {
   vboSize *= 2;
  }
  GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, vboSize, null, GLES20.GL_DYNAMIC_DRAW);
 }
 GLES20.glBufferSubData(
   GLES20.GL_ARRAY_BUFFER, 0, numPoints * BYTES_PER_POINT, lastPointCloud.getPoints());
 GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);
 ShaderUtil.checkGLError(TAG, "after update");
}
origin: novoda/spikes

/**
 * Updates the OpenGL buffer contents to the provided point. Repeated calls with the same point
 * cloud will be ignored.
 */
public void update(PointCloud cloud) {
 if (lastPointCloud == cloud) {
  // Redundant call.
  return;
 }
 ShaderUtil.checkGLError(TAG, "before update");
 GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, vbo);
 lastPointCloud = cloud;
 // If the VBO is not large enough to fit the new point cloud, resize it.
 numPoints = lastPointCloud.getPoints().remaining() / FLOATS_PER_POINT;
 if (numPoints * BYTES_PER_POINT > vboSize) {
  while (numPoints * BYTES_PER_POINT > vboSize) {
   vboSize *= 2;
  }
  GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, vboSize, null, GLES20.GL_DYNAMIC_DRAW);
 }
 GLES20.glBufferSubData(
   GLES20.GL_ARRAY_BUFFER, 0, numPoints * BYTES_PER_POINT, lastPointCloud.getPoints());
 GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);
 ShaderUtil.checkGLError(TAG, "after update");
}
origin: novoda/spikes

ShaderUtil.checkGLError(TAG, "before create");
GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);
ShaderUtil.checkGLError(TAG, "buffer alloc");
GLES20.glUseProgram(programName);
ShaderUtil.checkGLError(TAG, "program");
pointSizeUniform = GLES20.glGetUniformLocation(programName, "u_PointSize");
ShaderUtil.checkGLError(TAG, "program  params");
origin: novoda/spikes

ShaderUtil.checkGLError(TAG, "before create");
GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);
ShaderUtil.checkGLError(TAG, "buffer alloc");
GLES20.glUseProgram(programName);
ShaderUtil.checkGLError(TAG, "program");
pointSizeUniform = GLES20.glGetUniformLocation(programName, "u_PointSize");
ShaderUtil.checkGLError(TAG, "program  params");
origin: novoda/spikes

 /**
  * Renders the point cloud. ArCore point cloud is given in world space.
  *
  * @param cameraView the camera view matrix for this frame, typically from {@link
  *     com.google.ar.core.Camera#getViewMatrix(float[], int)}.
  * @param cameraPerspective the camera projection matrix for this frame, typically from {@link
  *     com.google.ar.core.Camera#getProjectionMatrix(float[], int, float, float)}.
  */
 public void draw(float[] cameraView, float[] cameraPerspective) {
  float[] modelViewProjection = new float[16];
  Matrix.multiplyMM(modelViewProjection, 0, cameraPerspective, 0, cameraView, 0);

  ShaderUtil.checkGLError(TAG, "Before draw");

  GLES20.glUseProgram(programName);
  GLES20.glEnableVertexAttribArray(positionAttribute);
  GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, vbo);
  GLES20.glVertexAttribPointer(positionAttribute, 4, GLES20.GL_FLOAT, false, BYTES_PER_POINT, 0);
  GLES20.glUniform4f(colorUniform, 31.0f / 255.0f, 188.0f / 255.0f, 210.0f / 255.0f, 1.0f);
  GLES20.glUniformMatrix4fv(modelViewProjectionUniform, 1, false, modelViewProjection, 0);
  GLES20.glUniform1f(pointSizeUniform, 5.0f);

  GLES20.glDrawArrays(GLES20.GL_POINTS, 0, numPoints);
  GLES20.glDisableVertexAttribArray(positionAttribute);
  GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);

  ShaderUtil.checkGLError(TAG, "Draw");
 }
}
origin: novoda/spikes

 /**
  * Renders the point cloud. ArCore point cloud is given in world space.
  *
  * @param cameraView the camera view matrix for this frame, typically from {@link
  *     com.google.ar.core.Camera#getViewMatrix(float[], int)}.
  * @param cameraPerspective the camera projection matrix for this frame, typically from {@link
  *     com.google.ar.core.Camera#getProjectionMatrix(float[], int, float, float)}.
  */
 public void draw(float[] cameraView, float[] cameraPerspective) {
  float[] modelViewProjection = new float[16];
  Matrix.multiplyMM(modelViewProjection, 0, cameraPerspective, 0, cameraView, 0);

  ShaderUtil.checkGLError(TAG, "Before draw");

  GLES20.glUseProgram(programName);
  GLES20.glEnableVertexAttribArray(positionAttribute);
  GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, vbo);
  GLES20.glVertexAttribPointer(positionAttribute, 4, GLES20.GL_FLOAT, false, BYTES_PER_POINT, 0);
  GLES20.glUniform4f(colorUniform, 31.0f / 255.0f, 188.0f / 255.0f, 210.0f / 255.0f, 1.0f);
  GLES20.glUniformMatrix4fv(modelViewProjectionUniform, 1, false, modelViewProjection, 0);
  GLES20.glUniform1f(pointSizeUniform, 5.0f);

  GLES20.glDrawArrays(GLES20.GL_POINTS, 0, numPoints);
  GLES20.glDisableVertexAttribArray(positionAttribute);
  GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);

  ShaderUtil.checkGLError(TAG, "Draw");
 }
}
origin: novoda/spikes

GLES20.glUseProgram(planeProgram);
ShaderUtil.checkGLError(TAG, "Program creation");
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
ShaderUtil.checkGLError(TAG, "Texture loading");
planeUvMatrixUniform = GLES20.glGetUniformLocation(planeProgram, "u_PlaneUvMatrix");
ShaderUtil.checkGLError(TAG, "Program parameters");
origin: novoda/spikes

GLES20.glUseProgram(planeProgram);
ShaderUtil.checkGLError(TAG, "Program creation");
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
ShaderUtil.checkGLError(TAG, "Texture loading");
planeUvMatrixUniform = GLES20.glGetUniformLocation(planeProgram, "u_PlaneUvMatrix");
ShaderUtil.checkGLError(TAG, "Program parameters");
origin: novoda/spikes

GLES20.glUseProgram(program);
ShaderUtil.checkGLError(TAG, "Program creation");
  GLES20.glGetUniformLocation(program, "u_ColorCorrectionParameters");
ShaderUtil.checkGLError(TAG, "Program parameters");
ShaderUtil.checkGLError(TAG, "Texture loading");
GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, 0);
ShaderUtil.checkGLError(TAG, "OBJ buffer load");
origin: novoda/spikes

private void draw(float[] cameraView, float[] cameraPerspective) {
 // Build the ModelView and ModelViewProjection matrices
 // for calculating cube position and light.
 Matrix.multiplyMM(modelViewMatrix, 0, cameraView, 0, modelMatrix, 0);
 Matrix.multiplyMM(modelViewProjectionMatrix, 0, cameraPerspective, 0, modelViewMatrix, 0);
 // Set the position of the plane
 vertexBuffer.rewind();
 GLES20.glVertexAttribPointer(
   planeXZPositionAlphaAttribute,
   COORDS_PER_VERTEX,
   GLES20.GL_FLOAT,
   false,
   BYTES_PER_FLOAT * COORDS_PER_VERTEX,
   vertexBuffer);
 // Set the Model and ModelViewProjection matrices in the shader.
 GLES20.glUniformMatrix4fv(planeModelUniform, 1, false, modelMatrix, 0);
 GLES20.glUniformMatrix4fv(
   planeModelViewProjectionUniform, 1, false, modelViewProjectionMatrix, 0);
 indexBuffer.rewind();
 GLES20.glDrawElements(
   GLES20.GL_TRIANGLE_STRIP, indexBuffer.limit(), GLES20.GL_UNSIGNED_SHORT, indexBuffer);
 ShaderUtil.checkGLError(TAG, "Drawing plane");
}
origin: novoda/spikes

private void draw(float[] cameraView, float[] cameraPerspective) {
 // Build the ModelView and ModelViewProjection matrices
 // for calculating cube position and light.
 Matrix.multiplyMM(modelViewMatrix, 0, cameraView, 0, modelMatrix, 0);
 Matrix.multiplyMM(modelViewProjectionMatrix, 0, cameraPerspective, 0, modelViewMatrix, 0);
 // Set the position of the plane
 vertexBuffer.rewind();
 GLES20.glVertexAttribPointer(
   planeXZPositionAlphaAttribute,
   COORDS_PER_VERTEX,
   GLES20.GL_FLOAT,
   false,
   BYTES_PER_FLOAT * COORDS_PER_VERTEX,
   vertexBuffer);
 // Set the Model and ModelViewProjection matrices in the shader.
 GLES20.glUniformMatrix4fv(planeModelUniform, 1, false, modelMatrix, 0);
 GLES20.glUniformMatrix4fv(
   planeModelViewProjectionUniform, 1, false, modelViewProjectionMatrix, 0);
 indexBuffer.rewind();
 GLES20.glDrawElements(
   GLES20.GL_TRIANGLE_STRIP, indexBuffer.limit(), GLES20.GL_UNSIGNED_SHORT, indexBuffer);
 ShaderUtil.checkGLError(TAG, "Drawing plane");
}
origin: novoda/spikes

ShaderUtil.checkGLError(TAG, "Setting up to draw planes");
GLES20.glDepthMask(true);
ShaderUtil.checkGLError(TAG, "Cleaning up after drawing planes");
origin: novoda/spikes

ShaderUtil.checkGLError(TAG, "Setting up to draw planes");
GLES20.glDepthMask(true);
ShaderUtil.checkGLError(TAG, "Cleaning up after drawing planes");
origin: novoda/spikes

GLES20.glEnable(GLES20.GL_DEPTH_TEST);
ShaderUtil.checkGLError(TAG, "Draw");
origin: novoda/spikes

GLES20.glEnable(GLES20.GL_DEPTH_TEST);
ShaderUtil.checkGLError(TAG, "Draw");
origin: novoda/spikes

ShaderUtil.checkGLError(TAG, "Before draw");
ShaderUtil.checkGLError(TAG, "After draw");
origin: novoda/spikes

ShaderUtil.checkGLError(TAG, "Before draw");
ShaderUtil.checkGLError(TAG, "After draw");
origin: novoda/spikes

ShaderUtil.checkGLError(TAG, "Before draw");
ShaderUtil.checkGLError(TAG, "After draw");
com.novoda.spikes.arcore.google.renderingShaderUtilcheckGLError

Javadoc

Checks if we've had an error inside of OpenGL ES, and if so what that error is.

Popular methods of ShaderUtil

  • loadGLShader
    Converts a raw text file, saved as a resource, into an OpenGL ES shader.
  • readRawTextFileFromAssets
    Converts a raw text file into a string.

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Runner (org.openjdk.jmh.runner)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now