android Programming Glossary: loadshader
Modifying camera output using SurfaceTexture and OpenGL http://stackoverflow.com/questions/12519235/modifying-camera-output-using-surfacetexture-and-opengl GLES20.glViewport 0 0 width height static public int loadShader int type String shaderCode int shader GLES20.glCreateShader.. 0 int vertexShader MyGL20Renderer.loadShader GLES20.GL_VERTEX_SHADER vertexShaderCode int fragmentShader.. vertexShaderCode int fragmentShader MyGL20Renderer.loadShader GLES20.GL_FRAGMENT_SHADER fragmentShaderCode mProgram GLES20.glCreateProgram..
Shader for Android OpenGL ES http://stackoverflow.com/questions/4850025/shader-for-android-opengl-es String vertexSource String fragmentSource int vertexShader loadShader GLES20.GL_VERTEX_SHADER vertexSource int pixelShader loadShader.. GLES20.GL_VERTEX_SHADER vertexSource int pixelShader loadShader GLES20.GL_FRAGMENT_SHADER fragmentSource int program GLES20.glCreateProgram.. program program 0 return program private int loadShader int shaderType String source int shader GLES20.glCreateShader..
Android Camera will not work. startPreview fails http://stackoverflow.com/questions/7942378/android-camera-will-not-work-startpreview-fails int vertexShader 0 int fragmentShader 0 try vertexShader loadShader GLES20.GL_VERTEX_SHADER readFile vertex.vsh fragmentShader.. readFile vertex.vsh fragmentShader loadShader GLES20.GL_FRAGMENT_SHADER readFile fragment.fsh catch IOException.. .useDelimiter A .next finally stream.close private int loadShader int type String shaderCode create a vertex shader type GLES20.GL_VERTEX_SHADER..
Modifying camera output using SurfaceTexture and OpenGL http://stackoverflow.com/questions/12519235/modifying-camera-output-using-surfacetexture-and-opengl public void onSurfaceChanged GL10 unused int width int height GLES20.glViewport 0 0 width height static public int loadShader int type String shaderCode int shader GLES20.glCreateShader type GLES20.glShaderSource shader shaderCode GLES20.glCompileShader.. textureVerticesBuffer.put textureVertices textureVerticesBuffer.position 0 int vertexShader MyGL20Renderer.loadShader GLES20.GL_VERTEX_SHADER vertexShaderCode int fragmentShader MyGL20Renderer.loadShader GLES20.GL_FRAGMENT_SHADER fragmentShaderCode.. int vertexShader MyGL20Renderer.loadShader GLES20.GL_VERTEX_SHADER vertexShaderCode int fragmentShader MyGL20Renderer.loadShader GLES20.GL_FRAGMENT_SHADER fragmentShaderCode mProgram GLES20.glCreateProgram create empty OpenGL ES Program GLES20.glAttachShader..
Shader for Android OpenGL ES http://stackoverflow.com/questions/4850025/shader-for-android-opengl-es example of how to load a shader public int createProgram String vertexSource String fragmentSource int vertexShader loadShader GLES20.GL_VERTEX_SHADER vertexSource int pixelShader loadShader GLES20.GL_FRAGMENT_SHADER fragmentSource int program GLES20.glCreateProgram.. vertexSource String fragmentSource int vertexShader loadShader GLES20.GL_VERTEX_SHADER vertexSource int pixelShader loadShader GLES20.GL_FRAGMENT_SHADER fragmentSource int program GLES20.glCreateProgram if program 0 GLES20.glAttachShader program vertexShader.. Log.e TAG GLES20.glGetProgramInfoLog program GLES20.glDeleteProgram program program 0 return program private int loadShader int shaderType String source int shader GLES20.glCreateShader shaderType if shader 0 GLES20.glShaderSource shader source..
Android Camera will not work. startPreview fails http://stackoverflow.com/questions/7942378/android-camera-will-not-work-startpreview-fails 0.0f 1.0f 0.2f 1.0f Debug.out Hello init. Shaders int vertexShader 0 int fragmentShader 0 try vertexShader loadShader GLES20.GL_VERTEX_SHADER readFile vertex.vsh fragmentShader loadShader GLES20.GL_FRAGMENT_SHADER readFile fragment.fsh catch.. 0 int fragmentShader 0 try vertexShader loadShader GLES20.GL_VERTEX_SHADER readFile vertex.vsh fragmentShader loadShader GLES20.GL_FRAGMENT_SHADER readFile fragment.fsh catch IOException e Debug.out The shaders could not be found. e.printStackTrace.. stream assetManager.open path try return new Scanner stream .useDelimiter A .next finally stream.close private int loadShader int type String shaderCode create a vertex shader type GLES20.GL_VERTEX_SHADER or a fragment shader type GLES20.GL_FRAGMENT_SHADER..
|