[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gfx demo/paperbasis.py libpaper/texcomb_NV1...
From: |
Janne V. Kujala |
Subject: |
[Gzz-commits] gzz/gfx demo/paperbasis.py libpaper/texcomb_NV1... |
Date: |
Sat, 14 Sep 2002 06:22:28 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Janne V. Kujala <address@hidden> 02/09/14 06:22:28
Modified files:
gfx/demo : paperbasis.py
gfx/libpaper : texcomb_NV1X.py texops_STD.py
gfx/librenderables: Renderables.hxx renderables.py
Added files:
gfx/demo : clamptexture.cxx
Log message:
Create clamped, bordered versions of textures for BasisPaperQuad on
demand; mipmapping is disabled for clamped textures because I couldn't get it
to work correctly (should GL_SGIS_generate_mipmap allow reading the generated
lower LOD texture images?); there is still the problem of choosing the texture
color outside the clamped box so that the something is visible when the two
textures do not overlap
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/clamptexture.cxx?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/paperbasis.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/texcomb_NV1X.py.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/texops_STD.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/Renderables.hxx.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
Patches:
Index: gzz/gfx/demo/paperbasis.py
diff -c gzz/gfx/demo/paperbasis.py:1.1 gzz/gfx/demo/paperbasis.py:1.2
*** gzz/gfx/demo/paperbasis.py:1.1 Fri Sep 13 09:40:59 2002
--- gzz/gfx/demo/paperbasis.py Sat Sep 14 06:22:28 2002
***************
*** 19,25 ****
def getpaper(seed):
global basisclamp
- basisclamp = 1
pap = ThePaperMill().getPaper(seed, passmask=passmask)
return GZZGL.createBasisPaperQuad(pap)
--- 19,24 ----
Index: gzz/gfx/libpaper/texcomb_NV1X.py
diff -c gzz/gfx/libpaper/texcomb_NV1X.py:1.10
gzz/gfx/libpaper/texcomb_NV1X.py:1.11
*** gzz/gfx/libpaper/texcomb_NV1X.py:1.10 Tue Sep 10 14:53:19 2002
--- gzz/gfx/libpaper/texcomb_NV1X.py Sat Sep 14 06:22:28 2002
***************
*** 129,135 ****
else:
# Interpolate between three colors:
# d0 = t0 . r0
! # d1 = r1 . r1
# lerp(d1, lerp(d0, c0, c1), c2)
# The alpha value is computed as d0^2 - d1^2
--- 129,135 ----
else:
# Interpolate between three colors:
# d0 = t0 . r0
! # d1 = t1 . r1
# lerp(d1, lerp(d0, c0, c1), c2)
# The alpha value is computed as d0^2 - d1^2
Index: gzz/gfx/libpaper/texops_STD.py
diff -c gzz/gfx/libpaper/texops_STD.py:1.2 gzz/gfx/libpaper/texops_STD.py:1.3
*** gzz/gfx/libpaper/texops_STD.py:1.2 Fri Sep 13 09:40:59 2002
--- gzz/gfx/libpaper/texops_STD.py Sat Sep 14 06:22:28 2002
***************
*** 9,17 ****
],
];
- if "basisclamp" not in globals().keys():
- basisclamp = 0
-
class ShaderPass:
def __init__(self, shaderType):
self.st = shaderType
--- 9,14 ----
***************
*** 26,36 ****
return [i for i in range(0,len(self.st))]
def setupCode(self):
c = ""
- if basisclamp:
- print "Clamping texture"
- wrap = "CLAMP"
- else:
- wrap = "REPEAT"
for t in range(0,len(self.st)):
target = self.st[t][0]
texid = self.tex[t]
--- 23,28 ----
***************
*** 45,52 ****
Enable %(target)s
BindTexture %(target)s %(texid)s
! TexParameter %(target)s TEXTURE_WRAP_S %(wrap)s
! TexParameter %(target)s TEXTURE_WRAP_T %(wrap)s
TexParameter %(target)s TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
TexParameter %(target)s TEXTURE_MAG_FILTER LINEAR
--- 37,44 ----
Enable %(target)s
BindTexture %(target)s %(texid)s
! TexParameter %(target)s TEXTURE_WRAP_S REPEAT
! TexParameter %(target)s TEXTURE_WRAP_T REPEAT
TexParameter %(target)s TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
TexParameter %(target)s TEXTURE_MAG_FILTER LINEAR
Index: gzz/gfx/librenderables/Renderables.hxx
diff -c gzz/gfx/librenderables/Renderables.hxx:1.8
gzz/gfx/librenderables/Renderables.hxx:1.9
*** gzz/gfx/librenderables/Renderables.hxx:1.8 Wed Sep 4 08:48:09 2002
--- gzz/gfx/librenderables/Renderables.hxx Sat Sep 14 06:22:28 2002
***************
*** 14,19 ****
--- 14,21 ----
#include "libcolor/spaces.hxx"
#include "libtext/Text.hxx"
+ #include <map> // XXX: used by ../demo/clamptexture.cxx hack
+
#define GLERR { int er = glGetError(); if(er != GL_NO_ERROR) \
cout << "===== OPENGL ERROR "<<__FILE__<<" "<<__LINE__ \
<<" "<<gluErrorString(er)<<"\n"; \
Index: gzz/gfx/librenderables/renderables.py
diff -c gzz/gfx/librenderables/renderables.py:1.25
gzz/gfx/librenderables/renderables.py:1.26
*** gzz/gfx/librenderables/renderables.py:1.25 Fri Sep 13 09:40:59 2002
--- gzz/gfx/librenderables/renderables.py Sat Sep 14 06:22:28 2002
***************
*** 521,526 ****
--- 521,529 ----
"ParamCode" : """
this->paper = paper;
""",
+ "ExtraClass" : """
+ #include "../demo/clamptexture.cxx"
+ """,
"RenderCode" : """
DBG(dbg) << "Paper\\n";
GLERR
***************
*** 548,553 ****
--- 551,561 ----
(*it).setupcode();
GLERR
+
+ glActiveTexture(GL_TEXTURE1);
+ clampTexture2D(1.0);
+ glActiveTexture(GL_TEXTURE0);
+ clampTexture2D(1.0);
Pt p[] = { Pt(0,0), Pt(0,1), Pt(1,1), Pt(1,0) };
- [Gzz-commits] gzz/gfx demo/paperbasis.py libpaper/texcomb_NV1...,
Janne V. Kujala <=