gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gfx demo/texturelab.py libtexture/filereade...


From: Janne V. Kujala
Subject: [Gzz-commits] gzz/gfx demo/texturelab.py libtexture/filereade...
Date: Fri, 30 Aug 2002 07:14:29 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Janne V. Kujala <address@hidden>        02/08/30 07:14:28

Modified files:
        gfx/demo       : texturelab.py 
        gfx/libtexture : filereader.texture rd1.texture 

Log message:
        Use rd texture

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/texturelab.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libtexture/filereader.texture.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libtexture/rd1.texture.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gzz/gfx/demo/texturelab.py
diff -c gzz/gfx/demo/texturelab.py:1.3 gzz/gfx/demo/texturelab.py:1.4
*** gzz/gfx/demo/texturelab.py:1.3      Fri Aug 30 06:33:30 2002
--- gzz/gfx/demo/texturelab.py  Fri Aug 30 07:14:28 2002
***************
*** 13,26 ****
  
  class ShaderScene:
      def __init__(self):
!       self.resolution = [32, 64]
!       self.shadername = "noise"
        self.shaderparams = {
            "bulgemagz": 0.5,
            "bulgemagx": 0,
            "lfreq": 2,
            "hfreq": 10,
!           "bias": 0.1,
        }
        self.colors = [ (1, 1, 1), (1, 0, 0), (0, 1, 0), (0, 0, 1)]
        self.shadercomps = 3
--- 13,28 ----
  
  class ShaderScene:
      def __init__(self):
!       self.resolution = [64, 64]
!       self.shadername = "filereader"
        self.shaderparams = {
            "bulgemagz": 0.5,
            "bulgemagx": 0,
            "lfreq": 2,
            "hfreq": 10,
!           "bias": -3,
!             "scale": 10,
!             "file": "lava/gfx/map3d.dat"
        }
        self.colors = [ (1, 1, 1), (1, 0, 0), (0, 1, 0), (0, 0, 1)]
        self.shadercomps = 3
***************
*** 31,37 ****
        self.shade()
      def key(self, k):
        if k == "s":
!           self.shade()
            AbstractUpdateManager.setNoAnimation()
        if k == "c":
            rotate(self.colors)
--- 33,40 ----
        self.shade()
      def key(self, k):
        if k == "s":
!           retexture()
!             self.shade()
            AbstractUpdateManager.setNoAnimation()
        if k == "c":
            rotate(self.colors)
***************
*** 82,87 ****
--- 85,91 ----
            getDList("""
                Color %(color)s
                BindTexture TEXTURE_3D %(tex)s
+                 TexParameter TEXTURE_3D TEXTURE_MAG_FILTER LINEAR
                Enable TEXTURE_3D
                Begin QUAD_STRIP
                    TexCoord 1.1 1.1 0
***************
*** 97,103 ****
                "tex" : self.texture.getTexId(),
                "color" : js(self.colors[0]),
                }),
!           "v", 10, 0, 0, 200, 200)
  
        putnoc(vs, getDList("""
            PopAttrib
--- 101,107 ----
                "tex" : self.texture.getTexId(),
                "color" : js(self.colors[0]),
                }),
!           "v", 10, 0, 0, 900, 900)
  
        putnoc(vs, getDList("""
            PopAttrib
Index: gzz/gfx/libtexture/filereader.texture
diff -c gzz/gfx/libtexture/filereader.texture:1.1 
gzz/gfx/libtexture/filereader.texture:1.2
*** gzz/gfx/libtexture/filereader.texture:1.1   Fri Aug 30 06:31:00 2002
--- gzz/gfx/libtexture/filereader.texture       Fri Aug 30 07:14:28 2002
***************
*** 5,10 ****
--- 5,13 ----
  
  void GENERATE(TextureParam *params, int width, int height, int depth, int 
components, float *data) {
  
+   FPARAM(scale, 1.0);
+   FPARAM(bias, 0);
+ 
    const char *file = params->getString("file", "");
    FILE *f = fopen(file, "r");
    if (!f) {
***************
*** 39,48 ****
            j < y || j >= y + height ||
            k < z || k >= z + depth) continue;
  
!       if (components >= 1) data[ind++] = foo[0%c];
!       if (components >= 2) data[ind++] = foo[1%c];
!         if (components >= 3) data[ind++] = foo[2%c];
!         if (components >= 4) data[ind++] = foo[3%c];
        }
      }
    }
--- 42,51 ----
            j < y || j >= y + height ||
            k < z || k >= z + depth) continue;
  
!       if (components >= 1) data[ind++] = scale*foo[0%c]+bias;
!       if (components >= 2) data[ind++] = scale*foo[1%c]+bias;
!         if (components >= 3) data[ind++] = scale*foo[2%c]+bias;
!         if (components >= 4) data[ind++] = scale*foo[3%c]+bias;
        }
      }
    }
Index: gzz/gfx/libtexture/rd1.texture
diff -c gzz/gfx/libtexture/rd1.texture:1.2 gzz/gfx/libtexture/rd1.texture:1.3
*** gzz/gfx/libtexture/rd1.texture:1.2  Thu Aug 22 11:11:56 2002
--- gzz/gfx/libtexture/rd1.texture      Fri Aug 30 07:14:28 2002
***************
*** 65,71 ****
  #else
  #define laplacian(a) 1./3*(a[i-line-1]+a[i-line]+a[i-line+1]+ \
                           a[i-1]   -8*a[i]     +a[i+1]+ \
!                          a[i+line-1]+a[i+line]+a[i+line+1])/(eps*eps)
  #endif
  
        for (int i = line; i < n-line; i++) {
--- 65,71 ----
  #else
  #define laplacian(a) 1./3*(a[i-line-1]+a[i-line]+a[i-line+1]+ \
                           a[i-1]   -8*a[i]     +a[i+1]+ \
!                          a[i+line-1]+a[i+line]+a[i+line+1])
  #endif
  
        for (int i = line; i < n-line; i++) {




reply via email to

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