[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gfx/demo/opengl fragprog.py
From: |
Janne V. Kujala |
Subject: |
[Gzz-commits] gzz/gfx/demo/opengl fragprog.py |
Date: |
Fri, 24 Jan 2003 07:01:22 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Janne V. Kujala <address@hidden> 03/01/24 07:01:22
Modified files:
gfx/demo/opengl: fragprog.py
Log message:
more fragprog
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/opengl/fragprog.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: gzz/gfx/demo/opengl/fragprog.py
diff -u gzz/gfx/demo/opengl/fragprog.py:1.1 gzz/gfx/demo/opengl/fragprog.py:1.2
--- gzz/gfx/demo/opengl/fragprog.py:1.1 Fri Jan 24 06:20:16 2003
+++ gzz/gfx/demo/opengl/fragprog.py Fri Jan 24 07:01:22 2003
@@ -1,22 +1,36 @@
+if globals().has_key("fp"):
+ fp.deleteObject()
-
-class Scene:
- def __init__(self):
- self.fp = GL.createProgram("""!!ARBfp1.0
+fp = GL.createProgram("""!!ARBfp1.0
# No texture instructions, but always 1 indirection
- MOV result.color, fragment.color;
+ #MOV result.color, fragment.color;
+
+ PARAM col = { 50, .5, 1, 1 };
+ TEMP x;
+ MUL x.x, fragment.position.x, col.x;
+ MUL x.y, fragment.position.y, col.x;
+ SIN x.x, x.x;
+ COS x.y, x.y;
+
+ MOV x.zw, col;
+ MOV result.color, x;
END
""")
+class Scene:
+ def __init__(self):
+ self.x = 512
+ self.y = 384
+
def scene(self, vs):
putnoc(vs, background((.5,.5,.5)))
- cs1 = vs.coords.affineCoordsys(0, 0, 512, 384,
+ cs1 = vs.coords.affineCoordsys(0, 0, self.x, self.y,
256, 0, 0, 256)
vs.matcher.add(cs1, "1")
vs.map.put(getDList("""
- BindProgramNV FRAGMENT_PROGRAM_ARB %s
+ BindProgramARB FRAGMENT_PROGRAM_ARB %s
Enable FRAGMENT_PROGRAM_ARB
Color 1 1 1
Begin QUAD_STRIP
@@ -26,6 +40,9 @@
Vertex 1 1
End
Disable FRAGMENT_PROGRAM_ARB
- """ % self.fp.getProgId()), cs1)
+ """ % fp.getProgId()), cs1)
+
+ def key(self,k):
+ pass
currentScene = Scene()