Package javax.media.opengl

Examples of javax.media.opengl.GL.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


      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

      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

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

    // Texturing
View Full Code Here

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

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

    if (MT4jSettings.getInstance().isOpenGlMode()){
      GL gl = ((PGraphicsOpenGL)g).gl;
      if (useTexture){
//        gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
//        gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE);
        gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE);
      }
//      gl.glDisable(GL.GL_DEPTH_TEST);
//      gl.glColorMask(true, true, false, false);
    }
   
View Full Code Here

      gl.glEnable( GL.GL_BLEND );             // enable blending
     
      if(!drawFluid)
        fadeToColor(p, gl, 0, 0, 0, 0.05f);

      gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE)// additive blending (ignore alpha)
      gl.glEnable(GL.GL_LINE_SMOOTH);        // make points round
      gl.glLineWidth(1);


      if(renderUsingVA) {
View Full Code Here

        gl.glEnd();
      }

//      gl.glDisable(GL.GL_BLEND);
      //Reset blendfunction
      gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
      pgl.endGL();
    }

   
    public void fadeToColor(PApplet p, GL gl, float r, float g, float b, float speed) {
View Full Code Here

//      */
      //////////////////////////////////////
      gl.glDepthMask(true);
     
        gl.glEnable (GL.GL_BLEND);
        gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
      //////////////////////
      // Draw fill    //
        //////////////////////
//        /*
      gl.glColorMask(true, true, true, true);
View Full Code Here

       gl.glEnd ();

       //Draw aliased off-pixels to real
        gl.glColorMask (true, true, true, true);
        gl.glEnable (GL.GL_BLEND);
        gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);

//      /*       
        gl.glStencilFunc (GL.GL_EQUAL, 0x00, 0x01);
        gl.glStencilOp (GL.GL_KEEP, GL.GL_KEEP, GL.GL_KEEP);
       
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.