Revision 27f42cd6
Added by Leszek Koltunski over 8 years ago
| src/main/java/org/distorted/library/DistortedEffectsPostprocess.java | ||
|---|---|---|
| 62 | 62 |
|
| 63 | 63 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 64 | 64 |
|
| 65 |
EffectQueuePostprocess getPostprocess()
|
|
| 65 |
int postprocess(long time, DistortedOutputSurface surface)
|
|
| 66 | 66 |
{
|
| 67 |
return mP; |
|
| 67 |
return mP.postprocess(time,surface); |
|
| 68 |
} |
|
| 69 |
|
|
| 70 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 71 |
|
|
| 72 |
long getBucket() |
|
| 73 |
{
|
|
| 74 |
return mP.mNumEffects==0 ? 0: mID; |
|
| 68 | 75 |
} |
| 69 | 76 |
|
| 70 | 77 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/library/DistortedNode.java | ||
|---|---|---|
| 212 | 212 |
return 0; |
| 213 | 213 |
} |
| 214 | 214 |
|
| 215 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 216 |
|
|
| 217 |
EffectQueuePostprocess getPostprocess() |
|
| 218 |
{
|
|
| 219 |
return mPostprocess==null ? null : mPostprocess.getPostprocess(); |
|
| 220 |
} |
|
| 221 |
|
|
| 222 | 215 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 223 | 216 |
// return the total number of render calls issued |
| 224 | 217 |
|
| ... | ... | |
| 535 | 528 |
// TODO: rearrange all the siblings so that all are sorted by the DistortedEffectsPostprocess' ID. |
| 536 | 529 |
} |
| 537 | 530 |
|
| 531 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 532 |
/** |
|
| 533 |
* Returns the DistortedEffectsPostprocess object that's in the Node. |
|
| 534 |
* |
|
| 535 |
* @return The DistortedEffectsPostprocess contained in the Node. |
|
| 536 |
*/ |
|
| 537 |
public DistortedEffectsPostprocess getEffectsPostprocess() |
|
| 538 |
{
|
|
| 539 |
return mPostprocess; |
|
| 540 |
} |
|
| 541 |
|
|
| 538 | 542 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 539 | 543 |
/** |
| 540 | 544 |
* Returns the DistortedEffects object that's in the Node. |
| src/main/java/org/distorted/library/DistortedOutputSurface.java | ||
|---|---|---|
| 124 | 124 |
{
|
| 125 | 125 |
int numRenders = 0; |
| 126 | 126 |
DistortedNode child; |
| 127 |
EffectQueuePostprocess lastP=null, currP;
|
|
| 127 |
DistortedEffectsPostprocess lastP=null, currP;
|
|
| 128 | 128 |
long lastB=0, currB; |
| 129 | 129 |
|
| 130 | 130 |
for(int i=0; i<num; i++) |
| 131 | 131 |
{
|
| 132 | 132 |
child = children.get(i); |
| 133 |
currP = child.getPostprocess(); |
|
| 133 |
currP = child.getEffectsPostprocess();
|
|
| 134 | 134 |
currB = currP==null ? 0 : currP.getBucket(); |
| 135 | 135 |
|
| 136 | 136 |
if( lastB!=currB && lastB!=0 ) |
| src/main/java/org/distorted/library/EffectQueuePostprocess.java | ||
|---|---|---|
| 158 | 158 |
mDepthTexture2H = GLES30.glGetUniformLocation( blur2ProgramH, "u_DepthTexture"); |
| 159 | 159 |
} |
| 160 | 160 |
|
| 161 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 162 |
// TODO: change this into a EQP <--> long Map. |
|
| 163 |
// For now, just returning number of effects is sufficient. |
|
| 164 |
|
|
| 165 |
long getBucket() |
|
| 166 |
{
|
|
| 167 |
return mNumEffects; |
|
| 168 |
} |
|
| 169 |
|
|
| 170 | 161 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 171 | 162 |
|
| 172 | 163 |
synchronized boolean compute(long currTime) |
Also available in: Unified diff
Actually implement proper postprocessing Buckets.