diff options
author | Chien Yang <[email protected]> | 2006-10-28 18:19:45 +0000 |
---|---|---|
committer | Chien Yang <[email protected]> | 2006-10-28 18:19:45 +0000 |
commit | 273ebc2982d872de46efdcc3d19dc33af2a29271 (patch) | |
tree | bf1271f2f7ef1445ee9746c91f381554b1e1299f /src/classes/jogl | |
parent | 43daeb67bce1132b0d6479ddd3ef735038bd33a3 (diff) |
1) Fixed Issue 349 : OffScreen Canvas3D needlessly forces power-of-two for its buffer
2) Fixed Issue 371 : Poor raster quality for systems that don't support NPOT textures
3) Minor clean up to native piples
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@731 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/classes/jogl')
-rw-r--r-- | src/classes/jogl/javax/media/j3d/JoglPipeline.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/classes/jogl/javax/media/j3d/JoglPipeline.java b/src/classes/jogl/javax/media/j3d/JoglPipeline.java index 60364a1..eae3ab2 100644 --- a/src/classes/jogl/javax/media/j3d/JoglPipeline.java +++ b/src/classes/jogl/javax/media/j3d/JoglPipeline.java @@ -7633,7 +7633,7 @@ class JoglPipeline extends Pipeline { } void textureFillBackground(Context ctx, float texMinU, float texMaxU, float texMinV, float texMaxV, - float mapMinX, float mapMaxX, float mapMinY, float mapMaxY) { + float mapMinX, float mapMaxX, float mapMinY, float mapMaxY, boolean useBilinearFilter) { if (VERBOSE) System.err.println("JoglPipeline.textureFillBackground()"); GLContext context = context(ctx); @@ -7645,6 +7645,13 @@ class JoglPipeline extends Pipeline { disableAttribFor2D(gl); gl.glDepthMask(false); gl.glEnable(GL.GL_TEXTURE_2D); + + /* Setup filter mode if needed */ + if(useBilinearFilter) { + // System.err.println("JoglPipeline - Background : use bilinear filter\n"); + gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR); + gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR); + } // reset the polygon mode gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_FILL); @@ -7678,7 +7685,9 @@ class JoglPipeline extends Pipeline { } void textureFillRaster(Context ctx, float texMinU, float texMaxU, float texMinV, float texMaxV, - float mapMinX, float mapMaxX, float mapMinY, float mapMaxY, float mapZ, float alpha) { + float mapMinX, float mapMaxX, float mapMinY, float mapMaxY, float mapZ, float alpha, + boolean useBilinearFilter) { + if (VERBOSE) System.err.println("JoglPipeline.textureFillRaster()"); GLContext context = context(ctx); @@ -7689,6 +7698,14 @@ class JoglPipeline extends Pipeline { GL.GL_CURRENT_BIT ); disableAttribForRaster(gl); + + /* Setup filter mode if needed */ + if(useBilinearFilter) { + // System.err.println("JoglPipeline - Raster : use bilinear filter\n"); + gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR); + gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR); + } + gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE); gl.glColor4f(1.0f, 1.0f, 1.0f, alpha); |