Package com.badlogic.gdx.graphics.glutils

Examples of com.badlogic.gdx.graphics.glutils.ShaderProgram


    u_environmentCubemap = environmentCubemap ? register(Inputs.environmentCubemap, Setters.environmentCubemap) : -1;
  }

  @Override
  public void init () {
    final ShaderProgram program = this.program;
    this.program = null;
    init(program, renderable);
    renderable = null;

    dirLightsLoc = loc(u_dirLights0color);
View Full Code Here


      + "uniform sampler2D u_texture;\n" //
      + "void main()\n"//
      + "{\n" //
      + "  gl_FragColor = v_color * texture2D(u_texture, v_texCoords);\n" //
      + "}";
    ShaderProgram shader = new ShaderProgram(vertexShader, fragmentShader);
    if (shader.isCompiled() == false) throw new IllegalArgumentException("Error compiling shader: " + shader.getLog());
    return shader;
  }
View Full Code Here

      config.fragmentShader != null ? config.fragmentShader : getDefaultFragmentShader());
  }

  public DepthShader (final Renderable renderable, final Config config, final String prefix, final String vertexShader,
    final String fragmentShader) {
    this(renderable, config, new ShaderProgram(prefix + vertexShader, prefix + fragmentShader));
  }
View Full Code Here

    font = new BitmapFont(Gdx.files.internal("data/arial-15.fnt"), false);
  }

  public void initShader() {
    diffuseShader = new ShaderProgram(DiffuseShader.mVertexShader, DiffuseShader.mFragmentShader);
    if (diffuseShader.isCompiled() == false) {
      Gdx.app.log("diffuseShader: ", diffuseShader.getLog());
      Gdx.app.exit();
    }
 
    waterShaderFog = new ShaderProgram(WaterShaderFog.mVertexShader, WaterShaderFog.mFragmentShader);
    if (waterShaderFog.isCompiled() == false) {
      Gdx.app.log("waterShaderFog: ", waterShaderFog.getLog());
      Gdx.app.exit();
    }
   
    flagShaderFog = new ShaderProgram(DiffuseShaderFogWobble.mVertexShader, DiffuseShaderFogWobble.mFragmentShader);
    if (flagShaderFog.isCompiled() == false) {
      Gdx.app.log("FlagShaderFog: ", flagShaderFog.getLog());
      Gdx.app.exit();
    }
   
View Full Code Here

        + "void main()\n"//
        + "{\n" //
        + "  gl_FragColor = v_color * texture2D(u_texture, v_texCoords);\n" //
        + "}";

      shader = new ShaderProgram(vertexShader, fragmentShader);
      if (shader.isCompiled() == false) throw new IllegalArgumentException("couldn't compile shader: " + shader.getLog());
    }
  }
View Full Code Here

    String vertexShader = Gdx.files.internal("data/" + vertexName
        + ".vertex").readString();
    String fragmentShader = Gdx.files.internal("data/" + fragmentName
        + ".fragment").readString();
    ShaderProgram.pedantic = false;
    ShaderProgram shader = new ShaderProgram(vertexShader, fragmentShader);
    if (!shader.isCompiled()) {
      System.out.println(shader.getLog());
      Gdx.app.exit();
    }
//      Gdx.app.log("shader compiled", shader.getLog());
    return shader;
  }
View Full Code Here

      + "  gl_FragColor = v_color * vec4(result, color.a);\n" //
      + "}";

    // System.out.println("VERTEX PROGRAM:\n------------\n\n" + vert);
    // System.out.println("FRAGMENT PROGRAM:\n------------\n\n" + frag);
    ShaderProgram program = new ShaderProgram(vert, frag);
    ShaderProgram.pedantic = false;
    if (!program.isCompiled()) throw new IllegalArgumentException("Error compiling shader: " + program.getLog());

    program.begin();
    program.setUniformi("u_texture", 0);
    program.setUniformi("u_normals", 1);
    program.end();

    return program;
  }
View Full Code Here

    String vertexShader = FileUtils.getContent(vertexName
        + ".vertex");
    String fragmentShader = FileUtils.getContent(fragmentName
        + ".fragment");
    ShaderProgram.pedantic = false;   
    ShaderProgram shader = new ShaderProgram(vertexShader, fragmentShader);
    if (!shader.isCompiled()) {
      System.out.println(shader.getLog());
      Gdx.app.exit();
    } else
      Gdx.app.log("shader compiled", shader.getLog());
    return shader;
  }
View Full Code Here

      + "void main()\n"//
      + "{\n" //
      + "  gl_FragColor = v_color * texture2D(u_texture, v_texCoords);\n" //
      + "}";

    ShaderProgram shader = new ShaderProgram(vertexShader, fragmentShader);
    if (shader.isCompiled() == false) throw new IllegalArgumentException("couldn't compile shader: " + shader.getLog());
    return shader;
  }
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.graphics.glutils.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.