Project

General

Profile

« Previous | Next » 

Revision db758bd0

Added by Leszek Koltunski about 2 years ago

On OpenGL ES 3.0, some drivers are veeeery slow linking a program which includes transform feedback - and such program is needed to apply vertex effects to meshes - which is needed to round corners of puzzle cubits.

Thus on 3.0 we switch off rounding corners of the meshes in the Creator mode, otherwise we'd need to wait about 24 seconds for the screen to appear!

View differences:

src/main/java/org/distorted/objectlib/objects/TwistyBandagedAbstract.java
24 24

  
25 25
import java.io.InputStream;
26 26

  
27
import org.distorted.library.main.DistortedLibrary;
27 28
import org.distorted.library.type.Static3D;
28 29
import org.distorted.library.type.Static4D;
29 30

  
......
344 345

  
345 346
  public ObjectFaceShape getObjectFaceShape(int variant)
346 347
    {
348
    int driver = DistortedLibrary.getGLSL();
349
    boolean roundCorners = (driver>300);
347 350
    int type,numTypes = mDims.length;
348 351
    for(type=0; type<numTypes; type++) if( mTypeVariantMap[type]==variant ) break;
349 352

  
350 353
    if( type<numTypes )
351 354
      {
355
      int val = roundCorners ? 0 : -1;
352 356
      int X = mDims[type][0];
353 357
      int Y = mDims[type][1];
354 358
      int Z = mDims[type][2];
......
356 360
      float height        = isInIconMode() ? 0.001f : 0.048f;
357 361
      int[] bandIndices   = { 0,0,1,1,2,2 };
358 362
      float[][] corners   = { {0.04f,0.15f} };
359
      int[] cornerIndices = { 0,0,0,0,0,0,0,0 };
363
      int[] cornerIndices = { val,val,val,val,val,val,val,val };
360 364
      int[] centerIndices = { 0,1,2,3,4,5,6,7 };
361 365

  
362 366
      int maxXY = Math.max(X,Y);
......
386 390
      }
387 391

  
388 392
    FactoryBandaged3x3Cubit factory = FactoryBandaged3x3Cubit.getInstance();
389
    return factory.createIrregularFaceShape(variant, isInIconMode() );
393
    return factory.createIrregularFaceShape(variant, isInIconMode(), roundCorners );
390 394
    }
391 395

  
392 396
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff