Panda3D
Classes | Variables
direct.filter.CommonFilters Namespace Reference

Classes

class  CommonFilters
 
class  FilterConfig
 

Variables

string CARTOON_BODY
 
string SSAO_BODY
 

Detailed Description

Class CommonFilters implements certain common image
postprocessing filters.

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

Variable Documentation

◆ CARTOON_BODY

string CARTOON_BODY
Initial value:
1 = """
2 float4 cartoondelta = k_cartoonseparation * texpix_txaux.xwyw;
3 float4 cartoon_c0 = tex2D(k_txaux, %(texcoord)s + cartoondelta.xy);
4 float4 cartoon_c1 = tex2D(k_txaux, %(texcoord)s - cartoondelta.xy);
5 float4 cartoon_c2 = tex2D(k_txaux, %(texcoord)s + cartoondelta.wz);
6 float4 cartoon_c3 = tex2D(k_txaux, %(texcoord)s - cartoondelta.wz);
7 float4 cartoon_mx = max(cartoon_c0, max(cartoon_c1, max(cartoon_c2, cartoon_c3)));
8 float4 cartoon_mn = min(cartoon_c0, min(cartoon_c1, min(cartoon_c2, cartoon_c3)));
9 float cartoon_thresh = saturate(dot(cartoon_mx - cartoon_mn, float4(3,3,0,0)) - 0.5);
10 o_color = lerp(o_color, k_cartooncolor, cartoon_thresh);
11 """

◆ SSAO_BODY

string SSAO_BODY