[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gfx libcallgl/callgl.cxx libpaper/papermill...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz/gfx libcallgl/callgl.cxx libpaper/papermill... |
Date: |
Tue, 03 Sep 2002 06:14:47 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/09/03 06:14:47
Modified files:
gfx/libcallgl : callgl.cxx
gfx/libpaper : papermill.py texcomb_NV1X.py
gfx/libtexture : noise.texture
Log message:
Paper textures on NV1X
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcallgl/callgl.cxx.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/papermill.py.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/texcomb_NV1X.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libtexture/noise.texture.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: gzz/gfx/libcallgl/callgl.cxx
diff -c gzz/gfx/libcallgl/callgl.cxx:1.6 gzz/gfx/libcallgl/callgl.cxx:1.7
*** gzz/gfx/libcallgl/callgl.cxx:1.6 Mon Aug 26 05:38:31 2002
--- gzz/gfx/libcallgl/callgl.cxx Tue Sep 3 06:14:47 2002
***************
*** 72,77 ****
--- 72,80 ----
(!extra_args && v.size()-1 > numargs)) {
cerr << "Illegal number of arguments to " << v[0] << ": expected "
<< numargs << ", got " << v.size()-1 << "\n";
+ for(unsigned i=0; i<v.size(); i++)
+ cerr << v[i] << " ";
+ cerr <<"\n";
return false;
}
return true;
***************
*** 126,131 ****
--- 129,143 ----
} else if (checkfunc(v, "BlendColor", 4)) {
glBlendColor(atof(v[1].c_str()), atof(v[2].c_str()),
atof(v[3].c_str()), atof(v[4].c_str()));
+ } else if (checkfunc(v, "SecondaryColorEXT", 3)) {
+ #ifdef GL_EXT_secondary_color
+ glSecondaryColor3dEXT(atof(v[1].c_str()), atof(v[2].c_str()),
+ atof(v[3].c_str()));
+ #else
+ cerr << "Warning: SecondaryColorEXT attempted but support\n"
+ "was not compiled in because GL_EXT_secondary_color\n"
+ "was not defined!!!\n";
+ #endif
} else if (checkfunc(v, "Fog", 2, true)) {
if (v.size() > 3) {
vector<GLfloat> params = getfv(v, 2, 4);
Index: gzz/gfx/libpaper/papermill.py
diff -c gzz/gfx/libpaper/papermill.py:1.19 gzz/gfx/libpaper/papermill.py:1.20
*** gzz/gfx/libpaper/papermill.py:1.19 Mon Sep 2 12:14:33 2002
--- gzz/gfx/libpaper/papermill.py Tue Sep 3 06:14:47 2002
***************
*** 43,51 ****
# We have at least a NV10, possibly better.
# Check the number of general combiners to be sure.
maxcomb = GZZGL.getGLFloat("MAX_GENERAL_COMBINERS_NV")[0]
! if maxcomb < 2:
! assert 0, "Sorry, not sufficient register combiners (%s)"%maxcomb
! elif maxcomb < 4:
# use NV10 version
if dbg: print "Using NV10 combiners ",maxcomb
files.append("texcomb_NV1X.py")
--- 43,49 ----
# We have at least a NV10, possibly better.
# Check the number of general combiners to be sure.
maxcomb = GZZGL.getGLFloat("MAX_GENERAL_COMBINERS_NV")[0]
! if maxcomb < 4:
# use NV10 version
if dbg: print "Using NV10 combiners ",maxcomb
files.append("texcomb_NV1X.py")
Index: gzz/gfx/libpaper/texcomb_NV1X.py
diff -c gzz/gfx/libpaper/texcomb_NV1X.py:1.2
gzz/gfx/libpaper/texcomb_NV1X.py:1.3
*** gzz/gfx/libpaper/texcomb_NV1X.py:1.2 Mon Sep 2 12:14:33 2002
--- gzz/gfx/libpaper/texcomb_NV1X.py Tue Sep 3 06:14:47 2002
***************
*** 1,4 ****
! # Register combiners for NV2x architecture, where there
# are only two of them.
class TransparentCombinerPass:
--- 1,4 ----
! # Register combiners for NV1x architecture, where there
# are only two of them.
class TransparentCombinerPass:
***************
*** 38,46 ****
while len(texinputs) < 4:
texinputs = texinputs + texinputs
t0, t1, t2, t3 = texinputs[0:4]
! c = """
Enable BLEND
! BlendFunc ONE ZERO
Disable ALPHA_TEST
Enable REGISTER_COMBINERS_NV
--- 38,47 ----
while len(texinputs) < 4:
texinputs = texinputs + texinputs
t0, t1, t2, t3 = texinputs[0:4]
! c = ("""
Enable BLEND
! BlendFunc ONE ONE
! BlendEquation MIN
Disable ALPHA_TEST
Enable REGISTER_COMBINERS_NV
***************
*** 48,83 ****
CombinerParameterNV CONSTANT_COLOR0_NV %(r0)s
CombinerParameterNV CONSTANT_COLOR1_NV %(r1)s
! Color %(r2)s
!
! CombinerInputNV COMBINER0_NV RGB VARIABLE_A_NV TEXTURE%(t0)s
EXPAND_NORMAL_NV RGB
! CombinerInputNV COMBINER0_NV RGB VARIABLE_B_NV TEXTURE%(t1)s
EXPAND_NORMAL_NV RGB
! CombinerInputNV COMBINER0_NV RGB VARIABLE_C_NV CONSTANT_COLOR0_NV
EXPAND_NORMAL_NV RGB
! CombinerInputNV COMBINER0_NV RGB VARIABLE_D_NV TEXTURE%(t2)s
EXPAND_NORMAL_NV RGB
CombinerOutputNV COMBINER0_NV RGB SPARE0_NV SPARE1_NV DISCARD_NV
SCALE_BY_TWO_NV NONE TRUE TRUE FALSE
! CombinerInputNV COMBINER1_NV RGB VARIABLE_A_NV CONSTANT_COLOR1_NV
UNSIGNED_IDENTITY_NV RGB
! CombinerInputNV COMBINER1_NV RGB VARIABLE_B_NV SPARE0_NV
UNSIGNED_IDENTITY_NV RGB
! CombinerInputNV COMBINER1_NV RGB VARIABLE_C_NV CONSTANT_COLOR1_NV
UNSIGNED_IDENTITY_NV RGB
! CombinerInputNV COMBINER1_NV RGB VARIABLE_D_NV SPARE0_NV
UNSIGNED_INVERT_NV RGB
! CombinerOutputNV COMBINER1_NV RGB PRIMARY_COLOR_NV
SECONDARY_COLOR_NV DISCARD_NV SCALE_BY_TWO_NV NONE TRUE TRUE FALSE
!
! FinalCombinerInputNV VARIABLE_A_NV PRIMARY_COLOR_NV
UNSIGNED_IDENTITY_NV RGB
! FinalCombinerInputNV VARIABLE_B_NV SPARE0_NV UNSIGNED_IDENTITY_NV
RGB
! FinalCombinerInputNV VARIABLE_C_NV SPARE1_NV UNSIGNED_IDENTITY_NV
RGB
! FinalCombinerInputNV VARIABLE_D_NV ZERO UNSIGNED_IDENTITY_NV RGB
!
! CombinerInputNV COMBINER0_NV ALPHA VARIABLE_A_NV CONSTANT_COLOR0_NV
UNSIGNED_IDENTITY_NV ALPHA
! CombinerInputNV COMBINER0_NV ALPHA VARIABLE_B_NV SECONDARY_COLOR_NV
UNSIGNED_INVERT_NV BLUE
CombinerOutputNV COMBINER0_NV ALPHA SPARE0_NV DISCARD_NV DISCARD_NV
SCALE_BY_FOUR_NV NONE FALSE FALSE FALSE
- CombinerInputNV COMBINER1_NV ALPHA VARIABLE_A_NV ZERO
UNSIGNED_INVERT_NV ALPHA
- CombinerInputNV COMBINER1_NV ALPHA VARIABLE_B_NV SPARE0_NV
SIGNED_IDENTITY_NV ALPHA
- CombinerOutputNV COMBINER1_NV ALPHA SPARE0_NV DISCARD_NV DISCARD_NV
SCALE_BY_FOUR_NV NONE FALSE FALSE FALSE
- FinalCombinerInputNV VARIABLE_G_NV SPARE0_NV UNSIGNED_INVERT_NV
ALPHA
! """ % locals()
return c
--- 49,104 ----
CombinerParameterNV CONSTANT_COLOR0_NV %(r0)s
CombinerParameterNV CONSTANT_COLOR1_NV %(r1)s
! Color %(c0)s
! SecondaryColorEXT %(c1)s
! Fog FOG_COLOR %(c2)s
!
! """+
! # Stage 0: calculate dot products of the textures, and of
! # a texture times a constant.
! """
! CI0 RGB VARIABLE_A_NV TEXTURE%(t0)s EXPAND_NORMAL_NV RGB
! CI0 RGB VARIABLE_B_NV TEXTURE%(t1)s EXPAND_NORMAL_NV RGB
! CI0 RGB VARIABLE_C_NV CONSTANT_COLOR0_NV EXPAND_NORMAL_NV RGB
! CI0 RGB VARIABLE_D_NV TEXTURE%(t2)s EXPAND_NORMAL_NV RGB
CombinerOutputNV COMBINER0_NV RGB SPARE0_NV SPARE1_NV DISCARD_NV
SCALE_BY_TWO_NV NONE TRUE TRUE FALSE
! CI0 ALPHA VARIABLE_A_NV TEXTURE%(t0)s EXPAND_NORMAL_NV BLUE
! CI0 ALPHA VARIABLE_B_NV TEXTURE%(t1)s EXPAND_NORMAL_NV BLUE
! CI0 ALPHA VARIABLE_C_NV TEXTURE%(t0)s EXPAND_NORMAL_NV ALPHA
! CI0 ALPHA VARIABLE_D_NV TEXTURE%(t1)s EXPAND_NORMAL_NV ALPHA
CombinerOutputNV COMBINER0_NV ALPHA SPARE0_NV DISCARD_NV DISCARD_NV
SCALE_BY_FOUR_NV NONE FALSE FALSE FALSE
! """+
! # Stage 1: mix primary and secondary as determined
! # by the dot product above.
! """
! CI1 RGB VARIABLE_A_NV PRIMARY_COLOR_NV UNSIGNED_IDENTITY_NV RGB
! CI1 RGB VARIABLE_B_NV SPARE0_NV UNSIGNED_IDENTITY_NV RGB
! CI1 RGB VARIABLE_C_NV SECONDARY_COLOR_NV UNSIGNED_IDENTITY_NV RGB
! CI1 RGB VARIABLE_D_NV SPARE0_NV UNSIGNED_INVERT_NV RGB
! CombinerOutputNV COMBINER1_NV RGB DISCARD_NV DISCARD_NV
PRIMARY_COLOR_NV NONE NONE FALSE FALSE FALSE
!
! CI1 ALPHA VARIABLE_A_NV SPARE0_NV UNSIGNED_INVERT_NV BLUE
! CI1 ALPHA VARIABLE_B_NV SPARE0_NV SIGNED_IDENTITY_NV ALPHA
! CombinerOutputNV COMBINER1_NV ALPHA SPARE0_NV DISCARD_NV DISCARD_NV
SCALE_BY_FOUR_NV NONE FALSE FALSE FALSE
!
! """+
! """
! FCI VARIABLE_A_NV SPARE1_NV UNSIGNED_IDENTITY_NV RGB
! FCI VARIABLE_B_NV PRIMARY_COLOR_NV UNSIGNED_IDENTITY_NV RGB
! FCI VARIABLE_C_NV FOG UNSIGNED_IDENTITY_NV RGB
! FCI VARIABLE_D_NV ZERO UNSIGNED_IDENTITY_NV RGB
!
! FCI VARIABLE_G_NV SPARE0_NV UNSIGNED_INVERT_NV ALPHA
!
! """) % locals()
! c = (c.replace("CI0", "CombinerInputNV COMBINER0_NV").
! replace("CI1", "CombinerInputNV COMBINER1_NV").
! replace("FCI", "FinalCombinerInputNV"))
! print "c: ",c
return c
Index: gzz/gfx/libtexture/noise.texture
diff -c gzz/gfx/libtexture/noise.texture:1.1
gzz/gfx/libtexture/noise.texture:1.2
*** gzz/gfx/libtexture/noise.texture:1.1 Wed Aug 7 06:24:00 2002
--- gzz/gfx/libtexture/noise.texture Tue Sep 3 06:14:47 2002
***************
*** 187,189 ****
--- 187,191 ----
}
}
}
+
+ // vim: set syntax=c :
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz/gfx libcallgl/callgl.cxx libpaper/papermill...,
Tuomas J. Lukka <=