gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz ./TODO Documentation/FAQ gfx/demo/fpfont.py...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz ./TODO Documentation/FAQ gfx/demo/fpfont.py...
Date: Sun, 26 Jan 2003 16:25:58 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        03/01/26 16:25:58

Modified files:
        .              : TODO 
        Documentation  : FAQ 
        gfx/demo       : fpfont.py 
        gfx/jni        : GzzGL-jni.cxx 
        gfx/util       : texpacker.py 
        gzz/gfx/gl     : GL.java 
        gzz/view       : pagespanview.py 

Log message:
        More ATI work: uncompressed mipzips

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.535&tr2=1.536&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/Documentation/FAQ.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/fpfont.py.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/jni/GzzGL-jni.cxx.diff?tr1=1.82&tr2=1.83&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/util/texpacker.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GL.java.diff?tr1=1.45&tr2=1.46&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/pagespanview.py.diff?tr1=1.26&tr2=1.27&r1=text&r2=text

Patches:
Index: gzz/Documentation/FAQ
diff -u gzz/Documentation/FAQ:1.9 gzz/Documentation/FAQ:1.10
--- gzz/Documentation/FAQ:1.9   Sat Jan 25 09:47:30 2003
+++ gzz/Documentation/FAQ       Sun Jan 26 16:25:58 2003
@@ -1,5 +1,5 @@
 Frequently Asked Questions about Gzz, with answers.
-$Id: FAQ,v 1.9 2003/01/25 14:47:30 tjl Exp $
+$Id: FAQ,v 1.10 2003/01/26 21:25:58 tjl Exp $
 
 All trademarks are the trademarks of their respective owners.
 
@@ -248,27 +248,30 @@
       likely be resolved soon since active work is being done
       in the area.
       
-      Also, the drivers still somewhat unstable but we're working around that.
+      Also, the drivers still somewhat unstable but we're 
+      working around that. See GL.workaroundStupidBuggyAtiDrivers
+      for a list of bugs.
 
     - R100, R200: Radeon 7500, 8500, 9000, 9100: AVOID
 
-       - ATI did not have proper Linux drivers with texture shading support out
-         during the reign of these cards. Therefore, we did not buy
-         any and have not developed support for the ATI_fragment_shader
-         extension, and you will get very suboptimal results with these.
-
-         If you are into programming and own one of these cards, it should
-         not be too difficult to rectify the situation; contact us
-         for help.
+       - ATI did not have proper Linux drivers with texture 
+         shading support out during the reign of these cards. Therefore,
+         we did not buy any and have not developed support for the
+         ATI_fragment_shader extension, and you will get very suboptimal
+         results with these.
+
+         If you are into programming and own one of these cards,
+         it should not be too difficult to rectify the situation;
+         contact us for help.
 
     - R350, RV350, R400: UNKNOWN, LIKELY GOOD
 
 NVIDIA:
     - NV20: GeForce4 Ti, GeForce3, GeForce3 Ti, GeForce4 Go 4200: RECOMMENDED
 
-       - NVIDIA drivers are good and we put their register combiners 
extensions to active
-         use in Gzz. Libpaper uses texture shading on NV20, and we are working
-         on vertex programs.
+       - NVIDIA drivers are good and we put their register combiners
+         extensions to active use in Gzz. Libpaper uses texture shading
+         on NV20, and we are working on vertex programs.
 
     - NV10: GeForce2 Ti, GeForce2 MX, GeForce4 MX, GeForce4 Go 460: PASSABLE
       
@@ -276,8 +279,11 @@
 
     - NV30: GeForce FX: UNKNOWN, LIKELY GOOD
 
-       - At the time of writing, this card is not yet out. If it delivers its 
promises,
-         it will likely become the card of choice here.
+       - At the time of writing, this card is not yet out. 
+         If it delivers its promises,
+         it will likely become the card of choice here; NVIDIA's
+         drivers have so far been good, with only few occasional
+         problems.
 
 Brand X:
     - support for OpenGL 1.1 is required, possibly more. 1.4 recommended.
