mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 15:53:55 -04:00
CommonFilters: Documentation adjustments
* State that we're using Cg shaders, ideal for clarification. * Commented out Josh's monologue since it doesn't particularly contribute to the API page * Added documentation to the setBloom function to help clarify. Closes #1200 Co-authored-by: rdb <git@rdb.name>
This commit is contained in:
parent
5caf0ff5d6
commit
500491e6c9
@ -1,21 +1,21 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
Class CommonFilters implements certain common image
|
Class CommonFilters implements certain common image
|
||||||
postprocessing filters. See the :ref:`common-image-filters` page for
|
postprocessing filters. See the :ref:`common-image-filters` page for
|
||||||
more information about how to use these filters.
|
more information about how to use these filters.
|
||||||
|
|
||||||
It is not ideal that these filters are all included in a single
|
These filters are written in the Cg shading language.
|
||||||
monolithic module. Unfortunately, when you want to apply two filters
|
|
||||||
at the same time, you have to compose them into a single shader, and
|
|
||||||
the composition process isn't simply a question of concatenating them:
|
|
||||||
you have to somehow make them work together. I suspect that there
|
|
||||||
exists some fairly simple framework that would make this automatable.
|
|
||||||
However, until I write some more filters myself, I won't know what
|
|
||||||
that framework is. Until then, I'll settle for this
|
|
||||||
clunky approach. - Josh
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# It is not ideal that these filters are all included in a single
|
||||||
|
# monolithic module. Unfortunately, when you want to apply two filters
|
||||||
|
# at the same time, you have to compose them into a single shader, and
|
||||||
|
# the composition process isn't simply a question of concatenating them:
|
||||||
|
# you have to somehow make them work together. I suspect that there
|
||||||
|
# exists some fairly simple framework that would make this automatable.
|
||||||
|
# However, until I write some more filters myself, I won't know what
|
||||||
|
# that framework is. Until then, I'll settle for this
|
||||||
|
# clunky approach. - Josh
|
||||||
|
|
||||||
from .FilterManager import FilterManager
|
from .FilterManager import FilterManager
|
||||||
from .filterBloomI import BLOOM_I
|
from .filterBloomI import BLOOM_I
|
||||||
from .filterBloomX import BLOOM_X
|
from .filterBloomX import BLOOM_X
|
||||||
@ -459,6 +459,11 @@ class CommonFilters:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def setBloom(self, blend=(0.3,0.4,0.3,0.0), mintrigger=0.6, maxtrigger=1.0, desat=0.6, intensity=1.0, size="medium"):
|
def setBloom(self, blend=(0.3,0.4,0.3,0.0), mintrigger=0.6, maxtrigger=1.0, desat=0.6, intensity=1.0, size="medium"):
|
||||||
|
"""
|
||||||
|
Applies the Bloom filter to the output.
|
||||||
|
size can either be "off", "small", "medium", or "large".
|
||||||
|
Setting size to "off" will remove the Bloom filter.
|
||||||
|
"""
|
||||||
if (size==0): size="off"
|
if (size==0): size="off"
|
||||||
elif (size==1): size="small"
|
elif (size==1): size="small"
|
||||||
elif (size==2): size="medium"
|
elif (size==2): size="medium"
|
||||||
@ -542,7 +547,7 @@ class CommonFilters:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def setBlurSharpen(self, amount=0.0):
|
def setBlurSharpen(self, amount=0.0):
|
||||||
"""Enables the blur/sharpen filter. If the 'amount' parameter is 1.0, it will not have effect.
|
"""Enables the blur/sharpen filter. If the 'amount' parameter is 1.0, it will not have any effect.
|
||||||
A value of 0.0 means fully blurred, and a value higher than 1.0 sharpens the image."""
|
A value of 0.0 means fully blurred, and a value higher than 1.0 sharpens the image."""
|
||||||
fullrebuild = (("BlurSharpen" in self.configuration) == False)
|
fullrebuild = (("BlurSharpen" in self.configuration) == False)
|
||||||
self.configuration["BlurSharpen"] = amount
|
self.configuration["BlurSharpen"] = amount
|
||||||
|
Loading…
x
Reference in New Issue
Block a user