49 |
|
|
50 |
# Check whether anisotropic filtering is supported |
# Check whether anisotropic filtering is supported |
51 |
if GL.hasExtension("GL_EXT_texture_filter_anisotropic"): |
if GL.hasExtension("GL_EXT_texture_filter_anisotropic"): |
52 |
maxaniso = 2.0 |
if dbg: print "Anisotropic filtering available" |
|
if dbg: print "Using anisotropic filtering with maximum degree", maxaniso |
|
53 |
else: |
else: |
|
maxaniso = None |
|
54 |
if dbg: print "Anisotropic filtering not available" |
if dbg: print "Anisotropic filtering not available" |
55 |
|
|
56 |
|
|
222 |
|
|
223 |
def selectCombiner(self): |
def selectCombiner(self): |
224 |
# Check which combiners to use. |
# Check which combiners to use. |
225 |
if not self.paperopts.use_opengl_1_1 and GL.hasExtension("GL_NV_register_combiners"): |
if not self.paperopts.use_opengl_1_1 and ( |
226 |
|
GL.hasExtension("GL_NV_register_combiners") or |
227 |
|
GL.hasExtension("GL_ARB_fragment_program")): |
228 |
|
|
229 |
# We have at least a NV10, possibly better. |
# We have at least a NV10, possibly better. |
230 |
# Check the number of general combiners to be sure. |
# Check the number of general combiners to be sure. |
231 |
maxcomb = GL.getGLFloat("MAX_GENERAL_COMBINERS_NV")[0] |
#maxcomb = GL.getGLFloat("MAX_GENERAL_COMBINERS_NV")[0] |
232 |
#if maxcomb < 4: |
#if maxcomb < 4: |
233 |
if 1: #XXX NV20 version is broken |
if 1: #XXX NV20 version is broken |
234 |
# use NV10 version |
# use NV10 version |
257 |
seed = reg.get(regseed, "seed") |
seed = reg.get(regseed, "seed") |
258 |
rnd = java.util.Random(seed) |
rnd = java.util.Random(seed) |
259 |
if emboss: |
if emboss: |
260 |
sh = makeEmbossShaderPass(maxaniso) |
sh = makeEmbossShaderPass() |
261 |
else: |
else: |
262 |
sh = makeNormalShaderPass(maxaniso) |
sh = makeNormalShaderPass() |
263 |
|
|
264 |
types = sh.getTextureTypes() |
types = sh.getTextureTypes() |
265 |
for i in range(0, len(types)): |
for i in range(0, len(types)): |
352 |
ppass.putNormalTexGen(i, data) |
ppass.putNormalTexGen(i, data) |
353 |
|
|
354 |
|
|
355 |
# not fully used currently |
|
356 |
class OpenGL11_PaperOptions: |
class OpenGL11_PaperOptions: |
357 |
def __init__(self): |
def __init__(self): |
358 |
self.useOpengL11 = None |
self.useOpengL11 = None |
361 |
self.lastState = None |
self.lastState = None |
362 |
|
|
363 |
# Check which combiners to use. |
# Check which combiners to use. |
364 |
if GL.hasExtension("GL_NV_register_combiners"): |
if (GL.hasExtension("GL_NV_register_combiners") or |
365 |
|
GL.hasExtension("GL_ARB_fragment_program")): |
366 |
self.trueOpenGL11 = 0 |
self.trueOpenGL11 = 0 |
367 |
self.useOpenGL11 = 0 |
self.useOpenGL11 = 0 |
368 |
else: |
else: |