[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gfx/libpaper textures.py
From: |
Janne V. Kujala |
Subject: |
[Gzz-commits] gzz/gfx/libpaper textures.py |
Date: |
Tue, 15 Oct 2002 07:36:33 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Janne V. Kujala <address@hidden> 02/10/15 07:36:33
Modified files:
gfx/libpaper : textures.py
Log message:
Add the old DOT2 type textures
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/textures.py.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
Patches:
Index: gzz/gfx/libpaper/textures.py
diff -c gzz/gfx/libpaper/textures.py:1.25 gzz/gfx/libpaper/textures.py:1.26
*** gzz/gfx/libpaper/textures.py:1.25 Fri Oct 11 06:37:58 2002
--- gzz/gfx/libpaper/textures.py Tue Oct 15 07:36:33 2002
***************
*** 28,48 ****
# Update from specified values
self.__dict__.update(dict)
!
! print "Generating texture: ", self.name, self.args
! self.texture = getCachedTexture(self.args)
def getTexId(self):
return self.texture.getTexId()
def getName(self):
return self.name
- tres = 128
initialized = 0
def init():
global initialized
initialized = 1
global ptextures
ptextures["RGB2"] = map(NamedTexture, filter(lambda dict: dict["name"] in
[
"rgbw1",
"rgbw2",
--- 28,56 ----
# Update from specified values
self.__dict__.update(dict)
!
! # Generate textures lazily
! if 0:
! print "Generating texture: ", self.name, self.args
! self.texture = getCachedTexture(self.args)
!
def getTexId(self):
+ if not hasattr(self, "texture"):
+ print "Generating texture: ", self.name, self.args
+ self.texture = getCachedTexture(self.args)
return self.texture.getTexId()
+
def getName(self):
return self.name
initialized = 0
def init():
global initialized
initialized = 1
global ptextures
+
+ tres = 128
ptextures["RGB2"] = map(NamedTexture, filter(lambda dict: dict["name"] in
[
"rgbw1",
"rgbw2",
***************
*** 130,135 ****
--- 138,165 ----
"magfilter" : "NEAREST",
},
]))
+
+ ptextures["DOT2"] = map(NamedTexture, [
+ { "name" : "dotprodn",
+ "args" : [512, 512, 0, 2,
+ "SIGNED_HILO_NV", "HILO_NV", # XXX signed
+ "noise", ["type", "normal", "freq", "10", "scale", "0.1"]]
+ },
+
+ { "name" : "dotprodt",
+ "args" : [512, 512, 0, 2,
+ "SIGNED_HILO_NV", "HILO_NV", # XXX signed
+ "noise", ["type", "turbulence", "freq", "40"]] },
+
+ { "name" : "dotprodw",
+ "args" : [512, 512, 0, 2,
+ "SIGNED_HILO_NV", "HILO_NV", # XXX signed
+ "waves", ["abs", "1", "freq0", "2", "freq1", "3"]],
+ },
+ #("dotprodrd", [128, 128, 0, 2,
+ # "SIGNED_HILO_NV", "HILO_NV", # XXX signed
+ # "rd1", ["iter", "3000", "F", ".04", "k",
".06"]]),
+ ])
def getPaperTexture(type, gen):
return selectRandom(ptextures[type], gen)
***************
*** 180,200 ****
return [ self.getPaperTexture(type, gen) for type in types ]
if 0:
- rgbTextures = [
- #("debug", [512, 512, 0, 3,
- # "RGB", "RGB",
- # "debuggrid", []]),
- ("rgbn", [512, 512, 0, 3,
- "RGB", "RGB",
- "noise", ["type", "normal", "freq", "20", "bias",
"0.5"]]),
- ("rgbl", [512, 512, 0, 3,
- "RGB", "RGB",
- "lines1", ["linewidth", "0.1"]]),
- ("rgbw", [512, 512, 0, 3,
- "RGB", "RGB",
- "waves", ["abs", "1", "freq0", "1", "freq1", "1"]]),
- ]
-
rgb3DTextures = [
("rgbw", [64, 64, 64, 1,
"LUMINANCE", "LUMINANCE",
--- 210,215 ----
***************
*** 205,228 ****
]
- dotTextures = [
- ("dotprodn", [512, 512, 0, 2,
- "SIGNED_HILO_NV", "HILO_NV", # XXX signed
- "noise", ["type", "normal", "freq", "10",
"scale", "0.1"]]),
- ("dotprodt", [512, 512, 0, 2,
- "SIGNED_HILO_NV", "HILO_NV", # XXX signed
- "noise", ["type", "turbulence", "freq", "40"]]),
- ("dotprodw", [512, 512, 0, 2,
- "SIGNED_HILO_NV", "HILO_NV", # XXX signed
- "waves", ["abs", "1", "freq0", "2", "freq1",
"3"]]),
- #("dotprodrd", [128, 128, 0, 2,
- # "SIGNED_HILO_NV", "HILO_NV", # XXX signed
- # "rd1", ["iter", "3000", "F", ".04", "k",
".06"]]),
- ]
-
- self.textures = {
- #"R2": [ NamedTexture(name, args) for (name, args) in
rgbTextures ],
- "R3": [ NamedTexture(name, args) for (name, args) in
rgb3DTextures ],
- #"D2": [ NamedTexture(name, args) for (name, args) in
dotTextures ],
- }
-
--- 220,222 ----