35 |
"3D filleting" |
"3D filleting" |
36 |
def __init__(self): |
def __init__(self): |
37 |
self.depthTexture = GL.createTexture() |
self.depthTexture = GL.createTexture() |
38 |
self.depthTexture.loadNull2D(0, "DEPTH_COMPONENT24", |
rect = 1 |
39 |
1024, 1024, 0, "DEPTH_COMPONENT", |
targ = "TEXTURE_RECTANGLE_NV" |
40 |
"BYTE") |
self.depthTexture.loadNull2D("TEXTURE_RECTANGLE_NV", 0, "DEPTH_COMPONENT24", |
41 |
self.depthTexture.setTexParameter("TEXTURE_2D", |
1024, 768, 0, "DEPTH_COMPONENT", |
42 |
"TEXTURE_MAX_LEVEL", 0) |
"INT") |
43 |
self.depthTexture.setTexParameter("TEXTURE_2D", |
if not rect: |
44 |
"DEPTH_TEXTURE_MODE", "ALPHA") |
self.depthTexture.setTexParameter(targ, |
45 |
self.depthTexture.setTexParameter("TEXTURE_2D", |
"TEXTURE_MAX_LEVEL", 0) |
46 |
"TEXTURE_BASE_LEVEL", 0) |
self.depthTexture.setTexParameter(targ, |
47 |
self.depthTexture.setTexParameter("TEXTURE_2D", |
"TEXTURE_BASE_LEVEL", 0) |
48 |
"TEXTURE_MIN_FILTER", "NEAREST") |
self.depthTexture.setTexParameter(targ, |
49 |
self.depthTexture.setTexParameter("TEXTURE_2D", |
"TEXTURE_MIN_FILTER", "LINEAR") |
50 |
"TEXTURE_MAG_FILTER", "NEAREST") |
self.depthTexture.setTexParameter(targ, |
51 |
|
"TEXTURE_MAG_FILTER", "LINEAR") |
52 |
|
else: |
53 |
|
self.depthTexture.setTexParameter(targ, |
54 |
|
"TEXTURE_MIN_FILTER", "LINEAR") |
55 |
|
self.depthTexture.setTexParameter(targ, |
56 |
|
"TEXTURE_MAG_FILTER", "LINEAR") |
57 |
|
#self.depthTexture.setTexParameter(targ, |
58 |
|
# "DEPTH_TEXTURE_MODE", "ALPHA") |
59 |
self.key = KeyPresses( |
self.key = KeyPresses( |
60 |
self, |
self, |
61 |
SlideLin("x", 200, 20, "x", "Left", "Right"), |
SlideLin("x", 200, 20, "x", "Left", "Right"), |
127 |
vs.put(getDListNocoords(""" |
vs.put(getDListNocoords(""" |
128 |
BindProgram VERTEX_PROGRAM_ARB 0 |
BindProgram VERTEX_PROGRAM_ARB 0 |
129 |
Disable VERTEX_PROGRAM_ARB |
Disable VERTEX_PROGRAM_ARB |
130 |
BindTexture TEXTURE_2D %s |
BindTexture TEXTURE_RECTANGLE_NV %s |
131 |
Enable TEXTURE_2D |
Enable TEXTURE_RECTANGLE_NV |
132 |
""" % self.depthTexture.getTexId())) |
""" % self.depthTexture.getTexId())) |
133 |
|
|
134 |
# Now, draw the edges |
|
135 |
vs.put(GLRen.createCopyTexSubImage2D("TEXTURE_2D", |
# Now, draw the edges |
136 |
0, 0, 0, 1024, 1024), 0) |
vs.put(GLRen.createCopyTexSubImage2D("TEXTURE_RECTANGLE_NV", |
137 |
|
0, 0, 0, 1024, 768), 0) |
138 |
|
|
139 |
|
|
140 |
vs.put(getDListNocoords(""" |
vs.put(getDListNocoords(""" |
141 |
Color 1 1 1 |
Color 1 1 1 |
142 |
BindProgram FRAGMENT_PROGRAM_NV %s |
BindProgram FRAGMENT_PROGRAM_NV %s |
143 |
Enable FRAGMENT_PROGRAM_NV |
Enable FRAGMENT_PROGRAM_NV |
144 |
Enable BLEND |
Enable BLEND |
145 |
""" % light3d.edgefp.getProgId())) |
""" % light3d.edgefp.getProgId())) |
146 |
|
|
147 |
vs.put(quad(), vs.orthoCS(0, "A", -100, 0, 0, 1024,1024)) |
vs.put(quad(), vs.orthoCS(0, "A", -100, 0, 0, 1024,768)) |
148 |
|
|
149 |
vs.put(getDListNocoords(""" |
vs.put(getDListNocoords(""" |
150 |
BindTexture TEXTURE_2D 0 |
BindTexture TEXTURE_RECTANGLE_NV 0 |
151 |
Disable FRAGMENT_PROGRAM_NV |
Disable FRAGMENT_PROGRAM_NV |
152 |
PopAttrib |
PopAttrib |
153 |
""")) |
""")) |