Package com.jogamp.opengl.util.glsl

Examples of com.jogamp.opengl.util.glsl.ShaderCode


        gl.glViewport(0, 0, (int) (port.max(X) - port.min(X)), (int) (port.max(Y) - port.min(Y)));
        gl.glClearColor(0, 0, 0, 1);
        gl.glEnable(GL.GL_BLEND);
        gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);

        ShaderCode vertexShader = ShaderCode.create(gl, GL3.GL_VERTEX_SHADER, this.getClass(), "shader", null, "vertex", false);
        ShaderCode geometryShader = ShaderCode.create(gl, GL3.GL_GEOMETRY_SHADER, this.getClass(), "shader", null, "geometry", false);
        ShaderCode fragmentShader = ShaderCode.create(gl, GL3.GL_FRAGMENT_SHADER, this.getClass(), "shader", null, "fragment", false);

        if (!vertexShader.compile(gl, System.err))
            throw new GLException("Couldn't compile shader: " + vertexShader);
        if (!geometryShader.compile(gl, System.err))
            throw new GLException("Couldn't compile shader: " + geometryShader);
        if (!fragmentShader.compile(gl, System.err))
            throw new GLException("Couldn't compile shader: " + fragmentShader);

        shaderProgram = new ShaderProgram();
        shaderProgram.add(gl, vertexShader, System.err);
        shaderProgram.add(gl, geometryShader, System.err);
View Full Code Here


      System.out.println("unable to load atlas");
      e.printStackTrace();
      System.exit(1);
    }
   
    ShaderCode tsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
        "shaders", "shaders/bin", "transparents", true);
    ShaderCode tsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
        "shaders", "shaders/bin", "transparents", true);
    tsVp.defaultShaderCustomization(gl, true, true);
    tsFp.defaultShaderCustomization(gl, true, true);
   
    transparentsShader = new ShaderProgram();
    transparentsShader.add(tsVp);
    transparentsShader.add(tsFp);
        if(!transparentsShader.link(gl, System.err)) {
            throw new GLException("could not link program: " + transparentsShader);
        }
        gl.glBindAttribLocation(transparentsShader.program(), 0, "aVertexPosition");
        gl.glBindAttribLocation(transparentsShader.program(), 1, "aTextureCoord");
        tsUPMatrix = gl.glGetUniformLocation(transparentsShader.program(), "uPMatrix");
        tsUMVMatrix = gl.glGetUniformLocation(transparentsShader.program(), "uMVMatrix");
        tsTex = gl.glGetUniformLocation(transparentsShader.program(), "uSampler");

       
    ShaderCode ssVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
        "shaders", "shaders/bin", "solids", true);
    ShaderCode ssFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
        "shaders", "shaders/bin", "solids", true);
    ssVp.defaultShaderCustomization(gl, true, true);
    ssFp.defaultShaderCustomization(gl, true, true);
   
    solidsShader = new ShaderProgram();
    solidsShader.add(ssVp);
    solidsShader.add(ssFp);
        if(!solidsShader.link(gl, System.err)) {
View Full Code Here

            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        final ShaderCode vs = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER,
                1, ShaderCode.class,
                new String[]{"shaders/scene.vert.txt"}, false);
        final ShaderCode fs = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER,
                1, ShaderCode.class,
                new String[]{"shaders/scene.frag.txt"}, false);

        final OutputStream baos = new ByteArrayOutputStream();
        final PrintStream stream = new PrintStream(baos);
View Full Code Here

TOP

Related Classes of com.jogamp.opengl.util.glsl.ShaderCode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.