Revision 11fb6ce0
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/library/DistortedEffects.java | ||
---|---|---|
146 | 146 |
} |
147 | 147 |
else |
148 | 148 |
{ |
149 |
if( mV.mNumEffects>0 || mF.mNumEffects>0 ) |
|
149 |
if( mV.mNumEffects==0 && mF.mNumEffects==0 && mesh.canUsePostprocessingShortcut() ) |
|
150 |
{ |
|
151 |
mM.constructMatrices(df,halfInputW,halfInputH); |
|
152 |
mP.render(2*halfInputW, 2*halfInputH, mM.getMVP(), df); |
|
153 |
} |
|
154 |
else |
|
150 | 155 |
{ |
151 | 156 |
mProgram.useProgram(); |
152 | 157 |
mBufferFBO.resizeFast(df.mWidth, df.mHeight); |
... | ... | |
168 | 173 |
mBufferFBO.setAsInput(); |
169 | 174 |
mP.render(df.mWidth, df.mHeight, mMVPMatrix, df); |
170 | 175 |
} |
171 |
else |
|
172 |
{ |
|
173 |
mM.constructMatrices(df,halfInputW,halfInputH); |
|
174 |
mP.render(2*halfInputW, 2*halfInputH, mM.getMVP(), df); |
|
175 |
} |
|
176 | 176 |
} |
177 | 177 |
} |
178 | 178 |
|
src/main/java/org/distorted/library/EffectQueuePostprocess.java | ||
---|---|---|
151 | 151 |
} |
152 | 152 |
|
153 | 153 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
154 |
// w,h - width and height of hte input texture. MVP - Model-View-Projection matrix to apply to the |
|
155 |
// texture; df - output FBO. |
|
154 | 156 |
|
155 | 157 |
synchronized void render(float w, float h, float[] mvp, DistortedFramebuffer df) |
156 | 158 |
{ |
src/main/java/org/distorted/library/MeshCubes.java | ||
---|---|---|
740 | 740 |
mMeshTexture.put(textureData).position(0); |
741 | 741 |
} |
742 | 742 |
|
743 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
744 |
|
|
745 |
boolean canUsePostprocessingShortcut() |
|
746 |
{ |
|
747 |
return false; |
|
748 |
} |
|
749 |
|
|
743 | 750 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
744 | 751 |
// PUBLIC API |
745 | 752 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/library/MeshFlat.java | ||
---|---|---|
156 | 156 |
return ret; |
157 | 157 |
} |
158 | 158 |
*/ |
159 |
|
|
160 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
161 |
|
|
162 |
boolean canUsePostprocessingShortcut() |
|
163 |
{ |
|
164 |
return true; |
|
165 |
} |
|
166 |
|
|
159 | 167 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
160 | 168 |
// PUBLIC API |
161 | 169 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/library/MeshObject.java | ||
---|---|---|
48 | 48 |
{ |
49 | 49 |
zFactor = factor; |
50 | 50 |
} |
51 |
|
|
52 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
53 |
|
|
54 |
abstract boolean canUsePostprocessingShortcut(); |
|
51 | 55 |
} |
Also available in: Unified diff
Correct a bug with Postprocessing Shortcut.