Package com.jogamp.opengl.util.glsl

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


        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);
        shaderProgram.add(gl, fragmentShader, System.err);
        if (!shaderProgram.link(gl, System.err))
            throw new GLException("Couldn't link program: " + shaderProgram);
View Full Code Here


    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)) {
            throw new GLException("could not link program: " + solidsShader);
        }
View Full Code Here

                new String[]{"shaders/scene.frag.txt"}, false);

        final OutputStream baos = new ByteArrayOutputStream();
        final PrintStream stream = new PrintStream(baos);

        final ShaderProgram program = new ShaderProgram();
        boolean status;
        status = program.add(gl, vs, stream);
        status &= program.add(gl, fs, stream);
        status &= program.link(gl, stream);

        if (!status) {
            throw new RuntimeException(baos.toString());
        }
View Full Code Here

TOP

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

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.