Revision e8b2f311
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/library/DistortedEffects.java | ||
---|---|---|
86 | 86 |
|
87 | 87 |
private boolean matrixCloned, vertexCloned, fragmentCloned, postprocessCloned; |
88 | 88 |
|
89 |
private int mL, mR, mT, mB; |
|
90 |
|
|
91 | 89 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
92 | 90 |
|
93 | 91 |
static void createProgram(Resources resources) |
... | ... | |
184 | 182 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
185 | 183 |
// DEBUG ONLY |
186 | 184 |
|
185 |
@SuppressWarnings("unused") |
|
187 | 186 |
private void displayBoundingRect(float halfX, float halfY, float halfZ, DistortedFramebuffer df, float[] mvp, float[] vertices) |
188 | 187 |
{ |
189 | 188 |
int len = vertices.length/3; |
... | ... | |
193 | 192 |
int maxy = Integer.MIN_VALUE; |
194 | 193 |
int wx,wy; |
195 | 194 |
|
196 |
int l=-1,r=-1,t=-1,b=-1; |
|
197 |
|
|
198 | 195 |
float x,y,z, X,Y,W, ndcX,ndcY; |
199 | 196 |
|
200 | 197 |
for(int i=0; i<len; i++) |
... | ... | |
213 | 210 |
wx = (int)(df.mWidth *(ndcX+1)/2); |
214 | 211 |
wy = (int)(df.mHeight*(ndcY+1)/2); |
215 | 212 |
|
216 |
if( wx<minx ) { minx = wx; l = i; }
|
|
217 |
if( wx>maxx ) { maxx = wx; r = i; }
|
|
218 |
if( wy<miny ) { miny = wy; t = i; }
|
|
219 |
if( wy>maxy ) { maxy = wy; b = i; }
|
|
213 |
if( wx<minx ) minx = wx;
|
|
214 |
if( wx>maxx ) maxx = wx;
|
|
215 |
if( wy<miny ) miny = wy;
|
|
216 |
if( wy>maxy ) maxy = wy;
|
|
220 | 217 |
} |
221 | 218 |
|
222 | 219 |
mDebugProgram.useProgram(); |
... | ... | |
236 | 233 |
|
237 | 234 |
GLES20.glVertexAttribPointer(mDebugProgram.mAttribute[0], 2, GLES20.GL_FLOAT, false, 0, mQuadPositions); |
238 | 235 |
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4); |
239 |
|
|
240 |
if( l!=mL ) |
|
241 |
{ |
|
242 |
mL = l; |
|
243 |
android.util.Log.e("effects", "l="+l+" ("+vertices[3*l]+","+vertices[3*l+1]+","+vertices[3*l+2]+")"); |
|
244 |
} |
|
245 | 236 |
} |
246 | 237 |
|
247 | 238 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
300 | 291 |
} |
301 | 292 |
|
302 | 293 |
/// DEBUG ONLY ////// |
303 |
displayBoundingRect(halfInputH, halfInputW, halfZ, df, mM.getMVP(), mesh.getBoundingVertices() ); |
|
294 |
// displayBoundingRect(halfInputH, halfInputW, halfZ, df, mM.getMVP(), mesh.getBoundingVertices() );
|
|
304 | 295 |
/// END DEBUG /////// |
305 | 296 |
} |
306 | 297 |
|
Also available in: Unified diff
boundingVertices fully work now!