@@ -290,28 +296,29 @@
       the graphics MUCH better, but is not absolutely required..
     
 ---
-2. I'm a video card / input device / ... manufacturer. How can I get my 
hardware better supported?
+2. I'm a video card / input device / ... manufacturer. How can I get my
+hardware better supported?
 
-Well, as usual, no guarantees, but if you donate us cool hardware with 
functional linux
-drivers, it is quite likely that things will happen. 
+Well, as usual, no guarantees, but if you donate us cool hardware with
+functional linux drivers, it is quite likely that things will happen.
 
-N.B. this is more likely to work for high-end than low-end hardware: if ATI 
were
-to give us 10 Radeon 7500s right now, they might just sit on a shelf as spares.
-However, if they were to give us 1 R350 (Radeon 9900?), it would probably be 
fully 
-supported in days.
+N.B. this is more likely to work for high-end than low-end hardware:
+if ATI were to give us 10 Radeon 7500s right now, they might just sit
+on a shelf as spares.  However, if they were to give us 1 R350 (Radeon
+9900?), it would probably be fully supported in days.
 
 ---
 3. Why are fragment programs (texture shading) so important for Gzz?
 
-They allow detailed control of the output, pixel by pixel, at amazing speeds.
-For instance, rendering unique backgrounds using libpaper stops being about 
-trying to coax the hardware to do something it doesn't want and starts being
-about really sampling the distribution.
+They allow detailed control of the output, pixel by pixel, at amazing
+speeds.  For instance, rendering unique backgrounds using libpaper stops
+being about trying to coax the hardware to do something it doesn't want
+and starts being about really sampling the distribution.
 
 Also, there are lots of tricks we can use to improve text quality using
 fragment programs.
 
-Quite simply, this is where a lot of our visual experimentation will be 
happening
-in the near future. Be there or be square ;)
+Quite simply, this is where a lot of our visual experimentation will be
+happening in the near future. Be there or be square ;)
 
 
Index: gzz/TODO
diff -u gzz/TODO:1.535 gzz/TODO:1.536
--- gzz/TODO:1.535      Sun Jan 26 10:06:53 2003
+++ gzz/TODO    Sun Jan 26 16:25:57 2003
@@ -63,6 +63,7 @@
 
 0.8alpha5: saving, loading etc. with mediaserver useful; tests
     jvk:
+       - parseCombiner -> fragment program compiler
        - fix libpaper optimized papers on R300:
            the problem is that GENERATE_MIPMAP_SGIS does not work
            for copyteximage.
@@ -73,7 +74,8 @@
            is giving out garbage?? (test, report))
            Use the "workaroundStupidBuggyAtiDrivers" if for the fix,
            and send a bug report.
-       - work around xupdf compressed tex image bug on R300
+       - make failing gzz tests for all those cases, mark
+         then as fail on ATI (talk to tjl)
     benja:
        - Papers
          - P2P article and diff thesis
@@ -268,6 +270,7 @@
          colors (not "not" tests but test that the 
          color really is right)
     tjl:
+       - implement uncompressed mipzips for R300. BLECHHH!!!!
        - implement "motion-sensitive" vobs:
          GL renderables that run if used in motion, or in static frame.
          For instance, texture filtering should be adjusted: when in motion,
Index: gzz/gfx/demo/fpfont.py
diff -u gzz/gfx/demo/fpfont.py:1.11 gzz/gfx/demo/fpfont.py:1.12
--- gzz/gfx/demo/fpfont.py:1.11 Sat Jan 25 06:02:07 2003
+++ gzz/gfx/demo/fpfont.py      Sun Jan 26 16:25:58 2003
@@ -101,6 +101,15 @@
 
 END
 """),
+GL.createProgram(
+"""!!ARBfp1.0
+
+TEMP p, bp;
+MAD p, fragment.texcoord[5].w, fragment.texcoord[5].w, fragment.texcoord[0];
+TEX result.color, p, texture[0], 2D;
+
+END
+"""),
 ]
 
 dump(fp[0].getProgId())
@@ -120,7 +129,7 @@
        )
 
     def scene(self, vs):
-       putnoc(vs, background((.5,.5,.5)))
+       putnoc(vs, background((.5,.8,.5)))
 
        rot = vs.rotateCS(0, "r", self.ang)
        d = 1. / self.ps
@@ -177,7 +186,7 @@
        """ % locals()), csg)
 
         cs1 = vs.affineCS(rot, "1", 0, self.x, self.y, 
-           80, 0, 0, 80)
+           600, 0, 0, 600)
 
        if self.texfilt:
                minfilt = "LINEAR_MIPMAP_LINEAR"
