Package mdesl.graphics.glutils

Examples of mdesl.graphics.glutils.ShaderProgram


  private Color color = new Color();
  private boolean drawing = false;
 
  public static ShaderProgram getDefaultShader() throws LWJGLException {
    return defaultShader == null ? (defaultShader = new ShaderProgram(DEFAULT_VERT_SHADER, DEFAULT_FRAG_SHADER,
        ATTRIBUTES)) : defaultShader;
  }
View Full Code Here


  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

    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

    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

    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

    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

      //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

    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

      //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

          + "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

TOP

Related Classes of mdesl.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.