Examples of ShaderProgram


Examples of mdesl.graphics.glutils.ShaderProgram

  Texture tex0, tex1, mask;
 
  public void create() throws LWJGLException {
    super.create();
   
    ShaderProgram shader = new ShaderProgram(VERT_SHADER, FRAG_SHADER, SpriteBatch.ATTRIBUTES);
    //setup our custom uniforms
    shader.use();
   
    shader.setUniformi(TEX_ALT, 1);
    shader.setUniformi(TEX_MASK, 2);
       
    System.out.println(VERT_SHADER);
    System.out.println();
    System.out.println(FRAG_SHADER);
   
View Full Code Here

Examples of mdesl.graphics.glutils.ShaderProgram

    try {
      final String VERTEX = Util.readFile(Util.getResourceAsStream("res/shadertut/lesson3.vert"));
      final String FRAGMENT = Util.readFile(Util.getResourceAsStream("res/shadertut/lesson3.frag"));
     
      //create our shader program -- be sure to pass SpriteBatch's default attributes!
      program = new ShaderProgram(VERTEX, FRAGMENT, SpriteBatch.ATTRIBUTES);
           
      //Good idea to log any warnings if they exist
      if (program.getLog().length()!=0)
        System.out.println(program.getLog());
     
View Full Code Here

Examples of mdesl.graphics.glutils.ShaderProgram

    try {
      final String VERTEX = Util.readFile(Util.getResourceAsStream("res/shadertut/lesson1.vert"));
      final String FRAGMENT = Util.readFile(Util.getResourceAsStream("res/shadertut/lesson1.frag"));
     
      //create our shader program -- be sure to pass SpriteBatch's default attributes!
      ShaderProgram program = new ShaderProgram(VERTEX, FRAGMENT, SpriteBatch.ATTRIBUTES);
     
      //Good idea to log any warnings if they exist
      if (program.getLog().length()!=0)
        System.out.println(program.getLog());
     
      //create our sprite batch
      batch = new SpriteBatch(program);
    } catch (Exception e) {
      //simple exception handling...
View Full Code Here

Examples of mdesl.graphics.glutils.ShaderProgram

    try {
      final String VERTEX = Util.readFile(Util.getResourceAsStream("res/shadertut/lesson4.vert"));
      final String FRAGMENT = Util.readFile(Util.getResourceAsStream("res/shadertut/lesson4b.frag"));
     
      //create our shader program -- be sure to pass SpriteBatch's default attributes!
      program = new ShaderProgram(VERTEX, FRAGMENT, SpriteBatch.ATTRIBUTES);
     
      //Good idea to log any warnings if they exist
      if (program.getLog().length()!=0)
        System.out.println(program.getLog());
     
View Full Code Here

Examples of mdesl.graphics.glutils.ShaderProgram

    try {
      final String VERTEX = Util.readFile(Util.getResourceAsStream("res/shadertut/lesson4.vert"));
      final String FRAGMENT = Util.readFile(Util.getResourceAsStream("res/shadertut/lesson4.frag"));
     
      //create our shader program -- be sure to pass SpriteBatch's default attributes!
      program = new ShaderProgram(VERTEX, FRAGMENT, SpriteBatch.ATTRIBUTES);
     
      //Good idea to log any warnings if they exist
      if (program.getLog().length()!=0)
        System.out.println(program.getLog());
     
View Full Code Here

Examples of mdesl.graphics.glutils.ShaderProgram

      //our fragment shader, which does the blur in one direction at a time
      final String FRAG = Util.readFile(Util.getResourceAsStream("res/shadertut/lesson5.frag"));

      //create our shader program
      blurShader = new ShaderProgram(VERT, FRAG, SpriteBatch.ATTRIBUTES);

      //Good idea to log any warnings if they exist
      if (blurShader.getLog().length()!=0)
        System.out.println(blurShader.getLog());
View Full Code Here

Examples of mdesl.graphics.glutils.ShaderProgram

    try {
      final String VERTEX = Util.readFile(Util.getResourceAsStream("res/shadertut/lesson2.vert"));
      final String FRAGMENT = Util.readFile(Util.getResourceAsStream("res/shadertut/lesson2.frag"));
     
      //create our shader program -- be sure to pass SpriteBatch's default attributes!
      ShaderProgram program = new ShaderProgram(VERTEX, FRAGMENT, SpriteBatch.ATTRIBUTES);
     
      //Good idea to log any warnings if they exist
      if (program.getLog().length()!=0)
        System.out.println(program.getLog());
     
      //create our sprite batch
      batch = new SpriteBatch(program);
    } catch (Exception e) {
      //simple exception handling...
View Full Code Here

Examples of mdesl.graphics.glutils.ShaderProgram

      //our fragment shader, which does the blur in one direction at a time
      final String FRAG = Util.readFile(Util.getResourceAsStream("res/shadertut/lesson6.frag"));

      //create our shader program
      ShaderProgram.setStrictMode(false);
      shader = new ShaderProgram(VERT, FRAG, SpriteBatch.ATTRIBUTES);

      //Good idea to log any warnings if they exist
      if (shader.getLog().length()!=0)
        System.out.println(shader.getLog());
View Full Code Here

Examples of mdesl.graphics.glutils.ShaderProgram

          + "varying vec2 vTexCoord;\n" + "void main() {\n"
          + "  vec4 texColor = texture2D(u_texture, vTexCoord);\n"
          + "  gl_FragColor = texColor;\n" + "}";
     
      ShaderProgram.setStrictMode(false);
      program = new ShaderProgram(VERT, FRAG, attr);
      if (program.getLog().length()!=0)
        System.out.println("Shader Log: "+program.getLog());
     
      MathUtil.setToProjection(proj, 0.01f, 1000f, 45f, Display.getWidth()/(float)Display.getHeight());
     
View Full Code Here

Examples of org.lwjgl.test.opengles.util.ShaderProgram

    fsh = new Shader(GL_FRAGMENT_SHADER, "varying lowp vec3 color;\n" +
                                         "void main(void) {\n" +
                                         "\tgl_FragColor = vec4(color, 1.0);\n" +
                                         "}");

    program = new ShaderProgram(vsh, fsh);
    program.enable();

    LIGHT_POS = program.getUniformLocation("LIGHT_POS");

    MVP = program.getUniformLocation("MODEL_VIEW_PROJECTION_MATRIX");
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.