gl.glEnable(GL.GL_VERTEX_PROGRAM_NV); gl.glProgramParameter4fNV(GL.GL_VERTEX_PROGRAM_NV, 62, fresnel, fresnel, fresnel, 1.0f);
gl.glEnable(GL.GL_VERTEX_PROGRAM_ARB); gl.glProgramEnvParameter4fARB(GL.GL_VERTEX_PROGRAM_ARB, 62, fresnel, fresnel, fresnel, 1.0f);
    public void display(GLDrawable drawable) {      if (quit) {        return;      }      time.update();      GL gl = drawable.getGL();      GLU glu = drawable.getGLU();      gl.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT);      if (doViewAll) {	viewer.viewAll(gl);	doViewAll = false;      }      if (getFlag(' ')) {        viewer.rotateAboutFocalPoint(new Rotf(Vec3f.Y_AXIS, (float) (time.deltaT() * animRate)));      }      if (toggleWire) {        toggleWire = false;        wire = !wire;        if (wire) {          gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_LINE);        } else {          gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_FILL);        }      }      // draw background      gl.glDisable(GL.GL_DEPTH_TEST);      drawSkyBox(gl, glu);      gl.glEnable(GL.GL_DEPTH_TEST);      gl.glPushMatrix();      viewer.update(gl);      ManipManager.getManipManager().updateCameraParameters(drawable, viewer.getCameraParameters());      ManipManager.getManipManager().render(drawable, gl);      gl.glBindProgramNV(GL.GL_VERTEX_PROGRAM_NV, vtxProg);      gl.glEnable(GL.GL_VERTEX_PROGRAM_NV);      gl.glProgramParameter4fNV(GL.GL_VERTEX_PROGRAM_NV, 62, fresnel, fresnel, fresnel, 1.0f);      // set texture transforms      gl.glActiveTextureARB(GL.GL_TEXTURE0_ARB);      gl.glBindTexture(GL.GL_TEXTURE_CUBE_MAP_ARB, cubemap);      gl.glEnable(GL.GL_TEXTURE_CUBE_MAP_ARB);      gl.glMatrixMode(GL.GL_TEXTURE);      gl.glLoadIdentity();      gl.glScalef(1.0f, -1.0f, 1.0f);      viewer.updateInverseRotation(gl);      gl.glActiveTextureARB(GL.GL_TEXTURE1_ARB);      gl.glBindTexture(GL.GL_TEXTURE_CUBE_MAP_ARB, cubemap);      gl.glEnable(GL.GL_TEXTURE_CUBE_MAP_ARB);      gl.glMatrixMode(GL.GL_TEXTURE);      gl.glLoadIdentity();      gl.glScalef(1.0f, -1.0f, 1.0f);      viewer.updateInverseRotation(gl);      gl.glEnable(GL.GL_REGISTER_COMBINERS_NV);      gl.glColor3f(1.0f, 1.0f, 1.0f);      if (getFlag('s')) {        // single pass        setRefraction(gl, refract);        drawObj(gl, glu, obj);      } else {        // red pass        gl.glColorMask(true, false, false, false);        setRefraction(gl, refract);        drawObj(gl, glu, obj);          gl.glDepthMask(false);        gl.glDepthFunc(GL.GL_EQUAL);        // green pass        gl.glColorMask(false, true, false, false);        setRefraction(gl, refract + wavelengthDelta);        drawObj(gl, glu, obj);        // blue pass        gl.glColorMask(false, false, true, false);        setRefraction(gl, refract + (wavelengthDelta * 2));        drawObj(gl, glu, obj);        gl.glDepthMask(true);        gl.glDepthFunc(GL.GL_LESS);        gl.glColorMask(true, true, true, false);      }      gl.glDisable(GL.GL_REGISTER_COMBINERS_NV);      gl.glDisable(GL.GL_VERTEX_PROGRAM_NV);      gl.glMatrixMode(GL.GL_MODELVIEW);      gl.glPopMatrix();    }