[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob include/vob/vobs/Texture.hxx vob/demo/mu...
From: |
Janne V. Kujala |
Subject: |
[Gzz-commits] libvob include/vob/vobs/Texture.hxx vob/demo/mu... |
Date: |
Fri, 27 Jun 2003 05:11:47 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Branch:
Changes by: Janne V. Kujala <address@hidden> 03/06/27 05:11:47
Modified files:
include/vob/vobs: Texture.hxx
vob/demo/multifil: fillet3d.py
vob/fillet : light3d.py
Log message:
Depth visible
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Texture.hxx.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/demo/multifil/fillet3d.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/vob/fillet/light3d.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
Patches:
Index: libvob/include/vob/vobs/Texture.hxx
diff -u libvob/include/vob/vobs/Texture.hxx:1.1
libvob/include/vob/vobs/Texture.hxx:1.2
--- libvob/include/vob/vobs/Texture.hxx:1.1 Fri Jun 27 04:39:51 2003
+++ libvob/include/vob/vobs/Texture.hxx Fri Jun 27 05:11:47 2003
@@ -68,7 +68,7 @@
glGetFloatv(GL_CURRENT_RASTER_POSITION, ras);
glCopyTexSubImage2D(target, level, x, y,
- (int)ras[0], (int)ras[1] + h,
+ (int)ras[0], (int)ras[1] - h,
w, h);
}
Index: libvob/vob/demo/multifil/fillet3d.py
diff -u libvob/vob/demo/multifil/fillet3d.py:1.4
libvob/vob/demo/multifil/fillet3d.py:1.5
--- libvob/vob/demo/multifil/fillet3d.py:1.4 Fri Jun 27 04:39:51 2003
+++ libvob/vob/demo/multifil/fillet3d.py Fri Jun 27 05:11:47 2003
@@ -35,7 +35,7 @@
"3D filleting"
def __init__(self):
self.depthTexture = GL.createTexture()
- self.depthTexture.loadNull2D(0, "DEPTH_COMPONENT",
+ self.depthTexture.loadNull2D(0, "DEPTH_COMPONENT24",
1024, 1024, 0, "DEPTH_COMPONENT",
"BYTE")
self.depthTexture.setTexParameter("TEXTURE_2D",
@@ -124,7 +124,29 @@
vs.put(getDListNocoords("""
BindProgram VERTEX_PROGRAM_ARB 0
+ Disable VERTEX_PROGRAM_ARB
+ BindTexture TEXTURE_2D %s
+ Enable TEXTURE_2D
+ """ % self.depthTexture.getTexId()))
+
+ # Now, draw the edges
+ vs.put(GLRen.createCopyTexSubImage2D("TEXTURE_2D",
+ 0, 0, 0, 1024, 1024), 0)
+
+ vs.put(getDListNocoords("""
+ Color 1 1 1
+ BindProgram FRAGMENT_PROGRAM_NV %s
+ Enable FRAGMENT_PROGRAM_NV
+ """ % light3d.edgefp.getProgId()))
+
+ vs.put(quad(), vs.orthoCS(0, "A", -100, 0, 0, 1024,768))
+
+ vs.put(getDListNocoords("""
+ BindTexture TEXTURE_2D 0
+ Disable FRAGMENT_PROGRAM_NV
PopAttrib
"""))
+
+
Index: libvob/vob/fillet/light3d.py
diff -u libvob/vob/fillet/light3d.py:1.2 libvob/vob/fillet/light3d.py:1.3
--- libvob/vob/fillet/light3d.py:1.2 Fri Jun 27 03:55:56 2003
+++ libvob/vob/fillet/light3d.py Fri Jun 27 05:11:47 2003
@@ -43,3 +43,30 @@
""", "arbvp1")),
]
+
+edgefp = GL.createProgram(cg.compile("""
+void main(
+ float4 incol: COLOR0,
+ float4 wpos : WPOS,
+ uniform sampler2D tex0,
+ out float4 col : COLOR) {
+ float2 tc = wpos.xy / 1024.0;
+ float d = tex2D(tex0, tc).w;
+ float d1 = tex2D(tex0, tc + (0,1/1024.0)).w;
+ float d2 = tex2D(tex0, tc + (0,-1/1024.0)).w;
+ float d3 = tex2D(tex0, tc + (1/1024.0,0)).w;
+ float d4 = tex2D(tex0, tc + (-1/1024.0,0)).w;
+
+ float4 color;
+ color.xyz = 100*(abs(d1-d) + abs(d2-d) + abs(d3-d) + abs(d4-d));
+ color.y = (d > .5 ? 1 : 0);
+ color.xz = 0;
+ color.x = tex2D(tex0, tc).x;
+ color.y = (d == 1 ? 1 : 0);
+ // color.z = wpos.x / 1024;
+ color.w = 1;
+
+ col = color;
+}
+
+""", "fp30"))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] libvob include/vob/vobs/Texture.hxx vob/demo/mu...,
Janne V. Kujala <=