fenfire-commits
[Top][All Lists]
Advanced

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

[ff-cvs] libvob/vob/putil effects.py


From: Janne V. Kujala
Subject: [ff-cvs] libvob/vob/putil effects.py
Date: Thu, 28 Aug 2003 07:12:06 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Janne V. Kujala <address@hidden>        03/08/28 07:12:06

Modified files:
        vob/putil      : effects.py 

Log message:
        OpenGL 1.2 irregu ellipse implementation

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/putil/effects.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

Patches:
Index: libvob/vob/putil/effects.py
diff -u libvob/vob/putil/effects.py:1.4 libvob/vob/putil/effects.py:1.5
--- libvob/vob/putil/effects.py:1.4     Sat Aug 16 08:22:24 2003
+++ libvob/vob/putil/effects.py Thu Aug 28 07:12:05 2003
@@ -54,7 +54,10 @@
                                         "eps", ".250",
                                         "scaling", "const"]],
                             shade_all_levels = 1)
-
+    tex3 = getCachedTexture([256, 256, 0, 1, "INTENSITY", "LUMINANCE",
+                             "irregu", ["ripple_scale", str(ripple_scale),
+                                        ]],
+                            shade_all_levels = 1)
     if dbg: print "done"
 
     boxtex = GL.createTexture()
@@ -150,6 +153,23 @@
                 Color 0 0 0 1
         """) % {"tex" : self.tex2.getTexId(),
                 "color" : vob.util.ColorUtil.colorGLString(color)}
+
+        def code3(color):
+            return parseCombiner("""
+                PushAttrib ENABLE_BIT TEXTURE_BIT CURRENT_BIT COLOR_BUFFER_BIT
+
+                BindTexture TEXTURE_2D %(tex)s
+                TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
+                TexParameter TEXTURE_2D TEXTURE_MAG_FILTER LINEAR
+                Enable TEXTURE_2D
+                TexEnv TEXTURE_ENV TEXTURE_ENV_MODE ADD
+
+                Enable ALPHA_TEST
+                AlphaFunc GEQUAL 1.0
+
+        """) % {"tex" : self.tex3.getTexId(),
+                "color" : vob.util.ColorUtil.colorGLString(color)}
+        
         
         if type == "square":
             self._content = GLRen.createIrregularQuad(
@@ -179,23 +199,46 @@
             INSIDE        = 128;
             SHIFTS8       = 256;
 
-            self._content = GLRen.createIrregularEdge(
-                8, texscale, 2.0, 128, 0,
-                -1 * ripple_scale * texscale,
-                0 * ripple_scale * texscale,
-                0, "1 1 1 1 0 0 0 0", "", 3, 0, 
-                SLICE_1D + Y_SECCOLOR + INSIDE,
-                code2(contentColor),
-                1.0)
-
-            self._frame = GLRen.createIrregularEdge(
-                8, texscale, 2.0, 128, 0,
-                -1 * ripple_scale * texscale,
-                0 * ripple_scale * texscale,
-                0, "1 1 1 1 0 0 0 0", "", 3, 0, 
-                SLICE_1D + Y_SECCOLOR + DOTVEC_COLOR + INTERP_DOTVEC,
-                code2(frameColor),
-                1.0)
+            if GL.hasExtension("GL_NV_register_combiners"):
+                self._content = GLRen.createIrregularEdge(
+                    8, texscale, 2.0, 128, 0,
+                    -1 * ripple_scale * texscale,
+                    0 * ripple_scale * texscale,
+                    0, "1 1 1 1 0 0 0 0", "", 3, 0, 
+                    SLICE_1D + Y_SECCOLOR + INSIDE,
+                    code2(contentColor),
+                    1.0)
+                
+                self._frame = GLRen.createIrregularEdge(
+                    8, texscale, 2.0, 128, 0,
+                    -1 * ripple_scale * texscale,
+                    0 * ripple_scale * texscale,
+                    0, "1 1 1 1 0 0 0 0", "", 3, 0, 
+                    SLICE_1D + Y_SECCOLOR + DOTVEC_COLOR + INTERP_DOTVEC,
+                    code2(frameColor),
+                    1.0)
+            else:
+                self._content = GLRen.createIrregularEdge(
+                    8, texscale, 2.0, 128, 0,
+                    -1 * ripple_scale * texscale,
+                    0 * ripple_scale * texscale,
+                    0, "1 1 1 1 0 0 0 0", "", 0, 0, 
+                    SLICE_1D + Y_COLOR + INSIDE,
+                    code3(contentColor),
+                    1.0)
+                
+                self._frame = GLRen.createIrregularEdge(
+                    8, texscale, 2.0, 128, 0,
+                    -1 * ripple_scale * texscale,
+                    0 * ripple_scale * texscale,
+                    0, "1 1 1 1 0 0 0 0", "", 0, 0, 
+                    SLICE_1D + Y_COLOR + SHIFTS,
+                    code3(frameColor) +
+                    """
+                    BlendFunc ZERO ZERO
+                    Enable BLEND
+                    """
+                    , 1.0)
 
     def getContent(self): return self._content
     def getFrame(self): return self._frame




reply via email to

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