Revision 06ddd60d
Added by Leszek Koltunski over 5 years ago
| src/main/java/org/distorted/library/main/DistortedLibrary.java | ||
|---|---|---|
| 554 | 554 |
|
| 555 | 555 |
static void drawPrivOIT(DistortedEffects effects, MeshBase mesh, InternalOutputSurface surface, long currTime) |
| 556 | 556 |
{
|
| 557 |
EffectQueue[] queues = effects.getQueues(); |
|
| 557 |
if( mMainOITProgram!=null ) |
|
| 558 |
{
|
|
| 559 |
EffectQueue[] queues = effects.getQueues(); |
|
| 558 | 560 |
|
| 559 |
EffectQueue.compute(queues, currTime); |
|
| 560 |
GLES30.glViewport(0, 0, surface.mWidth, surface.mHeight ); |
|
| 561 |
EffectQueue.compute(queues, currTime);
|
|
| 562 |
GLES30.glViewport(0, 0, surface.mWidth, surface.mHeight );
|
|
| 561 | 563 |
|
| 562 |
mMainOITProgram.useProgram(); |
|
| 563 |
GLES30.glUniform1i(mMainOITTextureH, 0); |
|
| 564 |
GLES30.glUniform2ui(mMainOITSizeH, surface.mWidth, surface.mHeight); |
|
| 565 |
GLES30.glUniform1ui(mMainOITNumRecordsH, (int)(mBufferSize*surface.mWidth*surface.mHeight) ); |
|
| 566 |
mesh.bindVertexAttribs(mMainOITProgram); |
|
| 567 |
mesh.send(1); |
|
| 564 |
mMainOITProgram.useProgram();
|
|
| 565 |
GLES30.glUniform1i(mMainOITTextureH, 0);
|
|
| 566 |
GLES30.glUniform2ui(mMainOITSizeH, surface.mWidth, surface.mHeight);
|
|
| 567 |
GLES30.glUniform1ui(mMainOITNumRecordsH, (int)(mBufferSize*surface.mWidth*surface.mHeight) );
|
|
| 568 |
mesh.bindVertexAttribs(mMainOITProgram);
|
|
| 569 |
mesh.send(1);
|
|
| 568 | 570 |
|
| 569 |
float inflate = mesh.getInflate(); |
|
| 570 |
float distance = surface.mDistance; |
|
| 571 |
float mipmap = surface.mMipmap; |
|
| 572 |
float[] projection= surface.mProjectionMatrix; |
|
| 571 |
float inflate = mesh.getInflate();
|
|
| 572 |
float distance = surface.mDistance;
|
|
| 573 |
float mipmap = surface.mMipmap;
|
|
| 574 |
float[] projection= surface.mProjectionMatrix;
|
|
| 573 | 575 |
|
| 574 |
EffectQueue.send(queues, distance, mipmap, projection, inflate, mesh, 1 ); |
|
| 575 |
GLES30.glDrawArrays(GLES30.GL_TRIANGLE_STRIP, 0, mesh.getNumVertices() ); |
|
| 576 |
EffectQueue.send(queues, distance, mipmap, projection, inflate, mesh, 1 );
|
|
| 577 |
GLES30.glDrawArrays(GLES30.GL_TRIANGLE_STRIP, 0, mesh.getNumVertices() );
|
|
| 576 | 578 |
|
| 577 |
if( mesh.getShowNormals() ) |
|
| 578 |
{
|
|
| 579 |
mMainProgram.useProgram(); |
|
| 580 |
mesh.send(0); |
|
| 581 |
EffectQueue.send(queues, distance, mipmap, projection, inflate, mesh, 0 ); |
|
| 582 |
displayNormals(queues,mesh); |
|
| 579 |
if( mesh.getShowNormals() ) |
|
| 580 |
{
|
|
| 581 |
mMainProgram.useProgram(); |
|
| 582 |
mesh.send(0); |
|
| 583 |
EffectQueue.send(queues, distance, mipmap, projection, inflate, mesh, 0 ); |
|
| 584 |
displayNormals(queues,mesh); |
|
| 585 |
} |
|
| 583 | 586 |
} |
| 584 | 587 |
} |
| 585 | 588 |
|
| ... | ... | |
| 732 | 735 |
{
|
| 733 | 736 |
if( mOITClearProgram==null ) |
| 734 | 737 |
{
|
| 735 |
android.util.Log.e("aa", "attempting OIT compilation");
|
|
| 736 |
|
|
| 737 | 738 |
if( mGLSL>=310 && !mOITCompilationAttempted ) |
| 738 | 739 |
{
|
| 739 | 740 |
mOITCompilationAttempted = true; |
| ... | ... | |
| 747 | 748 |
mListener.distortedException(ex); |
| 748 | 749 |
return; |
| 749 | 750 |
} |
| 750 |
|
|
| 751 |
android.util.Log.e("aa", "OIT compilation successfull");
|
|
| 752 | 751 |
} |
| 753 | 752 |
else |
| 754 | 753 |
{
|
Also available in: Unified diff
Fixes for the previous commit.