Revision faa3ff56
Added by Leszek Koltunski almost 7 years ago
src/main/java/org/distorted/library/effect/PostprocessEffect.java | ||
---|---|---|
28 | 28 |
import java.util.ArrayList; |
29 | 29 |
|
30 | 30 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
31 |
// POSTPROCESSING EFFECTS. |
|
32 |
|
|
31 |
/** |
|
32 |
* Postprocessing Effect - an Effect that works by running a certain Shader Program(s) on a Framebuffer. |
|
33 |
*/ |
|
33 | 34 |
public abstract class PostprocessEffect extends Effect |
34 | 35 |
{ |
35 |
public static final int NUM_UNIFORMS = 5; // 5 per-effect interpolated values. |
|
36 |
/** |
|
37 |
* 5: 5 per-effect interpolated values. |
|
38 |
*/ |
|
39 |
public static final int NUM_UNIFORMS = 5; |
|
36 | 40 |
|
37 |
static final int POS_DATA_SIZE= 2; // Blur Program: size of the position data in elements
|
|
38 |
static final int TEX_DATA_SIZE= 2; // Blur Program: size of the texture coordinate data in elements.
|
|
41 |
static final int POS_DATA_SIZE= 2; |
|
42 |
static final int TEX_DATA_SIZE= 2; |
|
39 | 43 |
|
40 | 44 |
static final FloatBuffer mQuadPositions, mQuadTexture, mQuadTextureInv; |
41 | 45 |
|
... | ... | |
82 | 86 |
} |
83 | 87 |
|
84 | 88 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
85 |
|
|
89 |
/** |
|
90 |
* Only for use by the library itself. |
|
91 |
* |
|
92 |
* @y.exclude |
|
93 |
*/ |
|
86 | 94 |
public static void createPrograms() |
87 | 95 |
{ |
88 | 96 |
Source source; |
... | ... | |
92 | 100 |
{ |
93 | 101 |
source = mSources.remove(0); |
94 | 102 |
|
95 |
//android.util.Log.d("postprocess", "compilaing: "+source.mName);
|
|
103 |
//android.util.Log.d("postprocess", "compiling: "+source.mName); |
|
96 | 104 |
|
97 | 105 |
try |
98 | 106 |
{ |
... | ... | |
107 | 115 |
} |
108 | 116 |
|
109 | 117 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
110 |
|
|
118 |
/** |
|
119 |
* Only for use by the library itself. |
|
120 |
* |
|
121 |
* @y.exclude |
|
122 |
*/ |
|
111 | 123 |
public abstract int apply(float[] uniforms, int index, float qualityScale, DistortedFramebuffer buffer); |
112 | 124 |
|
113 | 125 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Javadoc.