[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gfx/demo irregu3.py
From: |
Janne V. Kujala |
Subject: |
[Gzz-commits] gzz/gfx/demo irregu3.py |
Date: |
Wed, 30 Oct 2002 10:42:39 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Janne V. Kujala <address@hidden> 02/10/30 10:42:39
Modified files:
gfx/demo : irregu3.py
Log message:
Start NV30 fragment program profile
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/irregu3.py.diff?tr1=1.34&tr2=1.35&r1=text&r2=text
Patches:
Index: gzz/gfx/demo/irregu3.py
diff -u gzz/gfx/demo/irregu3.py:1.34 gzz/gfx/demo/irregu3.py:1.35
--- gzz/gfx/demo/irregu3.py:1.34 Tue Oct 29 12:36:53 2002
+++ gzz/gfx/demo/irregu3.py Wed Oct 30 10:42:39 2002
@@ -17,6 +17,9 @@
profiles = []
+if (GL.hasExtension("GL_NV_fragment_program")):
+ profiles.append("NV_PROG")
+
if (GL.hasExtension("GL_NV_texture_shader")):
profiles.append("NV_SHAD")
@@ -58,6 +61,40 @@
using_shader = 0
using_secondary_color = 0
using_multitex = 0
+
+ if profile == "NV_PROG":
+ code = """!FP1.0;
+ # Compute one pixel difference of texcoords in R0
+ DDX R0, f[TEX0];
+ DDY R1, f[TEX0];
+ MUL R0, R0, R0;
+ MAD R0, R1, R1;
+ RSQ R1.x, R0.x;
+ RSQ R1.y, R0.y;
+ MUL R0, R1;
+
+ # Compute texcoord +/- 1 pixel
+ ADD R1, f[TEX0], R0;
+ ADD R2, f[TEX0], -R0;
+
+ # Compute texcoord +/- 2 pixels
+ ADD R3, R1, R0;
+ ADD R4, R2, -R0;
+
+ # Read texture
+ TEX R0, R0, TEX0, 2D;
+ TEX R1, R1, TEX0, 2D;
+ TEX R2, R2, TEX0, 2D;
+ TEX R3, R3, TEX0, 2D;
+ TEX R4, R4, TEX0, 2D;
+
+ # Add c * sqrt(1 - r^2)
+ ...
+
+ # Take maximum
+ ...
+
+ """
if profile == "NV_SHAD":
print "Using 2-vector HILO displacement texture with
GL_NV_texture_shader"
- [Gzz-commits] gzz/gfx/demo irregu3.py, (continued)
- [Gzz-commits] gzz/gfx/demo irregu3.py, Janne V. Kujala, 2002/10/23
- [Gzz-commits] gzz/gfx/demo irregu3.py, Janne V. Kujala, 2002/10/24
- [Gzz-commits] gzz/gfx/demo irregu3.py, Janne V. Kujala, 2002/10/25
- [Gzz-commits] gzz/gfx/demo irregu3.py, Janne V. Kujala, 2002/10/25
- [Gzz-commits] gzz/gfx/demo irregu3.py, Janne V. Kujala, 2002/10/28
- [Gzz-commits] gzz/gfx/demo irregu3.py, Janne V. Kujala, 2002/10/29
- [Gzz-commits] gzz/gfx/demo irregu3.py, Janne V. Kujala, 2002/10/29
- [Gzz-commits] gzz/gfx/demo irregu3.py, Janne V. Kujala, 2002/10/29
- [Gzz-commits] gzz/gfx/demo irregu3.py, Janne V. Kujala, 2002/10/29
- [Gzz-commits] gzz/gfx/demo irregu3.py, Janne V. Kujala, 2002/10/29
- [Gzz-commits] gzz/gfx/demo irregu3.py,
Janne V. Kujala <=
- [Gzz-commits] gzz/gfx/demo irregu3.py, Janne V. Kujala, 2002/10/31