Revision 6c00149d
Added by Leszek Koltunski over 5 years ago
src/main/java/org/distorted/library/main/DistortedEffects.java | ||
---|---|---|
29 | 29 |
import org.distorted.library.effect.EffectType; |
30 | 30 |
import org.distorted.library.effect.FragmentEffect; |
31 | 31 |
import org.distorted.library.effect.VertexEffect; |
32 |
import org.distorted.library.mesh.MeshObject; |
|
32 | 33 |
import org.distorted.library.message.EffectListener; |
33 | 34 |
import org.distorted.library.program.DistortedProgram; |
34 | 35 |
|
... | ... | |
424 | 425 |
|
425 | 426 |
private void displayNormals(MeshObject mesh) |
426 | 427 |
{ |
428 |
int num = mesh.getNumVertices(); |
|
429 |
|
|
427 | 430 |
GLES31.glBindBufferBase(GLES31.GL_TRANSFORM_FEEDBACK_BUFFER, 0, mesh.getTFO() ); |
428 | 431 |
GLES31.glBeginTransformFeedback( GLES31.GL_POINTS); |
429 | 432 |
DistortedRenderState.switchOffDrawing(); |
430 |
GLES31.glDrawArrays( GLES31.GL_POINTS, 0, mesh.numVertices);
|
|
433 |
GLES31.glDrawArrays( GLES31.GL_POINTS, 0, num );
|
|
431 | 434 |
DistortedRenderState.restoreDrawing(); |
432 | 435 |
GLES31.glEndTransformFeedback(); |
433 | 436 |
GLES31.glBindBufferBase(GLES31.GL_TRANSFORM_FEEDBACK_BUFFER, 0, 0); |
... | ... | |
438 | 441 |
GLES31.glVertexAttribPointer(mNormalProgram.mAttribute[0], MeshObject.POS_DATA_SIZE, GLES31.GL_FLOAT, false, 0, 0); |
439 | 442 |
GLES31.glBindBuffer(GLES31.GL_ARRAY_BUFFER, 0); |
440 | 443 |
GLES31.glLineWidth(8.0f); |
441 |
GLES31.glDrawArrays(GLES31.GL_LINES, 0, 2*mesh.numVertices);
|
|
444 |
GLES31.glDrawArrays(GLES31.GL_LINES, 0, 2*num);
|
|
442 | 445 |
} |
443 | 446 |
|
444 | 447 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
453 | 456 |
|
454 | 457 |
void drawPrivOIT(float halfW, float halfH, MeshObject mesh, DistortedOutputSurface surface, long currTime) |
455 | 458 |
{ |
456 |
float halfZ = halfW*mesh.zFactor;
|
|
459 |
float halfZ = halfW*mesh.getZFactor();
|
|
457 | 460 |
|
458 | 461 |
mM.compute(currTime); |
459 | 462 |
mV.compute(currTime,halfW,halfH,halfZ); |
... | ... | |
477 | 480 |
mV.send(1); |
478 | 481 |
mF.send(1); |
479 | 482 |
|
480 |
GLES31.glDrawArrays(GLES31.GL_TRIANGLE_STRIP, 0, mesh.numVertices);
|
|
483 |
GLES31.glDrawArrays(GLES31.GL_TRIANGLE_STRIP, 0, mesh.getNumVertices() );
|
|
481 | 484 |
|
482 |
if( mesh.mShowNormals )
|
|
485 |
if( mesh.getShowNormals() )
|
|
483 | 486 |
{ |
484 | 487 |
mMainProgram.useProgram(); |
485 | 488 |
mM.send(surface,halfW,halfH,halfZ,0,0); |
... | ... | |
493 | 496 |
|
494 | 497 |
void drawPriv(float halfW, float halfH, MeshObject mesh, DistortedOutputSurface surface, long currTime) |
495 | 498 |
{ |
496 |
float halfZ = halfW*mesh.zFactor;
|
|
499 |
float halfZ = halfW*mesh.getZFactor();
|
|
497 | 500 |
|
498 | 501 |
mM.compute(currTime); |
499 | 502 |
mV.compute(currTime,halfW,halfH,halfZ); |
... | ... | |
515 | 518 |
mV.send(0); |
516 | 519 |
mF.send(0); |
517 | 520 |
|
518 |
GLES31.glDrawArrays(GLES31.GL_TRIANGLE_STRIP, 0, mesh.numVertices);
|
|
521 |
GLES31.glDrawArrays(GLES31.GL_TRIANGLE_STRIP, 0, mesh.getNumVertices() );
|
|
519 | 522 |
|
520 |
if( mesh.mShowNormals ) displayNormals(mesh);
|
|
523 |
if( mesh.getShowNormals() ) displayNormals(mesh);
|
|
521 | 524 |
} |
522 | 525 |
|
523 | 526 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Fully move the Meshes to their own package.