Examples of glBlendFunc()


Examples of javax.media.opengl.GL2.glBlendFunc()

      gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
    } else if(drawingMode == DrawingMode.ADD) {
      if(isGlExtBlendSubtractSupported) {
        gl.glBlendEquation(GL.GL_FUNC_ADD);
      }
      gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE);
    } else if(drawingMode == DrawingMode.ALPHA_ADD) {
      if(isGlExtBlendSubtractSupported) {
        gl.glBlendEquation(GL.GL_FUNC_ADD);
      }
      gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE);
View Full Code Here

Examples of javax.media.opengl.GL2.glBlendFunc()

      gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE);
    } else if(drawingMode == DrawingMode.ALPHA_ADD) {
      if(isGlExtBlendSubtractSupported) {
        gl.glBlendEquation(GL.GL_FUNC_ADD);
      }
      gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE);
    } else if(drawingMode == DrawingMode.MULTIPLY) {
      if(isGlExtBlendSubtractSupported) {
        gl.glBlendEquation(GL.GL_FUNC_ADD);
      }
      gl.glBlendFunc(GL.GL_DST_COLOR, GL.GL_ZERO);
View Full Code Here

Examples of javax.media.opengl.GL2.glBlendFunc()

      gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE);
    } else if(drawingMode == DrawingMode.MULTIPLY) {
      if(isGlExtBlendSubtractSupported) {
        gl.glBlendEquation(GL.GL_FUNC_ADD);
      }
      gl.glBlendFunc(GL.GL_DST_COLOR, GL.GL_ZERO);
    } else if(drawingMode == DrawingMode.OVERWRITE) {
      if(isGlExtBlendSubtractSupported) {
        gl.glBlendEquation(GL.GL_FUNC_ADD);
      }
      gl.glBlendFunc(GL.GL_ONE, GL.GL_ZERO);
View Full Code Here

Examples of javax.media.opengl.GL2.glBlendFunc()

      gl.glBlendFunc(GL.GL_DST_COLOR, GL.GL_ZERO);
    } else if(drawingMode == DrawingMode.OVERWRITE) {
      if(isGlExtBlendSubtractSupported) {
        gl.glBlendEquation(GL.GL_FUNC_ADD);
      }
      gl.glBlendFunc(GL.GL_ONE, GL.GL_ZERO);
    } else if(drawingMode == DrawingMode.SUBTRACT) {
      // This uses an extension!!
      if(isGlExtBlendSubtractSupported) {
        gl.glBlendEquation(GL.GL_FUNC_REVERSE_SUBTRACT);
      } else {
View Full Code Here

Examples of javax.media.opengl.GL2.glBlendFunc()

      if(isGlExtBlendSubtractSupported) {
        gl.glBlendEquation(GL.GL_FUNC_REVERSE_SUBTRACT);
      } else {
        throw new UnsupportedOperationException("Subtract drawing mode is not supported.");
      }
      gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE);
    }
  }
 
  //  public void setPolygonAntialiasing(boolean enabled) {
  //  polygonAntialiasing = enabled;
View Full Code Here

Examples of javax.media.opengl.GL2.glBlendFunc()

      gl.glHint(GL2.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);
     
      // Lighting, Coloring
      gl.glEnable(GL2.GL_LIGHTING);
    gl.glEnable(GL.GL_BLEND);
      gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
      gl.glEnable(GL2.GL_COLOR_MATERIAL);
      gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2.GL_AMBIENT_AND_DIFFUSE);
      gl.glShadeModel(GL2.GL_SMOOTH);

    // Texturing
View Full Code Here

Examples of javax.media.opengl.GL2.glBlendFunc()

      gl.glHint(GL2.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);
     
      // Lighting, Coloring
      gl.glEnable(GL2.GL_LIGHTING);
    gl.glEnable(GL.GL_BLEND);
      gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
      gl.glEnable(GL2.GL_COLOR_MATERIAL);
      gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2.GL_AMBIENT_AND_DIFFUSE);
      gl.glShadeModel(GL2.GL_SMOOTH);

      // Anti-Aliasing (Polygon antialiasing causes problems on most graphics cards, don't use it!)
View Full Code Here

Examples of javax.media.opengl.GL3.glBlendFunc()

        port.max(Y, drawable.getSurfaceHeight() / 2);
        //gl.glEnable(gl.GL_VERTEX_PROGRAM_POINT_SIZE);
        gl.glViewport(0, 0, (int) (port.max(X) - port.min(X)), (int) (port.max(Y) - port.min(Y)));
        gl.glClearColor(0, 0, 0, 1);
        gl.glEnable(GL.GL_BLEND);
        gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);

        ShaderCode vertexShader = ShaderCode.create(gl, GL3.GL_VERTEX_SHADER, this.getClass(), "shader", null, "vertex", false);
        ShaderCode geometryShader = ShaderCode.create(gl, GL3.GL_GEOMETRY_SHADER, this.getClass(), "shader", null, "geometry", false);
        ShaderCode fragmentShader = ShaderCode.create(gl, GL3.GL_FRAGMENT_SHADER, this.getClass(), "shader", null, "fragment", false);
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.