Index: gzz/gfx/jni/GzzGL-jni.cxx
diff -u gzz/gfx/jni/GzzGL-jni.cxx:1.82 gzz/gfx/jni/GzzGL-jni.cxx:1.83
--- gzz/gfx/jni/GzzGL-jni.cxx:1.82      Sat Jan 25 08:45:03 2003
+++ gzz/gfx/jni/GzzGL-jni.cxx   Sun Jan 26 16:25:58 2003
@@ -527,6 +527,28 @@
      return arr;
 }
 
+JNIEXPORT void JNICALL Java_gzz_gfx_gl_GL_impl_1Texture_1getTexImage
+ (JNIEnv *env, jclass, jint id, jint level, jstring jformat, jstring jtype,
+    jbyteArray jdata) {
+    glBindTexture(GL_TEXTURE_2D, id);
+    GLenum format = tokenFromJstring(env, jformat);
+    GLenum type = tokenFromJstring(env, jtype);
+    jbyte *b = env->GetByteArrayElements(jdata, 0);
+
+    glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
+    glPixelStorei(GL_PACK_ROW_LENGTH, 0);
+    glPixelStorei(GL_PACK_ALIGNMENT, 1);
+
+    glGetTexImage(GL_TEXTURE_2D, level, format, type, b);
+
+    glPopClientAttrib();
+
+    env->ReleaseByteArrayElements(jdata, b, 0);
+    GLERR
+ }
+
+
+
 JNIEXPORT void JNICALL Java_gzz_gfx_gl_GL_impl_1Texture_1compressedTexImage
  (JNIEnv *env, jclass, jint id, jint level, jstring jinternalFormat, jint 
width, jint height,
        jint border, jbyteArray jdata) {
Index: gzz/gfx/util/texpacker.py
diff -u gzz/gfx/util/texpacker.py:1.3 gzz/gfx/util/texpacker.py:1.4
--- gzz/gfx/util/texpacker.py:1.3       Fri Jan 17 03:06:07 2003
+++ gzz/gfx/util/texpacker.py   Sun Jan 26 16:25:58 2003
@@ -11,11 +11,11 @@
 from java import io
 import gzz
 import gzz.util.dbg
+import jarray
 
 prop = System.getProperties()
 prop.setProperty("gzzclient", "gl")
 
-format = "COMPRESSED_RGB_S3TC_DXT1_EXT"
 
 from gzz.gfx.gl import GL
 from gzz.client import GraphicsAPI
@@ -33,6 +33,14 @@
     def __init__(self, texfiles):
        self.texfiles = texfiles
     def run(self):
+       global format, suffix
+
+       if GL.workaroundStupidBuggyAtiDrivers:
+           format = "RGB"
+           suffix = ".mipzipBLAH"
+       else:
+           format = "COMPRESSED_RGB_S3TC_DXT1_EXT"
+           suffix = ".mipzip"
        w = gfxapi.createWindow()
        for texfile in self.texfiles:
            self.handle(texfile)
@@ -46,11 +54,13 @@
        w = roundup2(d.width)
        h = roundup2(d.height)
        tex = GL.createTexture()
-       tex.loadNull2D(0, format, w, h, 0, "RGB", "FLOAT")
+       tex.loadNull2D(0, format, w, h, 0, "RGB", "BYTE")
        print "WH: ",w, h
        tex.loadSubImage(0, im, 0, 0, 0, 0, chomp4(d.width), chomp4(d.height))
 
-       of = texfile + ".mipzip"
+       of = texfile + suffix
+
+       print "Write ",of
 
        out = zip.ZipOutputStream(io.FileOutputStream(of)) 
 
@@ -62,10 +72,15 @@
 
        l = 0
        while 1:
-           bytes = tex.getCompressedTexImage(l)
+           w = int(tex.getLevelParameter(l, "TEXTURE_WIDTH")[0])
+           h = int(tex.getLevelParameter(l, "TEXTURE_HEIGHT")[0])
+           print "WH: ", w, h
+           if GL.workaroundStupidBuggyAtiDrivers:
+               bytes = jarray.zeros(4 * w * h, "b")
+               tex.getTexImage(l, "RGB", "BYTE", bytes)
+           else:
+               bytes = tex.getCompressedTexImage(l)
            print "Bytes: ",l, len(bytes)
-           w = tex.getLevelParameter(l, "TEXTURE_WIDTH")[0]
-           h = tex.getLevelParameter(l, "TEXTURE_HEIGHT")[0]
            entry = zip.ZipEntry(str(l))
            entry.setComment("%sx%s" % (int(w),int(h)))
            entry.setSize(len(bytes))
Index: gzz/gzz/gfx/gl/GL.java
diff -u gzz/gzz/gfx/gl/GL.java:1.45 gzz/gzz/gfx/gl/GL.java:1.46
--- gzz/gzz/gfx/gl/GL.java:1.45 Sun Jan 26 10:06:53 2003
+++ gzz/gzz/gfx/gl/GL.java      Sun Jan 26 16:25:58 2003
@@ -71,6 +71,20 @@
      * <p>
      * ATI: if you want to know what you're still doing
      * wrong, just grep the source for this variable name ;)
