Examples of ShaderProgram


Examples of com.googlecode.gwtgl.wrapper.ShaderProgram

    Shader vertexShader = getShader(ShaderType.VERTEX_SHADER,
        Resources.INSTANCE.vertexShader().getText());
    Shader fragmentShader = getShader(ShaderType.FRAGMENT_SHADER,
        Resources.INSTANCE.fragmentShader().getText());
    // Create the program object
    shaderProgram = new ShaderProgram(webGLWrapper, vertexShader,
        fragmentShader);
    // Bind vertexPosition to attribute 0
    // Bind texPosition to attribute 1
    shaderProgram.bindAttribLocation(0, "vertexPosition");
    shaderProgram.bindAttribLocation(1, "texPosition");
View Full Code Here

Examples of com.googlecode.gwtgl.wrapper.ShaderProgram

        Shaders.INSTANCE.fragmentShader().getText());
    Shader vertexShader = getShader(ShaderType.VERTEX_SHADER,
        Shaders.INSTANCE.vertexShader().getText());

    // Create a ShaderProgram with the Shaders set
    shaderProgram = new ShaderProgram(webGLWrapper, vertexShader,
        fragmentShader);

    // Check if the ShaderProgram is correctly linked
    if (!shaderProgram.isLinked()) {
      throw new RuntimeException("Could not initialise shaders");
View Full Code Here

Examples of com.googlecode.gwtgl.wrapper.ShaderProgram

    Shader vertexShader = getShader(ShaderType.VERTEX_SHADER,
        Resources.INSTANCE.vertexShader().getText());
    Shader fragmentShader = getShader(ShaderType.FRAGMENT_SHADER,
        Resources.INSTANCE.fragmentShader().getText());
    // Create the program object
    shaderProgram = new ShaderProgram(webGLWrapper, vertexShader,
        fragmentShader);
    // Bind vertexPosition to attribute 0
    // Bind texPosition to attribute 1
    shaderProgram.bindAttribLocation(0, "vertexPosition");
    shaderProgram.bindAttribLocation(1, "texPosition");
View Full Code Here

Examples of com.googlecode.gwtgl.wrapper.ShaderProgram

    Shader vertexShader = getShader(ShaderType.VERTEX_SHADER,
        Resources.INSTANCE.vertexShader().getText());
    Shader fragmentShader = getShader(ShaderType.FRAGMENT_SHADER,
        Resources.INSTANCE.fragmentShader().getText());
    // Create the program object
    shaderProgram = new ShaderProgram(webGLWrapper, vertexShader,
        fragmentShader);
    // Bind vertexPosition to attribute 0
    shaderProgram.bindAttribLocation(0, "vertexPosition");
    // Bind texPosition to attribute 1
    shaderProgram.bindAttribLocation(1, "texPosition");
View Full Code Here

Examples of com.googlecode.gwtgl.wrapper.ShaderProgram

    Shader vertexShader = getShader(ShaderType.VERTEX_SHADER,
        Resources.INSTANCE.vertexShader().getText());
    Shader fragmentShader = getShader(ShaderType.FRAGMENT_SHADER,
        Resources.INSTANCE.fragmentShader().getText());
    // Create the program object
    shaderProgram = new ShaderProgram(webGLWrapper, vertexShader,
        fragmentShader);
    // Bind vertexPosition to attribute 0
    // Bind texPosition to attribute 1
    shaderProgram.bindAttribLocation(0, "vertexPosition");
    shaderProgram.bindAttribLocation(1, "texPosition");
View Full Code Here

Examples of com.googlecode.gwtgl.wrapper.ShaderProgram

        Shaders.INSTANCE.fragmentShader().getText());
    Shader vertexShader = getShader(ShaderType.VERTEX_SHADER,
        Shaders.INSTANCE.vertexShader().getText());

    // Create a ShaderProgram with the Shaders set
    shaderProgram = new ShaderProgram(webGLWrapper, vertexShader,
        fragmentShader);

    // Check if the ShaderProgram is correctly linked
    if (!shaderProgram.isLinked()) {
      throw new RuntimeException(shaderProgram.getProgramInfoLog());
View Full Code Here

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

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

    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

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

                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

Examples of com.ngt.jopenmetaverse.shared.sim.rendering.ShaderProgram

   * Creates the ShaderProgram used by the example to render.
   * @throws Exception
   */
   private void initShaders() throws Exception {

     shaderProgram = new ShaderProgram();
     boolean shaderLoadingStatus = shaderProgram.Load(new String[] {Settings.RESOURCE_DIR + "/shaders/vertex-shader-2.vert"
         , Settings.RESOURCE_DIR + "/shaders/fragment-shader-2.frag"},
         new String[] {"vertexPosition", "texPosition", "aVertexNormal"});

     if(!shaderLoadingStatus)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.