31 |
# A list of paper makers, as tuples: |
# A list of paper makers, as tuples: |
32 |
# (function, description) |
# (function, description) |
33 |
# |
# |
34 |
|
# The function returns the suitable parameters for |
35 |
|
# Functional.createFunctionInstance, i.e. |
36 |
|
# type and list of parameters. |
37 |
|
# |
38 |
# Separated by whether the fancy bg is shown or not. |
# Separated by whether the fancy bg is shown or not. |
39 |
# |
# |
40 |
# The function is set to None for those that are |
# The function is set to None for those that are |
66 |
|
|
67 |
def white(w = None, paperMill = None, paperOffset = 0, |
def white(w = None, paperMill = None, paperOffset = 0, |
68 |
filter = ""): |
filter = ""): |
69 |
return PlainPaperMaker(1, """ |
return (PlainPaperMaker, [1, """ |
70 |
TexEnv TEXTURE_ENV TEXTURE_ENV_MODE REPLACE |
TexEnv TEXTURE_ENV TEXTURE_ENV_MODE REPLACE |
71 |
Enable TEXTURE_2D |
Enable TEXTURE_2D |
72 |
Disable BLEND |
Disable BLEND |
73 |
""" + filter, """ |
""" + filter, """ |
74 |
""", None) |
""", None]) |
75 |
|
|
76 |
whitePaperMakers.append( (white, "White background") ) |
whitePaperMakers.append( (white, "White background") ) |
77 |
|
|
131 |
if paperMill == None: |
if paperMill == None: |
132 |
paperMill = PaperMill.getInstance() |
paperMill = PaperMill.getInstance() |
133 |
|
|
134 |
return PlainPaperMaker(2, """ |
return (PlainPaperMaker, [2, """ |
135 |
BindProgram FRAGMENT_PROGRAM_NV %s |
BindProgram FRAGMENT_PROGRAM_NV %s |
136 |
ActiveTexture TEXTURE2 |
ActiveTexture TEXTURE2 |
137 |
TexEnv TEXTURE_FILTER_CONTROL TEXTURE_LOD_BIAS 3.8 |
TexEnv TEXTURE_FILTER_CONTROL TEXTURE_LOD_BIAS 3.8 |
144 |
ActiveTexture TEXTURE2 |
ActiveTexture TEXTURE2 |
145 |
TexEnv TEXTURE_FILTER_CONTROL TEXTURE_LOD_BIAS 0 |
TexEnv TEXTURE_FILTER_CONTROL TEXTURE_LOD_BIAS 0 |
146 |
ActiveTexture TEXTURE0 |
ActiveTexture TEXTURE0 |
147 |
""", [nvBlurProgram], paperMill) |
""", [nvBlurProgram], paperMill]) |
148 |
|
|
149 |
if nvBlurProgram: |
if nvBlurProgram: |
150 |
b = nvFancyBlur |
b = nvFancyBlur |
197 |
if paperMill == None: |
if paperMill == None: |
198 |
paperMill = PaperMill.getInstance() |
paperMill = PaperMill.getInstance() |
199 |
|
|
200 |
return PlainPaperMaker(1, """ |
return (PlainPaperMaker, [1, """ |
201 |
BindProgram FRAGMENT_PROGRAM_ARB %s |
BindProgram FRAGMENT_PROGRAM_ARB %s |
202 |
Enable FRAGMENT_PROGRAM_ARB |
Enable FRAGMENT_PROGRAM_ARB |
203 |
Disable REGISTER_COMBINERS_NV |
Disable REGISTER_COMBINERS_NV |
204 |
Disable BLEND |
Disable BLEND |
205 |
""" % blurProgram.getProgId(), |
""" % blurProgram.getProgId(), |
206 |
""" |
""" |
207 |
""", [blurProgram], paperMill) |
""", [blurProgram], paperMill]) |
208 |
|
|
209 |
if blurProgram: |
if blurProgram: |
210 |
b = fancyBlur |
b = fancyBlur |
281 |
return fancyBlend(paperMill) |
return fancyBlend(paperMill) |
282 |
if paperMill == None: |
if paperMill == None: |
283 |
paperMill = PaperMill.getInstance() |
paperMill = PaperMill.getInstance() |
284 |
return HaloPaperMaker_2tex(paperMill) |
return (HaloPaperMaker_2tex, [paperMill]) |
285 |
|
|
286 |
if GL.hasExtension("GL_NV_register_combiners"): |
if GL.hasExtension("GL_NV_register_combiners"): |
287 |
b = fancyHalo |
b = fancyHalo |
293 |
def fancyBlend(paperMill = None, paperOffset = 0, |
def fancyBlend(paperMill = None, paperOffset = 0, |
294 |
filter = ""): |
filter = ""): |
295 |
paperMill = getPaperMill(paperMill, paperOffset) |
paperMill = getPaperMill(paperMill, paperOffset) |
296 |
return PlainPaperMaker(1, |
return (PlainPaperMaker, [1, |
297 |
""" |
""" |
298 |
ActiveTexture TEXTURE0 |
ActiveTexture TEXTURE0 |
299 |
TexEnv TEXTURE_ENV TEXTURE_ENV_MODE REPLACE |
TexEnv TEXTURE_ENV TEXTURE_ENV_MODE REPLACE |
304 |
%s |
%s |
305 |
Disable BLEND |
Disable BLEND |
306 |
ActiveTexture TEXTURE0 |
ActiveTexture TEXTURE0 |
307 |
""" % filter, "", None, paperMill) |
""" % filter, "", None, paperMill]) |
308 |
|
|
309 |
fancyPaperMakers.append( (fancyBlend, "No enhancement, Just rendering text on top of Bg (Not recommended)") ) |
fancyPaperMakers.append( (fancyBlend, "No enhancement, Just rendering text on top of Bg (Not recommended)") ) |
310 |
|
|