+     * <p>
+     * A brief list of some of the issues:
+     * <ul>
+     * <li> Loading compressed textures using glCompressedTexImage2D
+     *      does not work. VERY bad for us, need to load full
+     *      uncompressed levels from disk. Can't work around
+     *      without losing a lot of performance
+     * <li> glCopyTexImage does not obey GENERATE_MIPMAP_SGIS.
+     *      Can work around; not fun.
+     * <li> Something about our texture image copying code
+     *      makes it take it from the wrong location - 
+     *      glGet raster position?
+     * <li> pbuffers not usable on non-firegl cards
+     * </ul>
      */
     public static boolean workaroundStupidBuggyAtiDrivers = false;
 
@@ -429,6 +443,12 @@
            return impl_Texture_getCompressedTexImage(getId(), lod);
        }
 
+       public void getTexImage(int lod, String format, String type,
+                       byte[] array) {
+           impl_Texture_getTexImage(getId(), lod, format, type,
+                           array);
+       }
+
        /** Call glCompressedTexImage.
         * The length of data is used so it needs to be right.
         */
@@ -525,6 +545,8 @@
     static private native byte[] impl_Texture_getCompressedTexImage(int id, 
int lod);
     static private native void impl_Texture_compressedTexImage(int id, int 
level, String internalFormat,
                    int width, int height, int border, byte[] data);
+    static private native void impl_Texture_getTexImage(int id, 
+                   int lod, String format, String type, byte[] array) ;
 
 //--------- OpenGL Program
     /** An OpenGL program object.
Index: gzz/gzz/view/pagespanview.py
diff -u gzz/gzz/view/pagespanview.py:1.26 gzz/gzz/view/pagespanview.py:1.27
--- gzz/gzz/view/pagespanview.py:1.26   Fri Jan 24 04:09:30 2003
+++ gzz/gzz/view/pagespanview.py        Sun Jan 26 16:25:58 2003
@@ -22,7 +22,10 @@
     list = enf.getList()
     return list[0]
 
-optimizedPaper = 1
+if GL.workaroundStupidBuggyAtiDrivers:
+    optimizedPaper = 0
+else:
+    optimizedPaper = 1
 
 globalscrollblockPapers = {}
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]