|
From: Ioannis T. <sp...@us...> - 2004-03-31 21:15:11
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/shaders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3447 Modified Files: shaderFSH.fsh ShadersTest.java Log Message: Bugs fixed Index: ShadersTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/shaders/ShadersTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ShadersTest.java 31 Mar 2004 17:43:46 -0000 1.2 +++ ShadersTest.java 31 Mar 2004 21:03:20 -0000 1.3 @@ -122,13 +122,11 @@ DisplayMode displayMode; - displayMode = chooseMode(modes, 1024, 768, 32); - if ( displayMode == null ) - displayMode = chooseMode(modes, 800, 600, 32); + displayMode = chooseMode(modes, 1024, 768); if ( displayMode == null ) - displayMode = chooseMode(modes, 1024, 768, 16); + displayMode = chooseMode(modes, 800, 600); if ( displayMode == null ) - displayMode = chooseMode(modes, 800, 600, 16); + displayMode = chooseMode(modes, 640, 480); if ( displayMode == null ) kill("Failed to set an appropriate display mode."); @@ -206,7 +204,7 @@ // Setup lighting for when we have fixed function fragment rendering. GL11.glShadeModel(GL11.GL_SMOOTH); - if (shader == null ) { + if ( shader == null ) { GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHT0); } @@ -281,13 +279,13 @@ sphere.draw(1.0f, 32, 32); } - private static DisplayMode chooseMode(DisplayMode[] modes, int width, int height, int bpp) { + private static DisplayMode chooseMode(DisplayMode[] modes, int width, int height) { DisplayMode bestMode = null; for ( int i = 0; i < modes.length; i++ ) { DisplayMode mode = modes[i]; - if ( mode.width == width && mode.height == height && mode.bpp == bpp && mode.freq <= 85 ) { - if ( bestMode == null || bestMode.freq < mode.freq ) + if ( mode.width == width && mode.height == height && mode.freq <= 85 ) { + if ( bestMode == null || (mode.bpp >= bestMode.bpp && mode.freq > bestMode.freq) ) bestMode = mode; } } Index: shaderFSH.fsh =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/shaders/shaderFSH.fsh,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- shaderFSH.fsh 31 Mar 2004 17:43:46 -0000 1.2 +++ shaderFSH.fsh 31 Mar 2004 21:03:20 -0000 1.3 @@ -8,7 +8,7 @@ // Normalize position. // Multiply with current sin. - color2D.xy = normalize(color2D) * UNIFORMS.x; + color2D.xy = normalize(color2D).xy * UNIFORMS.x; // {-1..1} => {0..1} & Intensify colors. color2D.xy = (vec2(color2D) * 0.5 + 0.5) * 2.0; color2D.z = 1.0; |